Back to guidesGuide

Use OpenTelemetry Java agent extensions without hiding incident traces

Filter noise, normalize routes, and tune sampling in the Java agent without changing the application or breaking incident investigations.

A practical guide to rolling out OpenTelemetry Java agent extensions with guardrails: baseline, a minimal extension, canary checks, Collector metrics, and proof that errors remain visible.

Created: August 22, 2026

Published: August 22, 2026

Estimated time45 min
LevelAdvanced
Before you startA Java application already instrumented with the OpenTelemetry Java agent
PlatformsLinux / Docker
WhatsAppXLinkedIn

Docker

Mount the extension JAR next to the Java agent and use OTEL_* variables to enable the canary without rebuilding the application image.

Docker or KubernetesJava image with the agent availableVolume or initContainer for the extension JAR
Minimum canary variables
OTEL_JAVAAGENT_EXTENSIONS=/otel/extensions/incident-trace-guardrails.jar
OTEL_SERVICE_NAME=checkout-api
OTEL_TRACES_SAMPLER=parentbased_traceidratio
OTEL_TRACES_SAMPLER_ARG=0.20
Validate error traces
curl -sS http://checkout-api-canary/error-demo || true

Content locked

This guide requires both steps before full content is available.

  • Click “Like” on this guide.
  • Share on WhatsApp, X, LinkedIn, or copy the link.

Access is automatically unlocked as soon as both steps are completed.