# JAX-RS 2.x

<!-- llms-txt-link: /llms.txt -->

> OpenTelemetry Java agent instrumentation

This instrumentation enriches HTTP server spans with route information, and enables controller spans for JAX-RS annotated methods (controller spans are disabled by default).

- **Name**: `jaxrs-2.0-annotations`
- **Scope**: `io.opentelemetry.jaxrs-2.0-annotations`
- **Target versions**: `javax.ws.rs:javax.ws.rs-api:[,]`
- **Library**: https://javaee.github.io/javaee-spec/javadocs/javax/ws/rs/package-summary.html

## Telemetry

- **Span attributes**: `code.function`, `code.namespace`

## Configuration

| Option | Type | Default | Description |
| --- | --- | --- | --- |
| `otel.instrumentation.common.experimental.controller-telemetry.enabled` | boolean | false | Enables the creation of experimental controller spans. |
| `otel.instrumentation.jaxrs.experimental-span-attributes` | boolean | false | Enables the experimental `jaxrs.canceled` span attribute. |

## Data

- **JSON**: [/data/javaagent/instrumentations/jaxrs-2.0-annotations/jaxrs-2.0-annotations-d990df533f39.json](/data/javaagent/instrumentations/jaxrs-2.0-annotations/jaxrs-2.0-annotations-d990df533f39.json)
- **Explore**: [/java-agent/instrumentation/jaxrs-2.0-annotations](/java-agent/instrumentation/jaxrs-2.0-annotations)
