Struct Cache Telemetry Event
Generated from cargo doc --no-deps -p nemo-relay-builtins -p nemo-relay-diagnostics -p nemo-relay-logging -p nemo-relay-plugin-host -p nemo-relay-codecs -p nemo-relay -p nemo-relay-runtime -p nemo-relay-model-pricing -p nemo-relay-resource-metrics -p nemo-relay-observability -p nemo-relay-adaptive -p nemo-relay-pii-redaction -p nemo-relay-ffi -p nemo-relay-types -p nemo-relay-plugin -p nemo-relay-worker-proto -p nemo-relay-worker.
Referenced types: Uuid, AgentIdentity, u64, f64, Option, CacheMissReason, CacheMissDiagnosis, String, DateTime, Utc
Per-call cache telemetry event.
Captures provider-agnostic cache metrics for a single LLM request. The agent_identity field cross-references the Phase 3 AgentIdentity type for per-agent grouping.
Fields
request_id: Uuid
Request ID this telemetry pertains to.
agent_identity: AgentIdentity
Identity of the agent that issued the request.
cache_read_tokens: u64
Number of tokens served from cache.
cache_creation_tokens: u64
Number of tokens written to cache.
total_prompt_tokens: u64
Total prompt tokens (for hit rate calculation).
hit_rate: f64
Computed cache hit rate [0.0, 1.0].
miss_reason: Option<CacheMissReason>
Reason for cache miss, if applicable.
miss_diagnosis: Option<CacheMissDiagnosis>
Structured miss diagnosis, when the miss can be justified safely.
provider: String
Provider name (e.g., “anthropic”, “openai”).
timestamp: DateTime<Utc>
When this telemetry was recorded.
Implementations
impl CacheTelemetryEvent
Referenced types: CacheTelemetryEvent
compute_hit_rate
Computes hit rate from token counts. Returns 0.0 if total_prompt_tokens is zero to avoid division by zero.
from_usage
Referenced types: Uuid, AgentIdentity, CacheTelemetryProvider, DateTime, Utc, Option, CacheRequestFacts
Builds a canonical cache telemetry event from normalized usage fields.
Returns None when the normalized usage payload does not contain prompt_tokens, because Phase 10 does not invent missing totals.
Trait Implementations
impl Clone for CacheTelemetryEvent
Referenced types: Clone, CacheTelemetryEvent
clone
Referenced types: clone, CacheTelemetryEvent
clone_from
Referenced types: clone_from
impl Debug for CacheTelemetryEvent
Referenced types: Debug, CacheTelemetryEvent
fmt
Referenced types: fmt, Formatter, Result
impl<'de> Deserialize<'de> for CacheTelemetryEvent
Referenced types: Deserialize, CacheTelemetryEvent
deserialize
Referenced types: deserialize, Result, Error, Deserializer
impl PartialEq for CacheTelemetryEvent
Referenced types: PartialEq, CacheTelemetryEvent
eq
Referenced types: eq, CacheTelemetryEvent, bool
ne
Referenced types: ne, &Rhs, bool
impl Serialize for CacheTelemetryEvent
Referenced types: Serialize, CacheTelemetryEvent
serialize
Referenced types: serialize, Result, Ok, Error, Serializer
impl StructuralPartialEq for CacheTelemetryEvent
Referenced types: StructuralPartialEq, CacheTelemetryEvent