Running the OpenTelemetry demo application in AWS
-
Clone the OpenTelemetry demo application repository.
-
Update the trace exporter to send to Splunk Observability.
- Change
src/otel-collector/otelcol-config-extras.yml
exporters: otlphttp/splunk: traces_endpoint: https://ingest.<Splunk_Observability_realm>.signalfx.com:443/v2/trace/otlp headers: "X-SF-Token": "<Splunk_Observability_access_token>" "Content-Type": "application/x-protobuf" service: pipelines: traces: exporters: [spanmetrics, otlphttp/splunk]
- Replace
<Splunk_Observability_realm>
with your Splunk Observability realm (e.g.,us0
,us1
,eu0
, etc.) - Replace
<Splunk_Observability_access_token>
with your Splunk Observability access token.
- Replace
- Change
-
Start the OpenTelemetry demo application
You may encounter issues with OpenSearch container during startup
Since we don't need it in this lab, please remove its configuration from docker-compose.yml
file.
- If you have already run
docker compose up
please rundocker compose down
- Locate the opensearch service section and either remove it or comment it out
- Comment/Remove opensearch from the otel-collector service's depends_on section
- Verify that the application is running by visiting
http://<your-ec2-public-ip>:8080
in your web browser. You should see the OpenTelemetry demo application homepage.
View a trace in Splunk Observability
-
Call a REST API of the OpenTelemetry demo application to generate some traces
- Firsty create a random traceparent. Example of traceparent header is
00-4bf92f3577b34da6a3ce929d0e0e4736-051581bf3cb55c14-01
. - Call a REST API
- example:
- Firsty create a random traceparent. Example of traceparent header is
-
Open the trace: https://app.us1.signalfx.com/#/apm/traces/4bf92f3577b34da6a3ce929d0e0e4736
Please note that it can take up to 5 minutes to see the trace in Splunk.