This is just a neat trick that allows you to collect observability data from your application running via Docker Compose without changing the original docker-compose.yml file. We accomplish this by using an override file that will add the OTEL agent and set the appropriate environment variables which we can use in dev/test.
Prerequisite: Create an environment in Digma
Follow these instructions to create a private or CI/prod environment depending on your use case and required visibility for the new environment.
# Create the directory if it doesn't existNew-Item-ItemType Directory -Force -Path .\otel# Download the first fileInvoke-WebRequest -Uri "https://github.com/open-telemetry/opentelemetry-java-instrumentation/releases/download/v2.1.0/opentelemetry-javaagent.jar" -OutFile .\otel\opentelemetry-javaagent.jar
# Download the second fileInvoke-WebRequest -Uri "https://github.com/digma-ai/otel-java-instrumentation/releases/latest/download/digma-otel-agent-extension.jar" -OutFile .\otel\digma-otel-agent-extension.jar
# Download the third fileInvoke-WebRequest -Uri "https://github.com/digma-ai/digma-agent/releases/latest/download/digma-agent.jar" -OutFile .\otel\digma-agent.jar
2. Add a Docker Compose override file
Create a supplementary Docker Compose file that will include the agent files and provide the environment variables to export tracing data to Digma.