Skip to content

Commit

Permalink
Merge branch 'main' into renovate/opentelemetry-go-monorepo
Browse files Browse the repository at this point in the history
  • Loading branch information
kruskall authored Nov 23, 2023
2 parents aacf333 + 6263759 commit 0a8a219
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions kafka/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ func (h *metricHooks) OnFetchRecordUnbuffered(r *kgo.Record, _ bool) {
attrs = append(attrs, attribute.String("namespace", h.namespace))
}

h.messageFetched.Add(r.Context, 1,
h.messageFetched.Add(context.Background(), 1,
metric.WithAttributes(attrs...),
)

Expand All @@ -144,7 +144,7 @@ func (h *metricHooks) OnFetchRecordUnbuffered(r *kgo.Record, _ bool) {
span.SetAttributes(
attribute.Float64(msgDelayKey, delay),
)
h.messageDelay.Record(r.Context, delay, metric.WithAttributes(
h.messageDelay.Record(context.Background(), delay, metric.WithAttributes(
attrs...,
))
}
Expand Down
4 changes: 2 additions & 2 deletions pubsublite/internal/telemetry/consumer.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ func Consumer(
}
}

metrics.fetched.Add(ctx, 1, metric.WithAttributes(
metrics.fetched.Add(context.Background(), 1, metric.WithAttributes(
attrs...,
))

Expand All @@ -130,7 +130,7 @@ func Consumer(
span.SetAttributes(
attribute.Float64(msgDelayKey, delay),
)
metrics.queuedDelay.Record(ctx, delay, metric.WithAttributes(
metrics.queuedDelay.Record(context.Background(), delay, metric.WithAttributes(
attrs...,
))

Expand Down
4 changes: 2 additions & 2 deletions pubsublite/internal/telemetry/publisher.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,12 +117,12 @@ func (p *Producer) Publish(ctx context.Context, msg *pubsub.Message) pubsubabs.P
if err != nil {
span.RecordError(err)
span.SetStatus(codes.Error, err.Error())
p.metrics.errored.Add(ctx, 1, metric.WithAttributes(
p.metrics.errored.Add(context.Background(), 1, metric.WithAttributes(
attrs...,
))
} else {
span.SetStatus(codes.Ok, "success")
p.metrics.produced.Add(ctx, 1, metric.WithAttributes(
p.metrics.produced.Add(context.Background(), 1, metric.WithAttributes(
attrs...,
))
}
Expand Down

0 comments on commit 0a8a219

Please sign in to comment.