Skip to content

Instantly share code, notes, and snippets.

@sorenlouv
Last active May 15, 2024 12:32
Show Gist options
  • Save sorenlouv/776812c298d9896baf78f26e76ecbf5d to your computer and use it in GitHub Desktop.
Save sorenlouv/776812c298d9896baf78f26e76ecbf5d to your computer and use it in GitHub Desktop.
OpenTelemetry Demo for Elastic stack

This is a guide for ingesting data from OpenTelemetry demo into the Elastic stack. Kibana, Elasticsearch and APM Server will be running on the host, while the OpenTelemetry Demo components will run in docker containers using Docker Compose.

Kibana

Just your standard Kibana + ES stack. Nothing interesting to see here.

git clone git@github.com:elastic/kibana.git
yarn kbn bootstrap
yarn es
yarn start

APM Server

Vanilla APM Server running on localhost:8200 with secret token my_secret_token. The OTel collector (setup below) will connect to the APM Server to ingest traces and APM metrics.

git clone git@github.com:elastic/apm-server.git

Update apm-server.yml

apm-server:
  host: "127.0.0.1:8200"
  auth
    secret_token: my_secret_token
    
output.elasticsearch:
  hosts: ["localhost:9200"]
  username: "elastic"
  password: "changeme"    

Build and run

make
./apm-server -c apm-server.yml -e -d "*"

OpenTelemetry Demo

This will run the OpenTelemetry Demo components, like the OTel Collector that will connect to APM Server.

git clone git@github.com:elastic/opentelemetry-demo.git

Update otelcol-config-extras.yml

exporters:
  otlp/elastic:
    endpoint: "host.docker.internal:8200"
    compression: none
    tls:
      insecure: true
      insecure_skip_verify: true
    headers:
      Authorization: "Bearer my_secret_token"

Run

docker-compose up -d

The otel demo is now available at http://localhost:8080/

Scenario: Single service failure with cascading impact

Kill or stop the checkout container. This will cause the failure rate in dependent services (frontend and frontend-proxy) to increase

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment