Skip to main content

Module attributes

Module attributes 

Source
Expand description

Public constants for cachet telemetry field names and event values.

Use these constants to filter or match cachet telemetry events in a custom tracing_subscriber::Layer.

Tier events (hit, miss, expired, etc.) carry FIELD_NAME, FIELD_EVENT, and FIELD_DURATION_NS. Some events intentionally omit FIELD_DURATION_NS to indicate “not timed”: EVENT_INSERT_REJECTED, EVENT_EVICTION, and background EVENT_EXPIRED events emitted from eviction listeners.

Operation-complete events carry FIELD_NAME, FIELD_OPERATION, FIELD_DURATION_NS, and FIELD_COALESCED.

§Example

use cachet::telemetry::attributes;

// In a tracing Visit impl, match on field values:
if event_value == attributes::EVENT_HIT {
    // handle cache hit
}

Constants§

EVENT_CLEARED
Cache was successfully cleared.
EVENT_CLEAR_ERROR
An error occurred during a clear operation.
EVENT_EVICTION
An entry was evicted/removed due to cache size constraints. Only emitted when eviction telemetry is enabled.
EVENT_EXPIRED
Cache entry was found but expired.
EVENT_GET_ERROR
An error occurred during a get operation.
EVENT_HIT
Cache entry was found and valid.
EVENT_INSERTED
An entry was successfully inserted.
EVENT_INSERT_ERROR
An error occurred during an insert operation.
EVENT_INSERT_REJECTED
An insert was rejected by the insert policy.
EVENT_INVALIDATED
A key was successfully invalidated.
EVENT_INVALIDATE_ERROR
An error occurred during an invalidate operation.
EVENT_MISS
Cache entry was not found.
EVENT_REFRESH_HIT
A background refresh found data in the fallback tier.
EVENT_REFRESH_MISS
A background refresh did not find data in the fallback tier.
FIELD_COALESCED
Field name recording whether stampede protection was enabled for the operation.
FIELD_DURATION_NS
Field name for the operation duration in nanoseconds.
FIELD_EVENT
Field name for the cache event type.
FIELD_NAME
Field name for the cache tier name.
FIELD_OPERATION
Field name for the cache operation name.
TARGET
Tracing target prefix for all cachet telemetry events.