{"id":"12b64c0963f77d66","repo":"go-redis/redis","slug":"failed-to-create-connection-relaxed-timeout-metric","errorCode":null,"errorMessage":"failed to create connection relaxed timeout metric: %w","messagePattern":"failed to create connection relaxed timeout metric: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"extra/redisotel-native/redisotel.go","lineNumber":233,"sourceCode":"\t\tif cfg.histAggregation == HistogramAggregationExplicitBucket {\n\t\t\tconnectionCreateTimeOpts = append(connectionCreateTimeOpts,\n\t\t\t\tmetric.WithExplicitBucketBoundaries(cfg.bucketsConnectionCreateTime...),\n\t\t\t)\n\t\t}\n\t\tvar connectionCreateTimeConv dbconv.ClientConnectionCreateTime\n\t\tconnectionCreateTimeConv, err = dbconv.NewClientConnectionCreateTime(meter, connectionCreateTimeOpts...)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"failed to create connection create time histogram: %w\", err)\n\t\t}\n\t\tconnectionCreateTime = connectionCreateTimeConv.Inst()\n\n\t\tconnectionRelaxedTimeout, err = meter.Int64UpDownCounter(\n\t\t\tMetricConnectionRelaxedTimeout,\n\t\t\tmetric.WithDescription(\"How many times the connection timeout has been increased/decreased (after a server maintenance notification)\"),\n\t\t\tmetric.WithUnit(\"{relaxation}\"),\n\t\t)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"failed to create connection relaxed timeout metric: %w\", err)\n\t\t}\n\n\t\tconnectionHandoff, err = meter.Int64Counter(\n\t\t\tMetricConnectionHandoff,\n\t\t\tmetric.WithDescription(\"Connections that have been handed off to another node (e.g after a MOVING notification)\"),\n\t\t)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"failed to create connection handoff metric: %w\", err)\n\t\t}\n\t}\n\n\tvar clientErrors metric.Int64Counter\n\tvar maintenanceNotifications metric.Int64Counter\n\n\tif cfg.isMetricGroupEnabled(MetricGroupResiliency) {\n\t\tclientErrors, err = meter.Int64Counter(\n\t\t\tMetricClientErrors,\n\t\t\tmetric.WithDescription(\"Number of errors handled by the Redis client\"),","sourceCodeStart":215,"sourceCodeEnd":251,"githubUrl":"https://github.com/go-redis/redis/blob/36d97525cd8076aed67cddf54778e9ea84550929/extra/redisotel-native/redisotel.go#L215-L251","documentation":"Returned by createRecorder (redisotel.go:233) when meter.Int64UpDownCounter fails to create the 'redis.client.connection.relaxed_timeout' instrument. Only checked when MetricGroupConnectionBasic is enabled.","triggerScenarios":"Calling Init with MetricGroupFlagConnectionBasic enabled, and the OTel SDK rejects the UpDownCounter creation for the relaxed-timeout metric.","commonSituations":"Another instrumentation library or a different go-redis version registered the same instrument name with conflicting metadata; SDK version incompatibility.","solutions":["Reconcile any other registration of 'redis.client.connection.relaxed_timeout' so instrument type and metadata match","Ensure no conflicting redisotel versions are imported transitively","Verify the MeterProvider is functional"],"exampleFix":"// before - mixed redisotel versions create conflicting metadata\n// (v1 registered it with unit \"{relaxation}\", v2 without)\n\n// after - pin a single redisotel version in go.mod\ngo get github.com/redis/go-redis/extra/redisotel-native@v9.x.x","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"if err := obs.Init(cfg); err != nil {\n    if strings.Contains(err.Error(), \"connection relaxed timeout metric\") {\n        log.Error(\"conflict on 'redis.client.connection.relaxed_timeout'; reconcile metadata\")\n    }\n}","preventionTips":["Ensure no other integration registers 'redis.client.connection.relaxed_timeout' with conflicting metadata","Pin a single redisotel-native version in go.mod to avoid transitive conflicts","Verify the MeterProvider is functional before calling Init"],"tags":["otel","redisotel-native","metrics","connection","updown-counter"],"analyzedSha":"36d97525cd8076aed67cddf54778e9ea84550929","analyzedAt":"2026-08-06T01:08:27.376Z","schemaVersion":2}