Official agent skill

Opentelemetry

by grafana in grafana/skills

Instrument any app with OpenTelemetry and ship metrics / logs / traces to Grafana Cloud or self-hosted Mimir / Loki / Tempo / Pyroscope.

OfficialApache-2.0Auto-check passedDevOps & Cloud

Install Opentelemetry

skills CLI
$ npx skills add grafana/skills --skill opentelemetry -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install grafana/skills opentelemetry --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/grafana/skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/grafana-core/opentelemetry .claude/skills/opentelemetry && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
opentelemetry
GitHub stars
281
Token cost
~1.7k tokens
SKILL.md length
259 words
Files
3 (incl. references)
Skills in repo
51
Repo updated
First seen
Licence
Apache-2.0

At a glance

Instrument any app with OpenTelemetry and ship metrics / logs / traces to Grafana Cloud or self-hosted Mimir / Loki / Tempo / Pyroscope.

  • Works in 5 steps: Authenticate to the Grafana Cloud OTLP… → Auto-instrument a Java app + verify → Auto-instrument a Python app → …
  • Instrumenting a service
  • SKILL.md covers Backends, Prerequisites, Common Workflows and Sampling — when to pick which, plus 3 more sections
  • Calls curl, java and pip; reaches otlp-gateway-prod-us-east-0.grafana.net and github.com; needs API_KEY and GRAFANA_CLOUD_API_KEY

What it does

Opentelemetry is an agent skill from grafana/skills, published by the product's own GitHub organization. Instrument any app with OpenTelemetry and ship metrics / logs / traces to Grafana Cloud or self-hosted Mimir / Loki / Tempo / Pyroscope. Covers SDK auto-instrumentation for Go, Java (Grafana JVM agent), Python (opentelemetry-instrument), Node.js, .NET (Grafana.OpenTelemetry), Beyla eBPF for zero-code; Grafana Cloud OTLP gateway + Basic-auth (instanceID + API key, base64); env-var config (OTELEXPORTEROTLP, OTELRESOURCEATTRIBUTES); Alloy / OTel-Collector pipelines; Kubernetes Operator inject-annotations; and head +…

Its SKILL.md is about 1.7k tokens, which your agent loads only when the skill is triggered. The skill folder holds 3 other files, including reference files (for example `references/collector-config.md` and `references/instrumentation.md`).

It sits in DevOps & Cloud, covering Observability, Monitoring and alerting and Container orchestration. It works with OpenTelemetry, Grafana, Java and Kubernetes. The licence is Apache-2.0.

When your agent uses it

  • Instrumenting a service
  • Pointing OTLP at Grafana Cloud
  • Switching from Jaeger / Datadog / New Relic
  • Choosing head- vs tail-sampling

Example prompts

  • “spans aren”
  • “— even when the user says”
  • “send traces to Grafana”
  • “/opentelemetry”

Requirements

  • Python 3
  • Node.js
  • Docker
  • A credential in API_KEY
  • A credential in GRAFANA_CLOUD_API_KEY

Workflow steps

5 steps, taken from the step headings in SKILL.md.

  1. Authenticate to the Grafana Cloud OTLP endpoint
  2. Auto-instrument a Java app + verify
  3. Auto-instrument a Python app
  4. Add Alloy as a buffering / sampling collector
  5. Kubernetes — auto-inject via the Operator

What it can do on your machine

Read from SKILL.md and the folder at commit 1ccacf2. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • curl
    • java
    • pip
    • kubectl

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Hosts in commands or code, which the agent is likely to contact:

    • otlp-gateway-prod-us-east-0.grafana.net
    • github.com

    Also links to:

    • grafana.com
    • opentelemetry.io

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names these keys or tokens, usually read from environment variables:

    • API_KEY
    • GRAFANA_CLOUD_API_KEY

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Opentelemetry loads about 1.7k tokens when it runs, and up to ~12k if it reads all its reference files. Until then it costs about 232 tokens; SKILL.md has 259 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~232
When it runs · the whole SKILL.md, loaded when a task matches
~1.7k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~12k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from grafana/skills at commit 1ccacf2, republished under its Apache-2.0 licence (© grafana). 259 words, ~1,720 tokens.

Download SKILL.mdSave it as .claude/skills/opentelemetry/SKILL.md (or your agent's skills folder). This skill also uses 2 other files; get the full folder from GitHub.
name
opentelemetry
description
Instrument any app with OpenTelemetry and ship metrics / logs / traces to Grafana Cloud or self-hosted Mimir / Loki / Tempo / Pyroscope. Covers SDK auto-instrumentation for Go, Java (Grafana JVM agent), Python (`opentelemetry-instrument`), Node.js, .NET (`Grafana.OpenTelemetry`), Beyla eBPF for zero-code; Grafana Cloud OTLP gateway + Basic-auth (instanceID + API key, base64); env-var config (`OTEL_EXPORTER_OTLP_*`, `OTEL_RESOURCE_ATTRIBUTES`); Alloy / OTel-Collector pipelines; Kubernetes Operator inject-annotations; and head + tail sampling. Use when instrumenting a service, pointing OTLP at Grafana Cloud, switching from Jaeger / Datadog / New Relic, choosing head- vs tail-sampling, or debugging "spans aren't showing in Explore" — even when the user says "auto-instrument my Java app", "send traces to Grafana", "what env vars do I set", "OTLP endpoint", or "Operator inject" without naming OpenTelemetry.
license
Apache-2.0

OpenTelemetry with Grafana

Docs: https://grafana.com/docs/opentelemetry/

Vendor-neutral instrumentation pipeline. Apps speak OTLP → Alloy (or direct) → Grafana Cloud (Mimir / Loki / Tempo / Pyroscope).

Backends

SignalBackend
MetricsGrafana Mimir
LogsGrafana Loki
TracesGrafana Tempo
ProfilesGrafana Pyroscope

Prerequisites

  • Grafana Cloud stack OR self-hosted Mimir / Loki / Tempo
  • Cloud OTLP endpoint: https://otlp-gateway-<region>.grafana.net/otlp
  • Basic-auth credentials: numeric instance ID + API token with MetricsPublisher + LogsPublisher + TracesPublisher
  • An app to instrument

Common Workflows

1. Authenticate to the Grafana Cloud OTLP endpoint
bash
# 1. Build the auth header
INSTANCE_ID=123456
API_KEY="glc_eyJ..."
export OTEL_EXPORTER_OTLP_ENDPOINT=https://otlp-gateway-prod-us-east-0.grafana.net/otlp
export OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf
export OTEL_EXPORTER_OTLP_HEADERS="Authorization=Basic $(echo -n "${INSTANCE_ID}:${API_KEY}" | base64)"
export OTEL_RESOURCE_ATTRIBUTES="service.name=myapp,service.namespace=myteam,deployment.environment=prod"

# 2. Smoke-test creds with a curl POST against the OTLP traces endpoint (empty body)
curl -s -o /dev/null -w "%{http_code}\n" \
  -X POST -H "Content-Type: application/x-protobuf" \
  -H "Authorization: Basic $(echo -n "${INSTANCE_ID}:${API_KEY}" | base64)" \
  "$OTEL_EXPORTER_OTLP_ENDPOINT/v1/traces" --data-binary '\n'
# Expect 400 (malformed payload) — NOT 401 (auth) or 404 (wrong endpoint).
2. Auto-instrument a Java app + verify
bash
# 1. Download the Grafana JVM agent (single jar)
curl -sLO https://github.com/grafana/grafana-opentelemetry-java/releases/latest/download/grafana-opentelemetry-java.jar

# 2. Run with the agent + env from step 1
java -javaagent:./grafana-opentelemetry-java.jar -jar myapp.jar

# 3. Generate traffic, then verify in Grafana → Explore → Tempo:
#    TraceQL: { resource.service.name = "myapp" }
#    Expect spans within ~30s. Also verify metrics:
#    PromQL: count by (service_name)({service_name="myapp"})
3. Auto-instrument a Python app
bash
pip install "opentelemetry-distro[otlp]"
opentelemetry-bootstrap -a install

# Same env vars as step 1, then:
opentelemetry-instrument python app.py

# Verify the same way — Explore → Traces filter service.name=myapp.
4. Add Alloy as a buffering / sampling collector
bash
# Application points at local Alloy (gRPC fastest)
export OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4317
export OTEL_EXPORTER_OTLP_PROTOCOL=grpc

# Alloy environment for forwarding to Cloud
export GRAFANA_CLOUD_OTLP_ENDPOINT=https://otlp-gateway-prod-us-east-0.grafana.net/otlp
export GRAFANA_CLOUD_INSTANCE_ID=$INSTANCE_ID
export GRAFANA_CLOUD_API_KEY=$API_KEY
alloy run /etc/alloy/config.alloy

# Verify Alloy received and forwarded
curl -s http://localhost:12345/metrics | grep otelcol_exporter_sent_spans

Full Alloy config + tail-sampling block + OTel Collector YAML + K8s Operator install: references/collector-config.md.

SDK-by-language details (Go full code, Node manual setup, .NET ASP.NET Core, all the env-var quirks): references/instrumentation.md.

5. Kubernetes — auto-inject via the Operator
yaml
apiVersion: opentelemetry.io/v1alpha1
kind: Instrumentation
metadata: { name: my-instrumentation }
spec:
  exporter: { endpoint: http://otelcol:4317 }
  propagators: [tracecontext, baggage]
  java:
    image: us-docker.pkg.dev/grafanalabs-global/docker-grafana-opentelemetry-java-prod/grafana-opentelemetry-java:2.3.0-beta.1
  nodejs: {}
  python: {}

Then annotate pods:

yaml
metadata:
  annotations:
    instrumentation.opentelemetry.io/inject-java: "true"
    # or: inject-nodejs, inject-python, inject-dotnet
bash
# Verify the operator injected the agent
kubectl describe pod <pod> | grep -A2 'opentelemetry-auto-instrumentation'
# Then run the same Grafana Explore checks.

Sampling — when to pick which

bash
# Head sampling (cheap, decided at start; may lose rare errors)
export OTEL_TRACES_SAMPLER=parentbased_traceidratio
export OTEL_TRACES_SAMPLER_ARG=0.1   # 10%

Tail sampling (decides after seeing the whole trace — keep errors + sample the rest) requires an Alloy / OTel-Collector tail_sampling processor; full block in references/collector-config.md.

Key environment variables

VariableExample
OTEL_EXPORTER_OTLP_ENDPOINThttps://otlp-gateway-prod-us-east-0.grafana.net/otlp
OTEL_EXPORTER_OTLP_PROTOCOLgrpc or http/protobuf
OTEL_EXPORTER_OTLP_HEADERSAuthorization=Basic <base64>
OTEL_RESOURCE_ATTRIBUTESservice.name=app,service.namespace=team,deployment.environment=prod
OTEL_SERVICE_NAMEshorthand for service.name
OTEL_TRACES_SAMPLER / _ARGparentbased_traceidratio / 0.1

Troubleshooting

  • 401 from OTLP gateway → instance ID is not numeric, or API key missing publisher roles
  • 404 → endpoint URL wrong (must end with /otlp)
  • Spans missing → check OTEL_EXPORTER_OTLP_PROTOCOL matches transport (Cloud OTLP gateway = http/protobuf, Alloy local = grpc)
  • Node.js auto-instrumentation broken after bundling → bundlers like @vercel/ncc defeat the require hooks
  • Python under Gunicorn / uWSGI shows no spans → reinit OTel providers in a post-fork hook

Resources

© grafana, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 2 other files (references) in skills/grafana-core/opentelemetry of grafana/skills.

  • SKILL.md
  • references/collector-config.md
  • references/instrumentation.md

Open the folder on GitHubat commit 1ccacf2

Compare with similar skills

Opentelemetry next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Opentelemetry compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Opentelemetry this skillgrafana/skills281—~1.7kAutomated safety check: PassApache-2.0
Tsh Implementing ObservabilityTheSoftwareHouse/copilot-collections284—~2kAutomated safety check: PassMIT
Loki LoggingBagelHole/DevOps-Security-Agent-Skills1.1k—~2.4kAutomated safety check: PassMIT
OpenTelemetry Pipeline Metrics Speccomet-ml/opik22k—~3.2kAutomated safety check: PassApache-2.0
Logfire Infrastructurepydantic/skills140—~1.8kAutomated safety check: PassMIT
Signozqjoly/GitOps112—~6.1kAutomated safety check: PassWTFPL

Similar skills

  • Tsh Implementing Observability

    TheSoftwareHouse/copilot-collections

    Observability patterns for logging, monitoring, alerting, and distributed tracing.

    284 GitHub stars~2k tokensUpdated 4 days ago
    DevOps & CloudAuto-check passed
  • Loki Logging

    BagelHole/DevOps-Security-Agent-Skills

    Configure Grafana Loki for log aggregation and analysis. An agent skill from BagelHole/DevOps-Security-Agent-Skills.

    1.1k GitHub stars~2.4k tokensUpdated 4 mo ago
    DevOps & CloudAuto-check passed
  • Specifies how to instrument an opik-backend pipeline with per-stage OpenTelemetry metrics for throughput, latency, errors and queue delay by workspace.

    22k GitHub stars~3.2k tokensUpdated today
    DevOps & CloudAuto-check passed
  • Logfire Infrastructure

    pydantic/skills

    Official

    Monitor hosts, Docker containers, Kubernetes clusters, database/queue/cache servers, and cloud-provider metrics with Pydantic Logfire — no application code required.

    140 GitHub stars~1.8k tokensUpdated 8 days ago
    DevOps & CloudAuto-check passed
  • Signoz

    qjoly/GitOps

    Manage the self-hosted SigNoz observability stack in this GitOps repo.

    112 GitHub stars~6.1k tokensUpdated yesterday
    DevOps & CloudAuto-check passed
  • Logfire Instrumentation

    basicmachines-co/basic-memory

    Adds Pydantic Logfire tracing, logging and metrics to Python, JavaScript or TypeScript and Rust projects, with the correct setup order and library extras.

    4.1k GitHub stars~2.3k tokensUpdated today
    DevOps & CloudAuto-check passed

More from grafana/skills

All 51 skills in this repo
  • K6 Docs

    grafana/skills

    Official

    Write or review k6 documentation across the three k6 repositories - k6-DefinitelyTyped (TypeScript types), k6-docs (user documentation), and k6 (release notes / changelog).

    281 GitHub stars~678 tokensUpdated yesterday
    Auto-check passed
  • Alerting Irm

    grafana/skills

    Official

    Configure Grafana Alerting, Incident Response Management (IRM), and SLOs end-to-end — provisions Grafana-managed and data-source-managed alert rules, contact points (Slack/PagerDuty/email/webhook)…

    281 GitHub starsUsed in 1 repo~1.9k tokens
    Auto-check passed
  • Dashboarding

    grafana/skills

    Official

    Build, modify, and ship Grafana dashboards as JSON via the HTTP API — panel types (timeseries / stat / gauge / table / heatmap / logs / traces / node-graph), gridPos 24-column layout, units…

    281 GitHub starsUsed in 1 repo~1.4k tokens
    Auto-check passed
  • K6 Perf Test Website

    grafana/skills

    Official

    A skill your agent uses when the user wants to performance-test, load-test, or stress-test a public website end-to-end with k6.

    281 GitHub stars~3.3k tokensUpdated yesterday
    Auto-check passed
  • Promql

    grafana/skills

    Official

    Write, validate, and optimize PromQL for Prometheus / Grafana Mimir / Grafana Cloud Metrics.

    281 GitHub starsUsed in 1 repo~1.1k tokens
    Auto-check passed
  • Adaptive Metrics

    grafana/skills

    Official

    Cut Grafana Cloud Metrics cost by shrinking active-series count with Adaptive Metrics aggregation rules — auto-recommendations from query history, custom exact/regex rules, label-drop config…

    281 GitHub stars~1.3k tokensUpdated yesterday
    Auto-check passed

Categories

Questions about Opentelemetry

What does Opentelemetry do?

Instrument any app with OpenTelemetry and ship metrics / logs / traces to Grafana Cloud or self-hosted Mimir / Loki / Tempo / Pyroscope. Opentelemetry is an agent skill from grafana/skills, published by the product's own GitHub organization. Instrument any app with OpenTelemetry and ship metrics / logs / traces to Grafana Cloud or self-hosted Mimir / Loki / Tempo / Pyroscope.

When should I use Opentelemetry?

Opentelemetry fits situations like: instrumenting a service; pointing OTLP at Grafana Cloud; switching from Jaeger / Datadog / New Relic; choosing head- vs tail-sampling.

How do I install Opentelemetry in Claude Code?

Run `npx skills add grafana/skills --skill opentelemetry -a claude-code`. Or copy the skill folder (skills/grafana-core/opentelemetry in grafana/skills) into .claude/skills/opentelemetry in your project. Claude Code loads it when a task matches its description.

How do I install Opentelemetry in Codex?

Run `npx skills add grafana/skills --skill opentelemetry -a codex`. Or copy the skill folder (skills/grafana-core/opentelemetry in grafana/skills) into .agents/skills/opentelemetry in your project. Codex loads it when a task matches its description.

Can I use Opentelemetry in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add grafana/skills --skill opentelemetry -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/opentelemetry, .gemini/skills/opentelemetry, .github/skills/opentelemetry and .opencode/skills/opentelemetry in your project.

What does Opentelemetry need to run?

Going by SKILL.md and its folder, Opentelemetry needs the command-line tools its instructions call (curl, java, pip and kubectl) and credentials named API_KEY and GRAFANA_CLOUD_API_KEY. Our summary lists: Python 3; Node.js; Docker; A credential in API_KEY; A credential in GRAFANA_CLOUD_API_KEY.

Does Opentelemetry access the network?

SKILL.md names 4 domains. In commands or code: otlp-gateway-prod-us-east-0.grafana.net and github.com; the agent is likely to contact these when it follows the instructions. As links in the text: grafana.com and opentelemetry.io. This is read from the text; nothing was executed.

Is Opentelemetry safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Opentelemetry use?

Opentelemetry is published under the Apache-2.0 licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Opentelemetry use?

About 1.7k tokens (SKILL.md is roughly 6.9k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 9.9k tokens, read only when the agent opens those files.

What are the alternatives to Opentelemetry?

Skills that share tags, products or a category with Opentelemetry: Tsh Implementing Observability (TheSoftwareHouse/copilot-collections, 284 stars), Loki Logging (BagelHole/DevOps-Security-Agent-Skills, 1.1k stars), OpenTelemetry Pipeline Metrics Spec (comet-ml/opik, 22k stars) and Logfire Infrastructure (pydantic/skills, 140 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Opentelemetry?

grafana (a GitHub organization, an official publisher) maintains it in grafana/skills, which has 281 GitHub stars. The repository holds 51 skills in this directory. The repository was last updated on October 8, 2026.

Source: grafana/skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.