mirror of
https://github.com/prometheus/prometheus.git
synced 2025-08-06 06:07:11 +02:00
changes
Signed-off-by: Vanshikav123 <vanshikav928@gmail.com>
This commit is contained in:
parent
4a0929019c
commit
6e98a77b2d
@ -38,6 +38,7 @@ import (
|
||||
"github.com/prometheus/common/version"
|
||||
"go.opentelemetry.io/otel"
|
||||
"go.opentelemetry.io/otel/propagation"
|
||||
"go.opentelemetry.io/otel/trace"
|
||||
|
||||
"github.com/prometheus/prometheus/config"
|
||||
"github.com/prometheus/prometheus/discovery/targetgroup"
|
||||
@ -821,8 +822,7 @@ func acceptEncodingHeader(enableCompression bool) string {
|
||||
var UserAgent = version.PrometheusUserAgent()
|
||||
|
||||
func (s *targetScraper) scrape(ctx context.Context) (*http.Response, error) {
|
||||
tracer := otel.GetTracerProvider().Tracer("prometheus/scraper")
|
||||
ctx, span := tracer.Start(ctx, "scrape_"+s.URL().String())
|
||||
ctx, span := otel.Tracer("").Start(ctx, "Scrape", trace.WithSpanKind(trace.SpanKindClient))
|
||||
defer span.End()
|
||||
|
||||
if s.req == nil {
|
||||
@ -840,9 +840,7 @@ func (s *targetScraper) scrape(ctx context.Context) (*http.Response, error) {
|
||||
|
||||
req := s.req.WithContext(ctx)
|
||||
|
||||
propagator := otel.GetTextMapPropagator()
|
||||
|
||||
propagator.Inject(ctx, propagation.HeaderCarrier(req.Header))
|
||||
otel.GetTextMapPropagator().Inject(ctx, propagation.HeaderCarrier(req.Header))
|
||||
|
||||
return s.client.Do(req)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user