1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
//! OpenTelemetry GenAI instrumentation (feature `otel`).
//!
//! This module instruments genai operations following the
//! [OpenTelemetry GenAI semantic conventions](https://github.com/open-telemetry/semantic-conventions-genai)
//! (status: Development; a spec snapshot lives under `docs/otel-genai-spec/`).
//!
//! ## How it works
//!
//! genai emits plain [`tracing`] spans whose field names follow the `gen_ai.*`
//! conventions, plus the `otel.kind` / `otel.name` / `otel.status_code` bridge
//! fields. To export them as OpenTelemetry spans, wire
//! [`tracing-opentelemetry`](https://docs.rs/tracing-opentelemetry) onto your
//! `tracing-subscriber` registry in the application — genai records to whatever
//! subscriber is installed and never owns the OTel pipeline itself.
//!
//! The `chat` (inference) and `embeddings` operations are instrumented
//! automatically. Agent / workflow / tool spans and the evaluation event have
//! no genai-internal trigger and are exposed as opt-in builder helpers
//! ([`agent`], [`events`]) for applications building higher-level flows on top
//! of genai.
//!
//! ## Content capture
//!
//! Prompt and response content (`gen_ai.input.messages`, `gen_ai.output.messages`,
//! `gen_ai.system_instructions`, `gen_ai.tool.definitions`) is **off by default**
//! because it is likely to contain sensitive / PII data. Enable it by setting the
//! [`CAPTURE_CONTENT_ENV`](attrs::CAPTURE_CONTENT_ENV) environment variable.
//!
//! ## Limitations
//!
//! - Spans only — the spec's metric instruments are not emitted (usage/duration
//! are available as span attributes; backends can derive metrics from spans).
//! - Array-valued attributes (`finish_reasons`, `stop_sequences`) and message
//! content are encoded as JSON strings, which the spec permits on spans.
pub
pub
pub
// -- Public re-exports
pub use ;
pub use provider_name;
pub use error_type;