Skip to content
Agentmart
Submit a tool

opentelemetry-rust-sdk

Best-practice guide for instrumenting Rust apps with the OpenTelemetry SDK.

Skill by cedricziel

IndexedMIT★ 6
Write a review

Install

Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.

npx agentmarket install skill/cedricziel-opentelemetry-rust-sdk

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

Best-practice guide for instrumenting Rust apps with the OpenTelemetry SDK. Use when setting up traces, metrics, logs, exporters, and lifecycle handling. For GenAI attributes and semantics, pair with the opentelemetry-genai-spec skill.

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions

What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.

Tools
No tools found
Secrets
None asked for
Install scripts
None found

Network hosts it talks to 1

  • codeload.github.com · found in install command

Files it touches

  • ~/.claude/skills/opentelemetry-rust-sdk

What's inside

Skill name
opentelemetry-rust-sdk
Description
Best-practice guide for instrumenting Rust apps with the OpenTelemetry SDK. Use when setting up traces, metrics, logs, exporters, and lifecycle handling. For GenAI attributes and semantics, pair with the opentelemetry-genai-spec skill.
License
MIT
Instructions
77 lines in SKILL.md · view on GitHub

Files (1)

  • SKILL.md

SKILL.md (first lines)

# opentelemetry-rust-sdk

Use this skill as a **best-practice reference** for OpenTelemetry Rust SDK
instrumentation. It is intentionally normative and may be stricter than the
current project implementation.

For GenAI semantic conventions (`gen_ai.*`), use:

- `opentelemetry-genai-spec`

## Core setup pattern (best-practice)

1. Build a shared `Resource` (`service.name`, `service.version`, env metadata).
2. Build providers per signal:
   - `SdkTracerProvider`
   - `SdkLoggerProvider`
   - `SdkMeterProvider`
3. Attach processors/readers/exporters:
   - traces/logs: batch processors for production
   - metrics: `PeriodicReader`
4. Register globally (`global::set_tracer_provider`, `global::set_meter_provider`,
   log bridge setup).
5. Flush/shutdown on exit to avoid telemetry loss.

## Exporter strategy

- Prefer OTLP for production (`opentelemetry-otlp`) and let standard
  `OTEL_EXPORTER_OTLP_*` env vars drive endpoints/headers/timeouts.
- Use stdout exporters for local debugging and quick verification.
- If dual-exporting (for example local + remote), keep one provider per signal
  and attach multiple processors/readers instead of duplicating providers.

## Tracing + logging integration

- Use `tracing-opentelemetry` when you want `tracing` spans exported as OTel traces.
- Use `opentelemetry-appender-tracing` when you want `tracing` events exported as OTel logs.
- Prevent recursive logging loops (for example DB/exporter internals) by adding
  explicit target filters on the log bridge.

## Metrics recommendations

- Use explicit instrument naming and units.
- Keep attribute cardinality bounded; avoid unbounded IDs in metric labels.
- Configure export interval intentionally (`PeriodicReader`) for your cost/latency
  goals.
- Always shutdown/flush meter providers in long-running services and tests.

## Performance defaults

- Production: batch processors for traces/logs.
- Debug/test: simple processors or in-memory exporters for deterministic checks.
- Avoid large payload attributes unless required and policy-approved.

## Safety and data policy

- Treat prompts, outputs, tool args/results, and retrieval payloads as sensitive.
- Default to metadata-only telemetry in production.
- Add truncation/redaction toggles before enabling full content capture.

## Versioning and compatibility

- Keep `opentelemetry`, `opentelemetry_sdk`, and `opentelemetry-otlp` versions
  aligned.
- Re-check feature flags (`trace`, `logs`, `metrics`, runtime/exporter features)
  on upgrades.
- Read changelogs for SDK/exporter crates before bumping versions.

## Review checklist

1. Resource fields present and consistent across all signals.
2. Providers registered once and shutdown cleanly.
3. Batch/reader configuration fits workload.
4. Cardinality and payload-size risks addressed.
5. OTLP env-based config works in target deploy environment.
6. GenAI attributes validated against `opentelemetry-genai-spec`.

From cedricziel/assistant, MIT.

More from cedricziel/assistant

Signals

Stars
6
Forks
1
Open issues
14
Last commit (this folder)
Mar 23, 2026 (7 months ago)
Last release
May 26, 2026 (5 months ago)

From GitHub (fetched Oct 24, 2026).

Details

License
MIT
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

More from cedricziel

Cite this page

opentelemetry-rust-sdk skill. Agent Mart. https://agentmart.dev/skills/cedricziel-opentelemetry-rust-sdk (last updated 2026-10-24)