Servlet
OpenTelemetry Java agent instrumentation
This instrumentation enables HTTP server spans and metrics for Java Servlet API.
- Name:
servlet-2.2 - Scope:
io.opentelemetry.servlet-2.2 - Target versions:
javax.servlet:servlet-api:[2.2, 3.0) - Library: https://javaee.github.io/servlet-spec/
Telemetry
- Metrics:
http.server.request.duration - Span attributes:
code.function,code.namespace,client.address,error.type,http.request.method,http.request.method_original,http.response.status_code,network.peer.address,network.protocol.version,server.address,server.port,url.path,url.query,url.scheme,user_agent.original
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. |