Skip to content
Back to skills

Opentelemetry

ASecurity

OpenTelemetry instrumentation conventions. Use when instrumenting code with spans, setting up tracing, or writing trace tests.

  • 17 stars
  • 0 votes
  • 0 copies
  • 4 views
  • Added May 28, 2026
ai-agentsgotesting

Works with

  • cli

Security analysis

A100/100

Scanned May 28, 2026

npx -y skills add bendrucker/claude --skill opentelemetry --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Opentelemetry?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Opentelemetry
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/bendrucker-opentelemetry/badge)](https://www.skillsdirectory.com/skills/bendrucker-opentelemetry)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: opentelemetry
description: >-
  OpenTelemetry instrumentation conventions. Use when instrumenting code with
  spans, setting up tracing, or writing trace tests.
user-invocable: true
disable-model-invocation: true
---

# OpenTelemetry

## Span Naming

Use short, low-cardinality names from semantic conventions:

- HTTP: `GET /users/{id}` (method + route template, never full URL path)
- DB: `SELECT users` (operation + table)
- RPC: `grpc.health.v1.Health/Check`
- Messaging: `orders process` (destination + operation)

## Attributes

Use [semantic convention](https://opentelemetry.io/docs/specs/semconv/) attribute names — never invent your own:

- HTTP: `http.request.method`, `url.full`, `http.response.status_code`, `server.address`
- DB: `db.system`, `db.statement`, `db.namespace`
- General: `error.type`, `service.name`

Import from the versioned semconv package (e.g., `go.opentelemetry.io/otel/semconv/v1.x`).

## Status

Only set status on errors: `span.SetStatus(codes.Error, err.Error())`. Never set `Ok` — unset is the success state. Call `RecordError` alongside `SetStatus` (it only adds a span event, doesn't change status).

For HTTP: 4xx is `Error` on client spans, `Unset` on server spans. 5xx is always `Error`.

## Testing

Use in-memory exporters with `SimpleSpanProcessor` (not batch — batch introduces timing). Assert on exported spans' names, attributes, and status. No mocking needed.

## Boundaries

Instrument network calls, I/O, and queue operations — not every function. Use span events (`AddEvent`) instead of separate log statements for events within a traced operation.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.