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
  • Sending tracing data to Digma
  • Adding Digma Attributes
  1. INSTRUMENTATION

Instrumenting your code for tracing

PreviousResource RequirementsNextJava

Last updated 1 month ago

Digma's main input is your code's OpenTelemetry traces. Depending on your application programming language and frameworks/libraries, you may want to select a different strategy for collecting this data or 'instrumenting' your app code.

If you're not using OpenTelemetry yet, the is a great place to start. In many cases, you won't need to make any modifications to your code to get this data.

Digma also provides additional helpers, guides, and tools to streamline this process. Check out our documentation as an example.

Sending tracing data to Digma

If you're already using an OpenTelemetry Collector, follow the instructions here:Sending Data to Digma using the OTEL Collector. If you're not yet using a collector and want an easier setup you can just use the following environment variable to control the OTLP tracing export and disable logging and metrics export to Digma as they are not supported:

export OTEL_METRICS_EXPORTER=none
export OTEL_LOGS_EXPORTER=none
export OTEL_EXPORTER_OTLP_TRACES_ENDPOINT=$DIGMA_COLLECTOR_URL

Adding Digma Attributes

Digma relies on specific OTEL resource attributes to classify the observability data based on the service, the , etc. The way to add these attributes might differ depending on how OTEL is activated. A standard convention is to use the following environment variables:

export OTEL_SERVICE_NAME=$YOUR_APP_SERVICE_NAME

You also need to tag the observability data based on the Digma Environments. This is done automatically when your code is instrumented by the Digma IDE plugin for relevant languages.

export OTEL_RESOURCE_ATTRIBUTES=digma.environment={ENV_NAME},digma.environment.type={Public|Private}

OTEL getting started page
environment