Telemetry

From edochi/mdvs · View interactive version

Telemetry is an AI agent skill from the GitHub repository edochi/mdvs. Telemetry and observability conventions. Apply when adding tracing, logging, metrics, or instrumentation to Rust code.

How to use this skill

Skill file

Telemetry & Observability Conventions

If the project has a dedicated telemetry/observability spec or conventions

document, read it first — it takes precedence over the generic guidance below.

Log Levels

| Level | When to Use | Example |

| -------- | --------------------------------------------------- | ---------------------------------------- |

| error! | Unrecoverable failures requiring operator attention | External service call failed permanently |

| warn! | Recoverable issues, degraded operation | Retry triggered, fallback activated |

| info! | Lifecycle events, operational milestones | Server started, connection established |

| debug! | Internal state useful during development | State machine transition details |

| trace! | Per-frame, hot-path data (high volume) | Frame encoded, bytes serialized |

Instrumentation Depth

Not all code deserves the same instrumentation level. Choose based on the

crate's role:

spans. Spans add overhead that matters here.

anything at all.

instrumentation — #[instrument] + spans.

debuggability.

`#[instrument]` Rules

level = "trace" for noisy functions

Structured Logging

Always use named fields, never string interpolation:

// Good: named fields — searchable, parseable
trace!(payload_bytes = payload.len(), frame_bytes = buf.len(), "frame encoded");

// Bad: string interpolation — opaque to log aggregators
trace!("frame encoded, payload={}, frame={}", payload.len(), buf.len());

Span Design

For request/message processing pipelines, use a three-tier span pattern:

ID)

resources)

size)

This gives visibility into where time is spent and enables per-hop latency

analysis.

General Principles

details

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.