Skip to main content

Function: createCacheAttributes()

@arolariu/website


@arolariu/website / instrumentation.server / createCacheAttributes

Function: createCacheAttributes()

createCacheAttributes(system, operation, hit, key?): CacheAttributes

Defined in: instrumentation.server.ts:825

Create cache operation semantic attributes.

Parameters

system

string

Cache system (redis, memory, nextjs, etc.)

operation

"get" | "set" | "delete" | "clear"

Cache operation (get, set, delete, clear)

hit

boolean

Whether the operation was a cache hit

key?

string

Optional cache key (sanitized)

Returns

CacheAttributes

Type-safe cache attributes

Example

const attrs = createCacheAttributes('redis', 'get', true, 'user:profile');
// was this page useful?