-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Instrument obsreport.receiver metrics with otel go #6222
Instrument obsreport.receiver metrics with otel go #6222
Conversation
b3eea74
to
ce32d57
Compare
Codecov ReportBase: 92.48% // Head: 92.04% // Decreases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## main #6222 +/- ##
==========================================
- Coverage 92.48% 92.04% -0.45%
==========================================
Files 218 218
Lines 13124 13218 +94
==========================================
+ Hits 12138 12166 +28
- Misses 769 832 +63
- Partials 217 220 +3
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need this #5939, which is to not break the metrics names at this time. We will at one point later revisit all names.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just one thought, otherwise looks great!
@bogdandrutu this pr actually fixes the name inconsistencies by wrapping the
If we still wants to move on with #5939, I can create a copy of |
…zation changes to another pr; remove public InstrumentWithOtel from obsreport;
3bf3ebd
to
32f6ad5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks sane to me, a review from @Aneurysm9 would be helpful though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Current PR exposes new temporary public APIs because the OC bridge is not ready and we cannot really start the proper migration to otel.
I am not OK doing that.
@bogdandrutu are you concerned about having this public rec.recordWithOtel(receiverCtx, dataType, numAccepted, numRefused)
rec.recordWithOC(receiverCtx, dataType, numAccepted, numRefused) I'm trying to understand what other paths we might have other than just waiting for the bridge to get ready. |
@paivagustavo to give you alternatives, I need to understand the goal :) |
# Conflicts: # CHANGELOG.md # service/telemetry.go
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a couple of questions
Thanks for the reviews @bogdandrutu @codeboten @Aneurysm9, I think I've addressed all the comments at this point and it should be ready to be reviewed again. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for addressing my comments 👍🏻
handleError := func(metricName string, err error) { | ||
if err != nil { | ||
rec.logger.Warn("failed to create otel instrument", zap.Error(err), zap.String("metric", metricName)) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to return the error to the caller instead of logging. It should not be done in this PR, but we need to file an issue for this.
# Conflicts: # CHANGELOG.md
# Conflicts: # cmd/otelcorecol/go.mod
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just for my sanity, please create a separate PR for the version updates, maybe also include the 1.11 updates as well.
* upgrade otel go to latest version v1.11.0/v0.32.3/v0.36.3 (#6293) * [chore] move service pipeline id validation to main config Validate (#6281) Signed-off-by: Bogdan <bogdandrutu@gmail.com> Signed-off-by: Bogdan <bogdandrutu@gmail.com> * Instrument obsreport.receiver metrics with otel go (#6222) * Instrument obs_receiver with otel go * add changelog entry * remove views configuration * move otel-go metrics to obsreport * add UseOtelForMetrics to TelemetrySettings; extract otel sdk initialization changes to another pr; remove public InstrumentWithOtel from obsreport; * default UseOtelForMetrics to false * remove duplicate oc registry initialization * move `UseOtelForMetrics` to the internal package `obsreportconfig` * address comments * only register view if featuregate is disabled * prefix meter name with `receiver/` * change meter scope name * upgrade otel metric sdk * run make gotidy * update changelog * revert: otel go version upgrade * revert: x/sys upgrades * [chore] add chloggen for changelog (#6062) This change updates the changelog process in this repo to match the process in the contrib repo. * Fix support for new line in config URI location Signed-off-by: Bogdan <bogdandrutu@gmail.com> Signed-off-by: Bogdan <bogdandrutu@gmail.com> Co-authored-by: Gustavo Paiva <gustavo@lightstep.com> Co-authored-by: Alex Boten <aboten@lightstep.com>
Description: Instruments existing
obsreport.Receiver
metrics with otel-go, side-by-side with the existing opencensus metrics.This uses the same
UseOtelForInternalMetricsfeatureGateID
feature gate, adding aUseOtelForMetrics()
method on theobsreportconfig
that should be used by components of the collector core to check what sdk should be used for instrumentation.Link to tracking Issue: part of #816
Testing: Manual tests comparing the current exported metrics and the metrics from the otel-go sdk after enabling the feature gate
--feature-gates=telemetry.useOtelForInternalMetrics