otel-java

otel-java is a skill for Claude Code from ollygarden/opentelemetry-agent-skills. It costs 127 tokens per session (1,271 once invoked), scanned A, original, Apache-2.0.

A reference guide for adding OpenTelemetry to Java applications. OpenTelemetry collects traces, metrics, and logs to show how software behaves, including requests and database calls.

In plain words
What is it for?
Use it to configure the Java agent, Spring Boot, or the SDK; manage dependencies; add instrumentation; and control captured or redacted data.
Why use it?
It explains several Java setup options and how to prevent sensitive data, such as query strings, headers, request parameters, and SQL details, from being exposed.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the opentelemetry-agent-skills plugin — 19 skills shipped together

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/ollygarden/opentelemetry-agent-skills/otel-java
Any agent
npx skills add ollygarden/opentelemetry-agent-skills --skill otel-java
Clone the repo
git clone --depth 1 https://github.com/ollygarden/opentelemetry-agent-skills

Made for: Claude Code.

Or install opentelemetry-agent-skills, the plugin that ships this one along with the rest of its 19 skills.

Its marketplace also offers this one on its own, as the plugin otel-java/plugin install otel-java after adding the marketplace above.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for otel-java

README.md
[![agentmods](https://agentmods.dev/badge/skills/ollygarden/opentelemetry-agent-skills/otel-java.svg)](https://agentmods.dev/skills/ollygarden/opentelemetry-agent-skills/otel-java)
Your own site
<a href="https://agentmods.dev/skills/ollygarden/opentelemetry-agent-skills/otel-java"><img src="https://agentmods.dev/badge/skills/ollygarden/opentelemetry-agent-skills/otel-java.svg" alt="Measured on agentmods" height="20"></a>
Per session 127 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,271 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00127 $0.01271
Opus 5 $0.00063 $0.00635
Sonnet 5 $0.00025 $0.00254
Haiku 4.5 $0.00013 $0.00127

Measured 6d ago against content hash b08a76593164, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

otel-java scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 6d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/otel-java/SKILL.md · 67 lines

How it starts

The opening of the file, as written. The whole thing — 67 lines — stays where its author put it; the contents beside it link to each section on GitHub.

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)

Read the full file on GitHub · 67 lines

Files

What ships with it

2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 6d ago First seen · 67 lines · 127 tokens per session scan A b08a76593164

Subscribe to this mod's changes

otel-java is a skill published in the GitHub repository ollygarden/opentelemetry-agent-skills (97 stars, last pushed 2d ago), licensed Apache-2.0. It adds 127 tokens to every session and 1,271 once invoked, about $0.0006 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.