It extends and relies on the OpenTelemetry Spring Boot Auto Configuration
Replace DIGMA_INSTRUMENTATION_VERSION
with the latest stable release.
- Minimum version:
0.0.8
For Gradle add to your dependencies:
//digma opentelemetry common auto-configuration
implementation("com.digma:digma-otel-instr-common:DIGMA_INSTRUMENTATION_VERSION")
//digma opentelemetry spring boot auto-configuration
implementation("com.digma:digma-otel-instr-spring-boot:DIGMA_INSTRUMENTATION_VERSION")
This feature relies on
the existing auto configuration for Spring WebMVC controllers
This feature autoconfigures extra instrumentation for Spring WebMVC controllers by using spring-aop to wrap methods
annotated with @GetMapping
, @PostMapping
on controllers classes (annotated with @Controller
).
It will add the following attributes to existing span:
code.function
code.namespace
Auto-configuration is natively supported by Springboot applications. To enable these features in "vanilla"
use @EnableDigmaForSpringBoot
to complete a component scan of this package.
import io.opentelemetry.instrumentation.spring.autoconfigure.EnableOpenTelemetry;
import org.springframework.context.annotation.Configuration;
@Configuration
@EnableDigmaForSpringBoot
public class OpenTelemetryConfig {
}
Feature | Property | Default Value | Comments |
---|---|---|---|
Resource | digma.otel.springboot.resource.enabled | true |
|
digma.otel.springboot.resource.environment | `` | digma environment, value for example: PRODCTION, CI, QA. it overrides the value of expected environment variable named DEPLOYMENT_ENV. leave it empty if its the developer environment (by default it will take the hostname) |