Skip to content

elastic/opentelemetry-demo

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OTel logoOTel logo OpenTelemetry Demo with Elastic Observability

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.

Docker compose

Elasticsearch exporter (default)

  1. Start a free trial on Elastic Cloud and copy the Elasticsearch endpoint and the API Key from the Help -> Connection details drop down instructions in your Kibana. These variables will be used by the elasticsearch exporter to authenticate and transmit data to your Elasticsearch instance.
  2. Open the file src/otel-collector/otelcol-elastic-config.yaml in an editor and replace all occurrences the following two placeholders:
    • YOUR_ELASTICSEARCH_ENDPOINT: your Elasticsearch endpoint (with https:// prefix example: https://1234567.us-west2.gcp.elastic-cloud.com:443).
    • YOUR_ELASTICSEARCH_API_KEY: your Elasticsearch API Key
  3. Start the demo with the following command from the repository's root directory:
    make start
    

Managed Ingest Endpoint

  1. Sign up for a free trial on Elastic Cloud and start an Elastic Cloud Serverless Observability type project. Select Application and then OpenTelemetry.
  2. Copy the OTEL_EXPORTER_OTLP_ENDPOINT URL and replace .apm with .ingest.
  3. Click "Create an API Key" to create one.
  4. Open the file src/otel-collector/otelcol-elastic-otlp-config.yaml in an editor and replace all occurrences the following two placeholders:
    • YOUR_OTEL_EXPORTER_OTLP_ENDPOINT: your OTEL_EXPORTER_OTLP_ENDPOINT_URL.
    • YOUR_OTEL_EXPORTER_OTLP_TOKEN: your Elastic OTLP endpoint token. This is what comes after ApiKey=.
  5. Open .env.override and add src/otel-collector/otelcol-elastic-otlp-config.yaml as OTEL_COLLECTOR_CONFIG
  6. Start the demo with the following command from the repository's root directory:
    make start
    

Kubernetes

Prerequisites:

  • 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.

Installation

  • 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 -f kubernetes/elastic-helm/demo.yaml
    

Kubernetes architecture diagram

Deployment architecture

Explore and analyze the data With Elastic

Service map

Service map

Traces

Traces

Correlation

Correlation

Logs

Logs

Testing with a custom component

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:

  1. Follow the instructions in the elastic-collector-componenets repo in order to build a Docker image that contains your custom component
  2. Edit the deployment.yaml file:
    • change the opentelemetry-collector image definitions to point at your custom image repository and tag
    • add your component configuration to the proper sub-section of the config section. For example, if you are testing a processor, make sure to add its config to the processors sub-section.
    • add your component to the proper sub-section of the service section. For example, if you are testing a logs processor, make sure to add its config to the processors sub-section of the logs pipeline.
  3. If you wish to enable Kubernetes node level metrics collection, edit the daemonset.yaml file:
    • change the image section to point at your custom image repository and tag
    • add your component configuration to the proper sub-section of the config section. For example, if you are testing a processor, make sure to add its config to the processors sub-section.
    • add your component to the proper sub-section of the service section. For example, if you are testing a logs processor, make sure to add its config to the processors sub-section of the logs pipeline.
  4. 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
    

About

OpenTelemetry Community Demo Application

Resources

License

Security policy

Stars

Watchers

Forks

Packages

 
 
 

Languages

  • TypeScript 53.5%
  • Python 10.6%
  • Go 8.0%
  • C# 4.3%
  • Dockerfile 4.0%
  • Java 3.8%
  • Other 15.8%