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.
- Start a free trial on Elastic Cloud and copy the
Elasticsearch endpoint
and theAPI Key
from theHelp -> 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. - 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 (withhttps://
prefix example:https://1234567.us-west2.gcp.elastic-cloud.com:443
).YOUR_ELASTICSEARCH_API_KEY
: your Elasticsearch API Key
- Start the demo with the following command from the repository's root directory:
make start
- Sign up for a free trial on Elastic Cloud and start an Elastic Cloud Serverless Observability type project. Select Application and then OpenTelemetry.
- Copy the OTEL_EXPORTER_OTLP_ENDPOINT URL and replace
.apm
with.ingest
. - Click "Create an API Key" to create one.
- 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 afterApiKey=
.
- Open
.env.override
and addsrc/otel-collector/otelcol-elastic-otlp-config.yaml
asOTEL_COLLECTOR_CONFIG
- 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.
- 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
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-componenets repo in order to build a Docker image that contains your custom component
- 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 theprocessors
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 theprocessors
sub-section of thelogs
pipeline.
- change the
- 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 theprocessors
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 theprocessors
sub-section of thelogs
pipeline.
- 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