OpenTelemetry in Java
Entry point for OpenTelemetry mechanics in Java services. Load a reference below based on
the task; each reference is self-contained.
References
| File |
Use when |
references/declarative-setup.md |
Configuring the SDK via declarative YAML: Javaagent activation, Spring Boot Starter, autoconfigure SDK, BOM, agent-only properties, manual instrumentation entry points. |
references/sensitive-data-capture.md |
What HTTP instrumentation captures by default (query strings ON, headers/params OFF), query-parameter redaction (sensitive-query-parameters), header/servlet-parameter capture knobs, SQL sanitization. |
Sources of Truth
For YAML schema details, fetch the upstream sources listed in the otel-declarative-config skill.
For Java-specific facts:
| Fact |
Fetch |
Latest BOM (opentelemetry-bom) |
gh api repos/open-telemetry/opentelemetry-java/releases/latest -q '.tag_name' |
| Latest Javaagent |
gh api repos/open-telemetry/opentelemetry-java-instrumentation/releases/latest -q '.tag_name' |
SDK declarative-config accepted and preferred file_format for a selected BOM tag |
WebFetch https://raw.githubusercontent.com/open-telemetry/opentelemetry-java/<selected-sdk-tag>/sdk-extensions/declarative-config/src/main/java/io/opentelemetry/sdk/autoconfigure/declarativeconfig/OpenTelemetryConfigurationFactory.java |
Javaagent declarative-config docs (current activation flag, supported file_format) |
WebFetch https://opentelemetry.io/docs/zero-code/java/agent/declarative-configuration/ |
| Javaagent declarative-config smoke fixture (parser truth for selected agent tag) |
WebFetch https://raw.githubusercontent.com/open-telemetry/opentelemetry-java-instrumentation/<selected-agent-tag>/smoke-tests/src/test/resources/declarative-config.yaml |
| Javaagent CHANGELOG (when each schema rc landed) |
WebFetch https://raw.githubusercontent.com/open-telemetry/opentelemetry-java-instrumentation/<selected-agent-tag>/CHANGELOG.md |
| Generated Java instrumentation config reference (names, types, defaults, deprecations) |
WebFetch https://raw.githubusercontent.com/open-telemetry/opentelemetry-java-instrumentation/<selected-agent-tag>/docs/declarative-configuration-example.yaml |
| Spring Boot Starter declarative-config fixture (selected starter tag) |
WebFetch https://raw.githubusercontent.com/open-telemetry/opentelemetry-java-instrumentation/<selected-agent-tag>/smoke-tests-otel-starter/spring-boot-2/src/testDeclarativeConfig/resources/application.yaml |
| Spring Boot starter docs |
WebFetch https://opentelemetry.io/docs/zero-code/java/spring-boot-starter/ |
| Per-instrumentation telemetry & config (resolved spans/attributes, metrics, config options, target versions) |
WebFetch https://explorer.opentelemetry.io/data/javaagent/instrumentations/<id>/<id>-<hash>.json — get <id> and the latest <hash> from the index (see below) |
What telemetry does an instrumentation emit?
For "what does the agent produce for library X" — which spans, attributes, metrics, or config
knobs — use the OpenTelemetry Ecosystem Explorer, which fully
maps the Java agent and exposes an agent-friendly surface (Markdown indexes and resolved JSON, no
scraping). Do not answer from model memory.
Navigation:
WebFetch https://explorer.opentelemetry.io/agent/javaagent/index.md — table mapping display
name → id → the instrumentation's JSON data URL (the URL embeds the content <hash>).
WebFetch that JSON URL — one self-contained record (a few KB): resolved configurations,
telemetry (spans with span_kind + typed attributes, and metrics),
javaagent_target_versions, semantic_conventions, and scope.
Version-specific or "what changed between releases":
https://explorer.opentelemetry.io/agent/javaagent/versions.md lists versions and marks the latest;
https://explorer.opentelemetry.io/data/javaagent/versions/<version>-index.json gives the
id→hash map for a version — a differing hash for the same id across two versions means that
instrumentation changed. Schema:
https://explorer.opentelemetry.io/schemas/javaagent-instrumentation.schema.json; use
/llms.txt for the agent-oriented index and /llms-full.txt for the full documentation.
Prefer this Explorer data over the raw ecosystem-registry YAML on GitHub: the Explorer applies
upstream metadata corrections that the raw registry does not.
Cross-References
- Schema-level facts:
otel-declarative-config skill (language-agnostic YAML schema sources).
- SDK version selection across languages:
otel-sdk-versions skill.
- Semantic conventions lookup:
otel-semantic-conventions skill.
1---2name: otel-java3description: OpenTelemetry in Java — Javaagent zero-code instrumentation, Spring Boot Starter, manual autoconfigure SDK, declarative YAML configuration, BOM dependency management, sensitive-data capture and redaction (url.query, headers, request parameters, SQL sanitization). Use when adding, reviewing, or configuring OpenTelemetry in a Java service. Triggers on "setup otel in java", "java telemetry", "javaagent", "Spring Boot otel", "GlobalOpenTelemetry", "AutoConfiguredOpenTelemetrySdk", "TracerProvider java", "url.query redaction", "capture request headers", or any Java-related OTel question.4---5
6# OpenTelemetry in Java
7
8Entry point for OpenTelemetry mechanics in Java services. Load a reference below based on
9the task; each reference is self-contained.
10
11## References
12
13| File | Use when |
14|---|---|
15| [`references/declarative-setup.md`](references/declarative-setup.md) | Configuring the SDK via declarative YAML: Javaagent activation, Spring Boot Starter, autoconfigure SDK, BOM, agent-only properties, manual instrumentation entry points. |
16| [`references/sensitive-data-capture.md`](references/sensitive-data-capture.md) | What HTTP instrumentation captures by default (query strings ON, headers/params OFF), query-parameter redaction (`sensitive-query-parameters`), header/servlet-parameter capture knobs, SQL sanitization. |
17
18## Sources of Truth
19
20For YAML schema details, fetch the upstream sources listed in the `otel-declarative-config` skill.
21For Java-specific facts:
22
23| Fact | Fetch |
24|---|---|
25| Latest BOM (`opentelemetry-bom`) | `gh api repos/open-telemetry/opentelemetry-java/releases/latest -q '.tag_name'` |
26| Latest Javaagent | `gh api repos/open-telemetry/opentelemetry-java-instrumentation/releases/latest -q '.tag_name'` |
27| SDK declarative-config accepted and preferred `file_format` for a selected BOM tag | `WebFetch https://raw.githubusercontent.com/open-telemetry/opentelemetry-java/<selected-sdk-tag>/sdk-extensions/declarative-config/src/main/java/io/opentelemetry/sdk/autoconfigure/declarativeconfig/OpenTelemetryConfigurationFactory.java` |
28| Javaagent declarative-config docs (current activation flag, supported `file_format`) | `WebFetch https://opentelemetry.io/docs/zero-code/java/agent/declarative-configuration/` |
29| Javaagent declarative-config smoke fixture (parser truth for selected agent tag) | `WebFetch https://raw.githubusercontent.com/open-telemetry/opentelemetry-java-instrumentation/<selected-agent-tag>/smoke-tests/src/test/resources/declarative-config.yaml` |
30| Javaagent CHANGELOG (when each schema rc landed) | `WebFetch https://raw.githubusercontent.com/open-telemetry/opentelemetry-java-instrumentation/<selected-agent-tag>/CHANGELOG.md` |
31| Generated Java instrumentation config reference (names, types, defaults, deprecations) | `WebFetch https://raw.githubusercontent.com/open-telemetry/opentelemetry-java-instrumentation/<selected-agent-tag>/docs/declarative-configuration-example.yaml` |
32| Spring Boot Starter declarative-config fixture (selected starter tag) | `WebFetch https://raw.githubusercontent.com/open-telemetry/opentelemetry-java-instrumentation/<selected-agent-tag>/smoke-tests-otel-starter/spring-boot-2/src/testDeclarativeConfig/resources/application.yaml` |
33| Spring Boot starter docs | `WebFetch https://opentelemetry.io/docs/zero-code/java/spring-boot-starter/` |
34| Per-instrumentation telemetry & config (resolved spans/attributes, metrics, config options, target versions) | `WebFetch https://explorer.opentelemetry.io/data/javaagent/instrumentations/<id>/<id>-<hash>.json` — get `<id>` and the latest `<hash>` from the index (see [below](#what-telemetry-does-an-instrumentation-emit)) |
35
36## What telemetry does an instrumentation emit?
37
38For *"what does the agent produce for library X"* — which spans, attributes, metrics, or config
39knobs — use the [OpenTelemetry Ecosystem Explorer](https://explorer.opentelemetry.io/), which fully
40maps the Java agent and exposes an agent-friendly surface (Markdown indexes and resolved JSON, no
41scraping). Do **not** answer from model memory.
42
43Navigation:
44
451. `WebFetch https://explorer.opentelemetry.io/agent/javaagent/index.md` — table mapping display
46 name → `id` → the instrumentation's JSON data URL (the URL embeds the content `<hash>`).
472. `WebFetch` that JSON URL — one self-contained record (a few KB): resolved `configurations`,
48 `telemetry` (spans with `span_kind` + typed attributes, and `metrics`),
49 `javaagent_target_versions`, `semantic_conventions`, and `scope`.
50
51Version-specific or *"what changed between releases"*:
52`https://explorer.opentelemetry.io/agent/javaagent/versions.md` lists versions and marks the latest;
53`https://explorer.opentelemetry.io/data/javaagent/versions/<version>-index.json` gives the
54`id`→`hash` map for a version — a differing hash for the same `id` across two versions means that
55instrumentation changed. Schema:
56`https://explorer.opentelemetry.io/schemas/javaagent-instrumentation.schema.json`; use
57`/llms.txt` for the agent-oriented index and `/llms-full.txt` for the full documentation.
58
59Prefer this Explorer data over the raw `ecosystem-registry` YAML on GitHub: the Explorer applies
60upstream metadata corrections that the raw registry does not.
61
62## Cross-References
63
64- Schema-level facts: `otel-declarative-config` skill (language-agnostic YAML schema sources).
65- SDK version selection across languages: `otel-sdk-versions` skill.
66- Semantic conventions lookup: `otel-semantic-conventions` skill.