mirror of https://github.com/prometheus/prometheus
remote-write: add http.resend_count tracing attribute
As recommended by the OpenTelemetry semantic conventions. https://opentelemetry.io/docs/specs/otel/trace/semantic_conventions/http/#http-client Signed-off-by: Bryan Boreham <bjboreham@gmail.com>pull/12676/head
parent
4a56a6bf59
commit
d2ae8dc3cb
|
@ -29,6 +29,7 @@ import (
|
||||||
"github.com/prometheus/common/model"
|
"github.com/prometheus/common/model"
|
||||||
"go.opentelemetry.io/otel"
|
"go.opentelemetry.io/otel"
|
||||||
"go.opentelemetry.io/otel/attribute"
|
"go.opentelemetry.io/otel/attribute"
|
||||||
|
semconv "go.opentelemetry.io/otel/semconv/v1.17.0"
|
||||||
"go.uber.org/atomic"
|
"go.uber.org/atomic"
|
||||||
|
|
||||||
"github.com/prometheus/prometheus/config"
|
"github.com/prometheus/prometheus/config"
|
||||||
|
@ -545,6 +546,10 @@ func (t *QueueManager) sendMetadataWithBackoff(ctx context.Context, metadata []p
|
||||||
attribute.String("remote_name", t.storeClient.Name()),
|
attribute.String("remote_name", t.storeClient.Name()),
|
||||||
attribute.String("remote_url", t.storeClient.Endpoint()),
|
attribute.String("remote_url", t.storeClient.Endpoint()),
|
||||||
)
|
)
|
||||||
|
// Attributes defined by OpenTelemetry semantic conventions.
|
||||||
|
if try > 0 {
|
||||||
|
span.SetAttributes(semconv.HTTPResendCount(try))
|
||||||
|
}
|
||||||
|
|
||||||
begin := time.Now()
|
begin := time.Now()
|
||||||
err := t.storeClient.Store(ctx, req)
|
err := t.storeClient.Store(ctx, req)
|
||||||
|
|
Loading…
Reference in New Issue