Servlet
OpenTelemetry Java agent instrumentation
This instrumentation enables HTTP server spans and metrics for Jakarta Servlet API.
- Name:
servlet-5.0 - Scope:
io.opentelemetry.servlet-5.0 - Target versions:
jakarta.servlet:jakarta.servlet-api:[5.0.0,) - Library: https://jakarta.ee/specifications/servlet/
Telemetry
- Metrics:
http.server.request.duration - Span attributes:
client.address,error.type,http.request.method,http.request.method_original,http.response.status_code,http.route,network.peer.address,network.peer.port,network.protocol.version,server.address,server.port,url.path,url.query,url.scheme,user_agent.original,code.function,code.namespace
Configuration
| Option | Type | Default | Description |
|---|---|---|---|
otel.experimental.javascript-snippet | string | Experimental setting to inject a JavaScript snippet into HTML responses after the opening <head> tag. | |
otel.instrumentation.servlet.experimental-span-attributes | boolean | false | Enables capturing the experimental servlet.timeout span attribute. |
otel.instrumentation.servlet.experimental.capture-request-parameters | list | List of request parameter names to capture as span attributes. | |
otel.instrumentation.servlet.experimental.trace-id-request-attribute.enabled | boolean | true | Enables adding the trace ID and span ID as request attributes for downstream servlet access. |