Digma Developer Guide
  • Welcome to the Digma Docs!
  • What is a Continuous Feedback platform?
  • Digma Quickstart
  • Installation
    • Local Install
      • Local Install Architecture
      • Installation Troubleshooting
    • Central (on-prem) Install
      • Resource Requirements
  • INSTRUMENTATION
    • Instrumenting your code for tracing
    • Java
      • Automatic Instrumentation in the IDE (IntelliJ)
      • Spring, Spring Boot, Dropwizard
        • Instrumenting your code in CI/Staging or the terminal
        • Instrumenting your application in Docker Compose
        • Instrumenting your application on Kubernetes
        • Covering more of your code with Observability
        • Using GitHub Actions (beta)
        • Using Micrometer Tracing (Spring Boot 3.x only)
        • Instrumenting code running in CLI
      • Quarkus, Micronaut, OpenLiberty
    • .NET
    • Correlating observability and source code commits
    • Sending Data to Digma using the OTEL Collector
    • Sending Data to Digma Using the Datadog agent
  • Use Cases
    • Design and write code more efficiently by understanding the system flows
    • Get early feedback on bottlenecks and code issues
    • Prioritize Technical Debt
  • Digma Core Concepts
    • Environments
    • Assets
    • Analytics vs. Issues
  • Digma Features
    • Issues
      • Suspected N+1
      • Excessive API calls (chatty API)
      • Bottleneck
      • Scaling Issue
      • Session In View Query Detected
      • Query Optimization Suggested
      • High number of queries
      • Slow Endpoint
    • Analytics
      • Top Usage
      • Request Breakdown
      • Duration
      • Code Nexus
      • Duration Breakdown
      • Endpoint Low/High Usage
    • Performance Impact
    • Test observability
    • Issue Criticality
  • Sample Projects
    • Spring Boot
  • Troubleshooting
    • Reporting Plugin Issues
    • Digma Overload Warning
Powered by GitBook
On this page
  • 1. Create a CI/Prod environment using the Digma UI:
  • 2. Update your build file or deployment script
  1. INSTRUMENTATION
  2. Java
  3. Spring, Spring Boot, Dropwizard

Instrumenting your code in CI/Staging or the terminal

PreviousSpring, Spring Boot, DropwizardNextInstrumenting your application in Docker Compose

Last updated 2 months ago

Connecting Digma to your CI environment requires in your org.

The most straightforward way to instrument your application is simply to download the OTEL agent and Digma Extension files and then set some environment variables and system properties so that they can instrument the Java process.

1. Create a CI/Prod environment using the Digma UI:

Start by creating an environment using the Digma Observability panel. Give the environment a meaningful name and select the CI/Prod environment type.

2. Update your build file or deployment script

You can use the below or similar logic to download the OTEL agent and set the environment variables to instrument the application.

digma_url=[DIGMA_COLLECTOR_URL]

curl --create-dirs -O -L --output-dir /tmp/otel https://github.com/open-telemetry/opentelemetry-java-instrumentation/releases/download/v2.10.0/opentelemetry-javaagent.jar 

curl --create-dirs -O -L --output-dir /tmp/otel https://github.com/digma-ai/otel-java-instrumentation/releases/latest/download/digma-otel-agent-extension.jar 

curl --create-dirs -O -L --output-dir /tmp/otel https://github.com/digma-ai/digma-agent/releases/latest/download/digma-agent.jar

export JAVA_TOOL_OPTIONS="-javaagent:/tmp/otel/digma-agent.jar \
-javaagent:/tmp/otel/opentelemetry-javaagent.jar \
-Dotel.javaagent.extensions=/tmp/otel/digma-otel-agent-extension.jar \
-Dotel.exporter.otlp.traces.endpoint=$digma_url \
-Dotel.traces.exporter=otlp -Dotel.exporter.otlp.protocol=grpc \
-Dotel.metrics.exporter=none -Dotel.logs.exporter=none \
-Dotel.instrumentation.common.experimental.controller.telemetry.enabled=true \
-Dotel.instrumentation.common.experimental.view.telemetry.enabled=true \
-Dotel.instrumentation.experimental.span-suppression-strategy=none \
-Dotel.instrumentation.jdbc-datasource.enabled=true"

export OTEL_SERVICE_NAME=[SERVICE_NAME]
export OTEL_RESOURCE_ATTRIBUTES=digma.environment=[ENV_NAME],digma.environment.type=Public

java app.jar

Substitute the following values:

  • Replace [DIGMA_COLLECTOR_URL] with your Digma Collector-API address. If you're running Digma locally, this would be http://localhost:5050 by default

  • Make sure to substitute [SERVICE_NAME] with your application name:

  • If you would like to use HTTP rather than GRPC as the collector protocol, simply change the following argument above:-Dotel.exporter.otlp.protocol=http

Substitute the [ENVIRONMENT_NAME] value based on the environment identifier in Digma. To retrieve the environment identifier see the instructions on the .

environment page
deploying Digma centrally