All skills
berriai avatar

/rust-tracing

@876539e
by Berri AIberriai/litellm60k stars
12,037

Add or change Rust diagnostic tracing in litellm-rust, including route spans, subscriber layers, and Python logger delivery

  • 1 file
  • 2.5 KB
  • Updated last week
  • GitHub

Use this Skill: https://skilld.dev/gh/berriai/litellm/rust-tracing

This session only. Nothing lands on disk.

Fork this Skill

A fork creates an editable local Skill with its original author and licence.

SKILL.md

≈34 tokens always: the name and description. ≈594 when used: this file.

Rust tracing

Use upstream tracing throughout Rust, including #[tracing::instrument], events, and span propagation. Centralize collection and delivery infrastructure in crates/tracing. Direct upstream imports still reach our configured subscriber; re-exporting macros does not control delivery. Do not introduce Rust log or pyo3-log for this path

litellm-tracing owns shared subscriber layers, span field collection, and diagnostic processing. Keep adapters composable as tracing_subscriber::Layers, with Logger providing host setup. Runtime-specific delivery belongs in the host bridge. The Python bridge delivers directly to the existing Python SDK logger, preserving its handlers, filtering, redaction, and request correlation. Keep Python dependencies out of crates/tracing

Hosts configure subscribers. Keep Python execution scoped to its captured dispatch rather than installing a process-wide subscriber. Propagate both span context and dispatch across spawned work and returned streams

In core, instrument execution shared by native calls and hosted machines. Use consistent route, model, provider, streaming, and outcome fields. Put status recording at shared provider boundaries instead of scattering basic logging through handlers. Keep upstream HTTP status separate from route success

Use skip_all and explicitly selected fields. Basic tracing excludes bodies, credentials, headers, and raw error strings. Avoid automatic ret or err capture of sensitive values. Keep payload diagnostics separate and subject to existing redaction

A returned stream retains its route span until exhaustion, error, or drop, with exactly one terminal outcome. Builder construction does not start a trace. Never hold a span entry guard across an await. Diagnostic tracing remains separate from lifecycle callbacks and CustomLogger dispatch

Use litellm_tracing::sink_layer to compose a sink with other subscriber layers. It inherits span fields into events and emits span-close summaries with elapsed time. Test observable records, concurrent isolation, dynamic filtering, sensitive-field exclusion, and stream cancellation when changing this behavior

Consult the tracing API and subscriber layers for implementation details

Source: SKILL.md on GitHub

No rule matched.

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

No third-party reports yet.

Signed by skilld at 876539e. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 7 hours ago.

Activeupdated last week

README badge

README badge for berriai/litellm