This example instruments a simple HTTP server-client application.
The application is configured to send spans and metrics to a local instance of the OpenTelemetry Collector, which propagates them to Splunk Observability Cloud.
Run the OpenTelemetry Collector and Jaeger instance:
SPLUNK_ACCESS_TOKEN=<access_token> docker compose up -d
The value for SPLUNK_ACCESS_TOKEN
can be found
here.
Reference: docs.
Run the instrumented application:
export OTEL_SERVICE_NAME="splunk-otel-go-example"
export OTEL_RESOURCE_ATTRIBUTES="deployment.environment=$(whoami)"
go run .
You can find the collected telemetry in:
- OpenTelemetry Collector output
- Jaeger: http://localhost:16686/search
- Prometheus scrape handler: http://localhost:8889/metrics
- Splunk Observability Cloud: https://app.signalfx.com/#/apm?environments=YOURUSERNAME
Note: Processing might take some time.
Cleanup:
docker compose down
Run the Splunk Distribution of the OpenTelemetry Collector instance:
SPLUNK_ACCESS_TOKEN=<access_token> docker compose -f docker-compose-splunk.yaml up -d
The value for SPLUNK_ACCESS_TOKEN
can be found
here.
Reference: docs.
Run the instrumented application:
export OTEL_SERVICE_NAME="splunk-otel-go-example"
export OTEL_RESOURCE_ATTRIBUTES="deployment.environment=$(whoami)"
go run .
You can find the collected telemetry in:
- Splunk Observability Cloud: https://app.signalfx.com/#/apm?environments=YOURUSERNAME
Note: Processing might take some time.
Cleanup:
docker compose -f docker-compose-splunk.yaml down