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.