package otel

Import Path
	github.com/redis/go-redis/v9/internal/otel (on go.dev)

Dependency Relation
	imports 6 packages, and imported by one package

Involved Source Files metrics.go
Package-Level Type Names (total 4)
/* sort by: | */
Cmder is a minimal interface for command information needed for metrics. This avoids circular dependencies with the main redis package. ( Cmder) Args() []interface{} ( Cmder) Err() error ( Cmder) FullName() string ( Cmder) Name() string *github.com/redis/go-redis/v9.ACLLogCmd *github.com/redis/go-redis/v9.AggregateCmd *github.com/redis/go-redis/v9.AREntrySliceCmd *github.com/redis/go-redis/v9.BFInfoCmd *github.com/redis/go-redis/v9.BoolCmd *github.com/redis/go-redis/v9.BoolSliceCmd *github.com/redis/go-redis/v9.CFInfoCmd *github.com/redis/go-redis/v9.ClientInfoCmd *github.com/redis/go-redis/v9.ClusterLinksCmd *github.com/redis/go-redis/v9.ClusterShardsCmd *github.com/redis/go-redis/v9.ClusterSlotsCmd *github.com/redis/go-redis/v9.CMSInfoCmd *github.com/redis/go-redis/v9.Cmd github.com/redis/go-redis/v9.Cmder (interface) *github.com/redis/go-redis/v9.CommandsInfoCmd *github.com/redis/go-redis/v9.DigestCmd *github.com/redis/go-redis/v9.DurationCmd *github.com/redis/go-redis/v9.FloatCmd *github.com/redis/go-redis/v9.FloatSliceCmd *github.com/redis/go-redis/v9.FTHybridCmd *github.com/redis/go-redis/v9.FTInfoCmd *github.com/redis/go-redis/v9.FTSearchCmd *github.com/redis/go-redis/v9.FTSpellCheckCmd *github.com/redis/go-redis/v9.FTSynDumpCmd *github.com/redis/go-redis/v9.FunctionListCmd *github.com/redis/go-redis/v9.FunctionStatsCmd *github.com/redis/go-redis/v9.GeoLocationCmd *github.com/redis/go-redis/v9.GeoPosCmd *github.com/redis/go-redis/v9.GeoSearchLocationCmd *github.com/redis/go-redis/v9.HImportDiscardAllCmd *github.com/redis/go-redis/v9.HImportDiscardCmd *github.com/redis/go-redis/v9.HImportPrepareCmd *github.com/redis/go-redis/v9.HImportSetCmd *github.com/redis/go-redis/v9.HotKeysCmd *github.com/redis/go-redis/v9.IncrEXFloatCmd *github.com/redis/go-redis/v9.IncrEXIntCmd *github.com/redis/go-redis/v9.InfoCmd *github.com/redis/go-redis/v9.IntCmd *github.com/redis/go-redis/v9.IntPointerSliceCmd *github.com/redis/go-redis/v9.IntSliceCmd *github.com/redis/go-redis/v9.JSONCmd *github.com/redis/go-redis/v9.JSONSliceCmd *github.com/redis/go-redis/v9.KeyFlagsCmd *github.com/redis/go-redis/v9.KeyValueSliceCmd *github.com/redis/go-redis/v9.KeyValuesCmd *github.com/redis/go-redis/v9.LatencyCmd *github.com/redis/go-redis/v9.LCSCmd *github.com/redis/go-redis/v9.MapMapStringInterfaceCmd *github.com/redis/go-redis/v9.MapStringIntCmd *github.com/redis/go-redis/v9.MapStringInterfaceCmd *github.com/redis/go-redis/v9.MapStringInterfaceSliceCmd *github.com/redis/go-redis/v9.MapStringSliceInterfaceCmd *github.com/redis/go-redis/v9.MapStringStringCmd *github.com/redis/go-redis/v9.MapStringStringSliceCmd *github.com/redis/go-redis/v9.MonitorCmd *github.com/redis/go-redis/v9.RankWithScoreCmd *github.com/redis/go-redis/v9.RawCmd *github.com/redis/go-redis/v9.RawWriteToCmd *github.com/redis/go-redis/v9.ScanCmd *github.com/redis/go-redis/v9.ScanDumpCmd *github.com/redis/go-redis/v9.SliceCmd *github.com/redis/go-redis/v9.SlowLogCmd *github.com/redis/go-redis/v9.StatusCmd *github.com/redis/go-redis/v9.StringCmd *github.com/redis/go-redis/v9.StringSliceCmd *github.com/redis/go-redis/v9.StringSliceSliceCmd *github.com/redis/go-redis/v9.StringStructMapCmd *github.com/redis/go-redis/v9.TDigestInfoCmd *github.com/redis/go-redis/v9.TimeCmd *github.com/redis/go-redis/v9.TopKInfoCmd *github.com/redis/go-redis/v9.TSNRangePivotRowSliceCmd *github.com/redis/go-redis/v9.TSTimestampValueCmd *github.com/redis/go-redis/v9.TSTimestampValueSliceCmd *github.com/redis/go-redis/v9.UintCmd *github.com/redis/go-redis/v9.UintSliceCmd *github.com/redis/go-redis/v9.VectorAttribSliceCmd *github.com/redis/go-redis/v9.VectorScoreAttribSliceCmd *github.com/redis/go-redis/v9.VectorScoreSliceCmd *github.com/redis/go-redis/v9.VectorScoreSliceSliceCmd *github.com/redis/go-redis/v9.XAutoClaimCmd *github.com/redis/go-redis/v9.XAutoClaimJustIDCmd *github.com/redis/go-redis/v9.XAutoClaimWithDeletedCmd *github.com/redis/go-redis/v9.XInfoConsumersCmd *github.com/redis/go-redis/v9.XInfoGroupsCmd *github.com/redis/go-redis/v9.XInfoStreamCmd *github.com/redis/go-redis/v9.XInfoStreamFullCmd *github.com/redis/go-redis/v9.XMessageSliceCmd *github.com/redis/go-redis/v9.XPendingCmd *github.com/redis/go-redis/v9.XPendingExtCmd *github.com/redis/go-redis/v9.XStreamSliceCmd *github.com/redis/go-redis/v9.ZeroCopyStringCmd *github.com/redis/go-redis/v9.ZSliceCmd *github.com/redis/go-redis/v9.ZSliceWithKeyCmd *github.com/redis/go-redis/v9.ZWithKeyCmd Cmder : github.com/polarsignals/frostdb/query/logicalplan.Named func RecordOperationDuration(ctx context.Context, duration time.Duration, cmd Cmder, attempts int, err error, cn *pool.Conn, dbIndex int) func Recorder.RecordOperationDuration(ctx context.Context, duration time.Duration, cmd Cmder, attempts int, err error, cn *pool.Conn, dbIndex int)
RegisterPool is called when a new client is created with its connection pools. poolName: identifier for the pool (e.g., "main_abc123") pool: the connection pool RegisterPubSubPool is called when a new client is created with a PubSub pool. poolName: identifier for the pool (e.g., "main_abc123_pubsub") pool: the PubSub connection pool UnregisterPool is called when a client is closed to remove its pool from the registry. pool: the connection pool to unregister UnregisterPubSubPool is called when a PubSub client is closed to remove its pool. pool: the PubSub connection pool to unregister
( PubSubPooler) Stats() *pool.PubSubStats *github.com/redis/go-redis/v9/internal/pool.PubSubPool github.com/redis/go-redis/v9.PubSubPooler (interface) PubSubPooler : github.com/redis/go-redis/v9.PubSubPooler func RegisterPools(connPool pool.Pooler, pubSubPool PubSubPooler, pipelinePool pool.Pooler, addr string) func UnregisterPools(connPool pool.Pooler, pubSubPool PubSubPooler, pipelinePool pool.Pooler) func PoolRegistrar.RegisterPubSubPool(poolName string, pool PubSubPooler) func PoolRegistrar.UnregisterPubSubPool(pool PubSubPooler)
Recorder is the interface for recording metrics. RecordConnectionClosed records when a connection is closed reason: reason for closing (e.g., "idle", "max_lifetime", "error", "pool_closed") err: the error that caused the close (nil for non-error closures) RecordConnectionCount records a change in connection count (UpDownCounter) delta: +1 when connection added, -1 when connection removed state: connection state (e.g., "idle", "used") isPubSub: true if this is a PubSub connection RecordConnectionCreateTime records the time it took to create a new connection RecordConnectionHandoff records when a connection is handed off to another node poolName: name of the connection pool (e.g., "main", "pubsub") RecordConnectionRelaxedTimeout records when connection timeout is relaxed/unrelaxed delta: +1 for relaxed, -1 for unrelaxed poolName: name of the connection pool (e.g., "main", "pubsub") notificationType: the notification type that triggered the timeout relaxation (e.g., "MOVING") RecordConnectionWaitTime records the time spent waiting for a connection from the pool RecordError records client errors (ASK, MOVED, handshake failures, etc.) errorType: type of error (e.g., "ASK", "MOVED", "HANDSHAKE_FAILED") statusCode: Redis response status code if available (e.g., "MOVED", "ASK") isInternal: whether this is an internal error retryAttempts: number of retry attempts made RecordMaintenanceNotification records when a maintenance notification is received notificationType: the type of notification (e.g., "MOVING", "MIGRATING", etc.) RecordOperationDuration records the total operation duration (including all retries) dbIndex is the Redis database index (0-15) RecordPendingRequests records a change in pending requests (UpDownCounter) delta: +1 when request starts waiting, -1 when request stops waiting poolName is passed explicitly because we may not have a connection yet when request starts RecordPipelineOperationDuration records the total pipeline/transaction duration. operationName should be "PIPELINE" for regular pipelines or "MULTI" for transactions. cmdCount is the number of commands in the pipeline. err is the error from the pipeline execution (can be nil). dbIndex is the Redis database index (0-15) RecordPubSubMessage records a Pub/Sub message direction: "sent" or "received" channel: channel name (may be hidden for cardinality reduction) sharded: true for sharded pub/sub (SPUBLISH/SSUBSCRIBE) RecordStreamLag records the lag for stream consumer group processing lag: time difference between message creation and consumption streamName: name of the stream (may be hidden for cardinality reduction) consumerGroup: name of the consumer group consumerName: name of the consumer func SetGlobalRecorder(r Recorder)
Package-Level Functions (total 11)
Enabled reports whether a real recorder is installed. Callers use it to skip metric work whose INPUTS are expensive to obtain — e.g. reading a command's result, which on the async autopipeline face blocks until the command executes.
GetOperationDurationCallback returns the callback for operation duration.
GetPipelineOperationDurationCallback returns the callback for pipeline operation duration.
RecordConnectionCreateTime records the time it took to create a new connection.
RecordOperationDuration records the total operation duration. dbIndex is the Redis database index (0-15).
RecordPipelineOperationDuration records the total pipeline/transaction duration. This is called from redis.go after pipeline/transaction execution completes. operationName should be "PIPELINE" for regular pipelines or "MULTI" for transactions. err is the error from the pipeline execution (can be nil). dbIndex is the Redis database index (0-15).
RecordPubSubMessage records a Pub/Sub message sent or received.
RecordStreamLag records the lag between message creation and consumption in a stream.
RegisterPools registers connection pools with the global recorder. pipelinePool is the optional dedicated pipeline connection pool (nil when not configured); it is registered as a regular pool under a "_pipeline" name suffix.
SetGlobalRecorder sets the global recorder (called by Init() in extra/redisotel-native)
UnregisterPools removes connection pools from the global recorder. pipelinePool is the optional dedicated pipeline connection pool (nil when not configured).