go-redis/redis · error
failed to create connection create time histogram: %w
Error message
failed to create connection create time histogram: %w
What it means
Returned by createRecorder (redisotel.go:223) when dbconv.NewClientConnectionCreateTime fails to create the 'db.client.connection.create_time' Float64Histogram. Only checked when MetricGroupConnectionBasic is enabled.
Source
Thrown at extra/redisotel-native/redisotel.go:223
connectionCount, err = meter.Int64UpDownCounter(
dbconv.ClientConnectionCount{}.Name(),
metric.WithDescription(dbconv.ClientConnectionCount{}.Description()),
metric.WithUnit(dbconv.ClientConnectionCount{}.Unit()),
)
if err != nil {
return nil, fmt.Errorf("failed to create connection count metric: %w", err)
}
var connectionCreateTimeOpts []metric.Float64HistogramOption
if cfg.histAggregation == HistogramAggregationExplicitBucket {
connectionCreateTimeOpts = append(connectionCreateTimeOpts,
metric.WithExplicitBucketBoundaries(cfg.bucketsConnectionCreateTime...),
)
}
var connectionCreateTimeConv dbconv.ClientConnectionCreateTime
connectionCreateTimeConv, err = dbconv.NewClientConnectionCreateTime(meter, connectionCreateTimeOpts...)
if err != nil {
return nil, fmt.Errorf("failed to create connection create time histogram: %w", err)
}
connectionCreateTime = connectionCreateTimeConv.Inst()
connectionRelaxedTimeout, err = meter.Int64UpDownCounter(
MetricConnectionRelaxedTimeout,
metric.WithDescription("How many times the connection timeout has been increased/decreased (after a server maintenance notification)"),
metric.WithUnit("{relaxation}"),
)
if err != nil {
return nil, fmt.Errorf("failed to create connection relaxed timeout metric: %w", err)
}
connectionHandoff, err = meter.Int64Counter(
MetricConnectionHandoff,
metric.WithDescription("Connections that have been handed off to another node (e.g after a MOVING notification)"),
)
if err != nil {
return nil, fmt.Errorf("failed to create connection handoff metric: %w", err)View on GitHub (pinned to 36d97525cd)
Solutions
- Search for other registrations of 'db.client.connection.create_time' and reconcile metadata
- Validate cfg.BucketsConnectionCreateTime contains monotonically increasing positive floats
- Verify OTel SDK compatibility
Example fix
// before - bucket boundaries out of order
cfg.BucketsConnectionCreateTime = []float64{0.1, 0.01, 1.0}
// after - monotonically increasing
cfg.BucketsConnectionCreateTime = []float64{0.01, 0.1, 1.0} Defensive patterns
Strategy: try-catch
Validate before calling
// Validate connection create time bucket boundaries
for i := 1; i < len(cfg.BucketsConnectionCreateTime); i++ {
if cfg.BucketsConnectionCreateTime[i] <= cfg.BucketsConnectionCreateTime[i-1] {
return fmt.Errorf("invalid bucket boundaries")
}
} Try / catch
if err := obs.Init(cfg); err != nil {
if strings.Contains(err.Error(), "connection create time histogram") {
log.Error("conflict on 'db.client.connection.create_time' or invalid bucket boundaries")
}
} Prevention
- Ensure no other library registers 'db.client.connection.create_time' with conflicting metadata
- Validate histogram bucket boundaries are monotonically increasing positive values
- Use a compatible OTel SDK version
When it happens
Trigger: Calling Init with MetricGroupFlagConnectionBasic enabled, and the OTel SDK rejects the histogram creation (duplicate name conflict or invalid configuration).
Common situations: Another library registered 'db.client.connection.create_time' with conflicting unit or description; malformed cfg.BucketsConnectionCreateTime values when using explicit bucket aggregation.
Related errors
- failed to create connection wait time histogram: %w
- failed to create operation duration histogram: %w
- failed to create connection count metric: %w
- failed to create connection relaxed timeout metric: %w
- failed to create connection handoff metric: %w
AI-assisted analysis of go-redis/redis@36d97525cd (2026-08-06).
Data as JSON: /data/errors/839cae4ed39eb4c7.json.
Report an issue: GitHub.