> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.nvidia.com/nemo/relay/llms.txt.
> For full documentation content, see https://docs.nvidia.com/nemo/relay/llms-full.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.nvidia.com/nemo/relay/_mcp/server.

# Struct Cache Telemetry Event

> Per-call cache telemetry event.

Generated from `cargo doc --no-deps -p nemo-relay -p nemo-relay-adaptive -p nemo-relay-ffi`.

<pre />

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`](/reference/api/rust-library-reference/nemo-relay-adaptive/acg/types/struct-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`

<pre />

#### `compute_hit_rate`

<pre />

Computes hit rate from token counts. Returns `0.0` if `total_prompt_tokens` is zero to avoid division by zero.

#### `from_usage`

<pre />

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`

<pre />

#### `clone`

<pre />

#### `clone_from`

<pre />

### `impl Debug for CacheTelemetryEvent`

<pre />

#### `fmt`

<pre />

### `impl<'de> Deserialize<'de> for CacheTelemetryEvent`

<pre />

#### `deserialize`

<pre />

### `impl PartialEq for CacheTelemetryEvent`

<pre />

#### `eq`

<pre />

#### `ne`

<pre />

### `impl Serialize for CacheTelemetryEvent`

<pre />

#### `serialize`

<pre />

### `impl StructuralPartialEq for CacheTelemetryEvent`

<pre />