Skip to content

vmaleze/opentelemetry-java-ignore-spans

Repository files navigation

OpenTelemetry spans drop extension

This project embeds a simple extension in the opentelemetry javaagent that will drop spans based on the env variable OTEL_DROP_SPANS.

Usage

Add the OTEL_DROP_SPANS env variable and set the spans to drop using the , as a separator

Simply download the latest version instead of the javaagent, and you are good to go.

apiVersion: opentelemetry.io/v1alpha1
kind: Instrumentation
metadata:
  name: my-instrumentation
spec:
  java:
    env:
      # Will drop spans towards health and metrics endpoints
      - name: OTEL_DROP_SPANS
        value: .*/health,.*/metrics
    image: ghcr.io/vmaleze/opentelemetry-java-ignore-spans:2.10.0

Current versions

References :