The following guide describes how to setup the OpenTelemetry demo with Elastic Observability using Docker compose or Kubernetes. This fork introduces several changes to the agents used in the demo:
- The Java agent within the Ad, the Fraud Detection and the Kafka services have been replaced with the Elastic distribution of the OpenTelemetry Java Agent. You can find more information about the Elastic distribution in this blog post.
- The .NET agent within the Cart service has been replaced with the Elastic distribution of the OpenTelemetry .NET Agent. You can find more information about the Elastic distribution in this blog post.
- The Elastic distribution of the OpenTelemetry Node.js Agent has replaced the OpenTelemetry Node.js agent in the Payment service. Additional details about the Elastic distribution are available in this blog post.
- The Elastic distribution for OpenTelemetry Python has replaced the OpenTelemetry Python agent in the Recommendation service. Additional details about the Elastic distribution are available in this blog post.
Additionally, the OpenTelemetry Contrib collector has also been changed to the Elastic OpenTelemetry Collector distribution. This ensures a more integrated and optimized experience with Elastic Observability.
- Install Docker
- Install Docker Compose
- Sign up for a free trial on Elastic Cloud and depending on the deployment type choose the following:
- Elastic Cloud Hosted (ECH): In the "solution view" select "Elastic for Observability". Once that builds select Add data then Application and finally OpenTelemetry.
- Serverless: In the "choose type" choose the "Elastic for Observability" type. Once that builds select Add data then Application and finally OpenTelemetry.
- Copy the OTEL_EXPORTER_OTLP_ENDPOINT URL.
- Click "Create an API Key" to create one.
- Run
./demo.sh docker
For local development without Elastic Cloud, use start-local to run Elasticsearch, Kibana, and the EDOT Collector locally.
-
Start the Elastic stack with EDOT:
curl -fsSL https://elastic.co/start-local | sh -s -- --edot -
Start the demo in self-hosted mode:
./demo.sh docker self-hosted
-
Access:
- Demo:
http://localhost:8080 - Kibana:
http://localhost:5601(credentials shown by start-local)
- Demo:
-
Clean-up:
./demo.sh destroy docker./elastic-start-local/stop.sh./elastic-start-local/uninstall.sh
This works by using the demo's EDOT Collector as a gateway that forwards telemetry to the start-local EDOT Collector, which then exports to Elasticsearch.
The following steps shows how to start the Otel demo in a Docker container and send the generated otel data to an Elasticsearch instance running locally on the host.
- Create an API key
curl -X POST "http://localhost:9200/_security/api_key" -u USER:PASSWORD -H "Content-Type: application/json" -d'{ "name": "my_api_key" }'- Update
.env.overidewith URL and API key:
ELASTIC_OTLP_ENDPOINT="http://host.docker.internal:9200"
ELASTIC_OTLP_API_KEY="<api key obtained in step 2>"- Start the Otel demo in a Docker container:
make startDetails
- Sign up for a free trial on Elastic Cloud and depending on the deployment type choose the following:
- Elastic Cloud Hosted (ECH): In the "solution view" select "Elastic for Observability". Once that builds select Add data then Application and finally OpenTelemetry.
- Serverless: In the "choose type" choose the "Elastic for Observability" type. Once that builds select Add data then Application and finally OpenTelemetry.
- Copy the OTEL_EXPORTER_OTLP_ENDPOINT URL.
- Click "Create an API Key" to create one.
- Open the file
.env.overridein an editor and fill in the following two variables:ELASTIC_OTLP_ENDPOINT: your OTEL_EXPORTER_OTLP_ENDPOINT URL.ELASTIC_OTLP_API_KEY: your Elastic API key.
- Start the demo with the following command from the repository's root directory:
make start
- Create a Kubernetes cluster. There are no specific requirements, so you can create a local one, or use a managed Kubernetes cluster, such as GKE, EKS, or AKS.
- Set up kubectl.
- Set up Helm.
- Sign up for a free trial on Elastic Cloud and depending on the deployment type choose the following:
- Elastic Cloud Hosted (ECH): In the "solution view" select "Elastic for Observability". Once that builds select Add data then Application and finally OpenTelemetry.
- Serverless: In the "choose type" choose the "Elastic for Observability" type. Once that builds select Add data then Application and finally OpenTelemetry.
- Copy the OTEL_EXPORTER_OTLP_ENDPOINT URL.
- Click "Create an API Key" to create one.
- Run
./demo.sh k8s
Details
- Follow the EDOT Quick Start Guide for Kubernetes and your specific Elastic deployment to install the EDOT OpenTelemetry collector.
- Deploy the Elastic OpenTelemetry Demo using the following command.
helm install my-otel-demo open-telemetry/opentelemetry-demo --version 0.38.3 -f kubernetes/elastic-helm/demo.yml
In the installed configuration, browser-based load generation is disabled by default to avoid CORS (Cross-Origin Resource Sharing) issues when sending telemetry data from simulated browser clients to the OpenTelemetry Collector. If you'd like to enable browser traffic in the load generator again:
- Set LOCUST_BROWSER_TRAFFIC_ENABLED to "true" in kubernetes/elastic-helm/demo.yml.
- Modify the OTLP HTTP receiver in the DaemonSet OpenTelemetry Collector values file (used in the EDOT Quick Start Guide) to include CORS support:
This configuration allows the OTLP HTTP endpoint to accept trace data from browser-based sources running at http://frontend-proxy:8080.
receivers: otlp: protocols: http: cors: allowed_origins: - http://frontend-proxy:8080
- Upgrade the EDOT Quick Start deployment.
Suppose you want to see how your new processor is going to play out in this demo app. You can create a custom OpenTelemetry collector and test it within this demo app by following these steps:
- Follow the instructions in the elastic-collector-components repo in order to build a Docker image that contains your custom component
- Edit the deployment.yaml file:
- change the
opentelemetry-collectorimage definitions to point at your custom image repository and tag - add your component configuration to the proper sub-section of the
configsection. For example, if you are testing a processor, make sure to add its config to theprocessorssub-section. - add your component to the proper sub-section of the
servicesection. For example, if you are testing a logs processor, make sure to add its config to theprocessorssub-section of thelogspipeline.
- change the
- If you wish to enable Kubernetes node level metrics collection, edit the daemonset.yaml file:
- change the
imagesection to point at your custom image repository and tag - add your component configuration to the proper sub-section of the
configsection. For example, if you are testing a processor, make sure to add its config to theprocessorssub-section. - add your component to the proper sub-section of the
servicesection. For example, if you are testing a logs processor, make sure to add its config to theprocessorssub-section of thelogspipeline.
- change the
- Apply the Helm chart changes and install it:
# !(when running it for the first time) add the open-telemetry Helm repostiroy helm repo add open-telemetry https://open-telemetry.github.io/opentelemetry-helm-charts # !(when an older helm open-telemetry repo exists) update the open-telemetry helm repo helm repo update open-telemetry # deploy the demo through helm install helm install -f deployment.yaml my-otel-demo open-telemetry/opentelemetry-demo
- Docker. Run
./demo.sh destroy docker - Kubernetes. Run
./demo.sh destroy k8s




