manual-instrumentation
OpenTelemetry Manual Instrumentation
Use this skill for manual instrumentation design, implementation, and review.
Usage:
- load the bundled references only when they apply
- use
semantic-conventionsfor semantic convention naming and attributes when available; otherwise use the upstream semantic convention docs via websearch
If a companion skill is unavailable:
- do not stop
- do not rely on memory alone when the guidance can be checked from official sources
- use the corresponding official OpenTelemetry release sources, documentation, examples, or source code
- state that the companion skill was unavailable
- cite the fallback source used
- leave any unverified item unresolved rather than guessing
Non-Negotiable Rules
- Use the latest compatible OpenTelemetry SDK or package for the project language. If the latest release is not compatible, use the latest compatible version and state the reason. When SDK behavior, examples, or setup details are unclear, check official SDK docs and source code instead of relying on model memory.
- Instrument meaningful runtime boundaries only. Do not create spans for helpers, loop bodies, validation-only code, serialization glue, getters, or pure computation. See
references/boundaries.md. - Choose the signal before writing code. Use spans for request or operation flow, metrics for aggregate recurring questions, logs or events for discrete diagnostic facts, and nothing when telemetry would be noise. See
references/signal-selection.md. - For any known boundary type such as
http,db,messaging, orrpc, check the released semantic conventions before choosing names or attributes. Derive semconv-governed span names directly from the released naming rule. Do not add custom prose, protocol labels, hostnames, product names, or business hints to semconv-governed span names. If no released key exists, use a stable custom namespace and keep values bounded. - Keep values bounded. Prefer method, route template, status code, operation name, destination name, region, deployment environment, or customer tier. Avoid raw user IDs, full URLs, raw SQL in metrics, free-form messages, and timestamps as dimensions.
- Record failure on the span that owns the final failed outcome. Do not mark the final span as failed if retries succeed. Do not treat handled errors as terminal failures. See
references/boundaries.md. - Preserve trace context across network and async boundaries. Extract inbound context, inject outbound context, and use baggage only when it is intentional and bounded. See
references/propagation.md.
Workflow
- Identify the task mode: planning, implementation, or review.
- For each instrumentation point, decide:
- the runtime boundary
- the signal
- the semantic convention group if one exists
- the key attributes and cardinality risks
- the propagation requirements
- Implement or review the code.
- Re-open the changed files and verify the result with evidence.
SDK Setup
For SDK initialization, exporter, processor, propagator, and transport configuration, use the sdk-setup companion skill when available. If it is unavailable, apply these minimal defaults:
- traces: OTLP exporter plus batch span processor
- metrics: OTLP exporter plus periodic exporting metric reader
- logs: OTLP exporter plus batching log record processor
- propagators:
tracecontext,baggage - if no SDK exists, configure one; if one exists, reuse it; do not add extra signals
References To Load On Demand
- boundary choice and error ownership:
references/boundaries.md - signal choice:
references/signal-selection.md - propagation and baggage:
references/propagation.md - semantic conventions naming and attributes skill:
semantic-conventions - SDK initialization and configuration skill:
sdk-setup - SDK versions and docs skill:
sdk-versions
Verification Contract
If you changed code or performed an instrumentation review:
- re-open the changed files before finishing
- confirm each applicable item with codebase evidence
- mark non-applicable items explicitly
- do not mark an item complete based on intent alone
Report the final check with:
[x]completed[~]not applicable, with a reason[ ]unresolved
Use these items:
- meaningful boundary
- latest compatible SDK or package decision
- SDK setup uses common defaults or preserves an intentional alternative
- released semantic conventions were checked for each known boundary type
- names and attributes match released semantic conventions, or a concrete compatibility limitation is stated
- signal choice is intentional
- cardinality is bounded
- error ownership matches the final failed outcome
- propagation is handled across relevant network or async boundaries, or is not applicable
- changed files were re-read
- remaining risks or gaps are stated
More from ollygarden/opentelemetry-agent-skills
sdk-setup
OpenTelemetry SDK initialization and configuration. Use when setting up or reviewing TracerProvider, MeterProvider, or LoggerProvider; choosing exporters, processors, or propagators; configuring OTLP transport; or extending an existing SDK setup for new signals. Use this skill whenever the task involves wiring up the OpenTelemetry SDK, even if the user only mentions "add tracing" or "set up metrics" without saying "SDK.
8telemetrygen
Construct telemetrygen commands for generating synthetic OpenTelemetry traces, metrics, and logs via OTLP. Use this skill whenever the user wants to generate test telemetry, load test a collector or backend, create synthetic OTLP data, send sample traces/metrics/logs to an endpoint, test collector pipelines or processors, validate OTTL transforms, test tail sampling, or mentions telemetrygen in any context. Also trigger when the user asks how to simulate telemetry traffic, stress test an observability stack, or produce sample data for dashboards.
8sdk-versions
OpenTelemetry SDK and package version lookup across languages. Use when choosing the latest compatible released OpenTelemetry SDK or package version and locating setup docs or examples.
8semantic-conventions
OpenTelemetry semantic convention lookup and naming guidance. Use when selecting released semantic convention groups, attributes, or span naming rules, or when checking semantic convention compliance.
8span-events-to-logs-migration
Migrate OpenTelemetry Span Events (AddEvent, RecordException) to the Logs API following the OTEP 4430 deprecation plan. Use when migrating instrumentation from span events to log-based events, reviewing code that still uses AddEvent or RecordException, or planning a migration across a codebase.
8go-sdk
>
7