Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: bring back OTEL receiver metrics #3917

Merged
merged 12 commits into from
Jul 29, 2024

Conversation

javiermolinar
Copy link
Contributor

@javiermolinar javiermolinar commented Jul 29, 2024

What this PR does:
This PR recovers the OTEL receiver metrics that Tempo previously exported.

The metrics stopped from being exported in this commit: #3148.
Doing a bit of code archeology here is where the OpenCensus code is removed open-telemetry/opentelemetry-collector#9102.

The way this works is by implementing a custom MeterProvider, adapted from go.opentelemetry.io/otel/metric/noop, to intercept the metrics emitted by obsreport.go and record them using our internal tooling.

Example of the metrics from the metrics endpoint:

# HELP tempo_receiver_accepted_spans Number of spans successfully pushed into the pipeline.
# TYPE tempo_receiver_accepted_spans counter
tempo_receiver_accepted_spans{receiver="tempo/otlp_receiver",transport="http"} 1
# HELP tempo_receiver_refused_spans Number of spans that could not be pushed into the pipeline.
# TYPE tempo_receiver_refused_spans counter
tempo_receiver_refused_spans{receiver="tempo/otlp_receiver",transport="http"} 0

Which issue(s) this PR fixes:
Fixes #3758

Checklist

  • Tests updated
  • Documentation added
  • CHANGELOG.md updated - the order of entries should be [CHANGE], [FEATURE], [ENHANCEMENT], [BUGFIX]

Copy link
Member

@joe-elliott joe-elliott left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice fix! One small perf tweak and we're good.

// Int64Counter returns a Counter used to record int64 measurements that
// produces no telemetry.
func (Meter) Int64Counter(name string, _ ...metric.Int64CounterOption) (metric.Int64Counter, error) {
return Int64Counter{Name: name}, nil
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if the name is not one we care to track we should just return a NopInt64Counter.

@zlin179
Copy link

zlin179 commented Jul 29, 2024

Just wondering will we get a patch to 2.5 soon or we need to wait until 2.6 is released for this fix?

@joe-elliott
Copy link
Member

joe-elliott commented Jul 29, 2024

Just wondering will we get a patch to 2.5 soon or we need to wait until 2.6 is released for this fix?

This will be released with 2.6. The release will likely occur towards the end of August

@zlin179
Copy link

zlin179 commented Jul 29, 2024

Just wondering will we get a patch to 2.5 soon or we need to wait until 2.6 is released for this fix?

This will be released with 2.6. The release will likely occur towards the end of August

Thanks. Then is there any suggestion/workaround on checking logs/metrics on refused spans while receiver_refused_spans is missing? The only metrics I see is distributor_spans_received_total but it only shows the number of accepted_spans right?

@joe-elliott joe-elliott merged commit d36cc9f into grafana:main Jul 29, 2024
14 checks passed
@joe-elliott
Copy link
Member

Then is there any suggestion/workaround on checking logs/metrics on refused spans while receiver_refused_spans is missing?

I would use: tempo_discarded_spans_total. It shows spans dropped for a number of reasons including ingestion reasons

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Tempo (v2.5.0) Distributor missing tempo_receiver_accepted_spans
3 participants