Skip to main content
skill CX Codex

otel-java — Claude Code skill: what it does, how to install

Configures OpenTelemetry in Java services with zero-code Javaagent setup, Spring Boot Starter support, and sensitive parameter redaction.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add ollygarden/opentelemetry-agent-skills --skill otel-java -a claude-code
Open on GitHub

What otel-java does

This skill guides agents through setting up OpenTelemetry across Java projects. It covers zero-code instrumentation via Javaagent, Spring Boot Starter integration, manual setup with AutoConfiguredOpenTelemetrySdk, and dependency alignment using the OpenTelemetry BOM.

The skill includes specific references for declarative YAML setups and privacy guardrails. By default, HTTP instrumentation collects query strings while ignoring headers and servlet parameters. The instructions show how to mask url.query values, sanitize SQL queries, and toggle header capture safely.

To prevent fabricated metric or span names, the skill bars the model from relying on internal memory. Instead, it instructs the agent to retrieve exact records via WebFetch from the OpenTelemetry Ecosystem Explorer at explorer.opentelemetry.io. Inspecting upstream release tags also requires the GitHub CLI (gh).

What it helps with

  • enable zero-code Javaagent tracing across backend microservices
  • configure Spring Boot Starter using declarative YAML settings
  • redact sensitive query parameters and sanitise SQL statements
  • look up emitted spans and metrics using the OpenTelemetry Ecosystem Explorer

Example prompts for the agent

  • Set up zero-code OpenTelemetry Javaagent instrumentation for this Spring Boot app.
  • Configure sensitive query parameter redaction for HTTP request telemetry.
  • Find what spans and metrics the Java agent emits for our database client.

How to install otel-java

1Skills CLI (Vercel)

npx skills add ollygarden/opentelemetry-agent-skills --skill otel-java -a claude-code

2Manually: put the files in place

~/.claude/skills/otel-java/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/otel-java/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about otel-java

How do I install otel-java in Claude Code?

Run npx skills add ollygarden/opentelemetry-agent-skills --skill otel-java -a claude-code in your terminal. This saves the skill file to ~/.claude/skills/otel-java/SKILL.md.

What does the otel-java skill cover?

It assists with Java telemetry configuration. That includes Javaagent activation, declarative YAML options, Spring Boot Starter setup, and sanitizing private query parameters.

How does otel-java look up instrumentation details?

The skill instructs the agent to fetch JSON records from the OpenTelemetry Ecosystem Explorer at explorer.opentelemetry.io. This avoids hallucinations when listing spans, metrics, or attributes.

Source text

SKILL.md · Apache-2.0
---
name: otel-java
description: 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.
---

# 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`](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`](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)) |

## 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](https://explorer.opentelemetry.io/), 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:

1. `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>`).
2. `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.

© ollygarden · Apache-2.0 · ollygarden/opentelemetry-agent-skills

Similar skills

All skills for Backend and APIs →

From the same set20

otel-python A skill that helps your agent set up and debug OpenTelemetry in Python services: SDK config, declarative YAML, zero-code instrumentation. CX Codex +1 ★ 116repo stars otel-profiles Sets up OpenTelemetry continuous profiling with eBPF across Linux hosts, containers, and Kubernetes clusters, wiring pipelines to backends like Pyroscope. CX Codex +1 ★ 116repo stars otel-ottl A skill for authoring and debugging OpenTelemetry Transformation Language (OTTL) expressions to transform and filter telemetry in the Collector. Use it when configuring transform, filter, tail_sampling processors or routing connectors. CX Codex +1 ★ 116repo stars otel-js Walks your agent through OpenTelemetry setup in a Node.js, JavaScript or TypeScript service. Handy when you are adding tracing or wiring up NodeSDK. CX Codex +1 ★ 116repo stars otel-go Get task-specific guidance for OpenTelemetry in Go, from SDK configuration to instrumentation and upgrades. Useful when adding telemetry or reviewing an existing service. CX Codex +1 ★ 116repo stars otel-dotnet A skill for OpenTelemetry in .NET and ASP.NET Core: SDK setup through DI, instrumentation, the zero-code agent, and breaking-change audits. CX Codex +1 ★ 116repo stars otel-declarative-config Generates OpenTelemetry declarative YAML files for SDK providers and OTLP exporters. It checks parser versions so your config matches the schema. CX Codex +1 ★ 116repo stars otel-collector Get help writing, reviewing, and debugging OpenTelemetry Collector component YAML. Useful when you need details about a particular receiver, processor, or exporter. CX Codex +1 ★ 116repo stars

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor