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

Instrument exporters' obsreport with OpenTelemetry #6346

Merged
merged 8 commits into from
Nov 1, 2022

Conversation

jaronoff97
Copy link
Contributor

Description:

This PR adds OpenTelemetry instrumentation for the obsreport exporter. This closely follows the previous PR from @paivagustavo for the receiver (#6222)

Link to tracking Issue: Part of #816

Testing: This was tested by running the otel collector locally with the demo client and server. It successfully ran with the gate enabled and disabled, emitting the same metrics.

* Allow for dual instrumentation

* remove log

* Add back mutators
@jaronoff97 jaronoff97 requested review from a team and bogdandrutu October 18, 2022 21:46
@codecov
Copy link

codecov bot commented Oct 19, 2022

Codecov Report

Base: 91.82% // Head: 91.89% // Increases project coverage by +0.07% 🎉

Coverage data is based on head (487345c) compared to base (07603a0).
Patch coverage: 97.58% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6346      +/-   ##
==========================================
+ Coverage   91.82%   91.89%   +0.07%     
==========================================
  Files         237      237              
  Lines       13549    13620      +71     
==========================================
+ Hits        12441    12516      +75     
+ Misses        882      874       -8     
- Partials      226      230       +4     
Impacted Files Coverage Δ
obsreport/obsreport_exporter.go 97.90% <96.96%> (-2.10%) ⬇️
obsreport/obsreporttest/obsreporttest.go 87.09% <100.00%> (-4.69%) ⬇️
obsreport/obsreporttest/otelprometheuschecker.go 93.40% <100.00%> (+1.73%) ⬆️
config/common.go 40.00% <0.00%> (-60.00%) ⬇️
config/confighttp/confighttp.go 88.53% <0.00%> (-11.47%) ⬇️
receiver/otlpreceiver/otlp.go 84.66% <0.00%> (-0.31%) ⬇️
pdata/plog/plogotlp/grpc.go 100.00% <0.00%> (ø)
pdata/ptrace/ptraceotlp/grpc.go 100.00% <0.00%> (ø)
... and 10 more

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.
📢 Do you have feedback about the report comment? Let us know in this issue.

}
meter := cfg.ExporterCreateSettings.MeterProvider.Meter(exporterScope)
Copy link
Member

Choose a reason for hiding this comment

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

might as well create this meter inside of the createOtelMetrics method

Copy link
Contributor Author

@jaronoff97 jaronoff97 Oct 21, 2022

Choose a reason for hiding this comment

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

In that case i'll need to pass the config down, I think that's fine.

Copy link
Contributor

@codeboten codeboten left a comment

Choose a reason for hiding this comment

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

Thanks for the PR, just a couple of questions/comments.

obsreport/obsreport_exporter.go Show resolved Hide resolved
obsreport/obsreport_exporter.go Show resolved Hide resolved
@jaronoff97 jaronoff97 requested review from codeboten and removed request for bogdandrutu October 31, 2022 18:14
Copy link
Contributor

@codeboten codeboten left a comment

Choose a reason for hiding this comment

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

Just one comment, otherwise this looks good 👍🏻

obsreport/obsreport_exporter.go Outdated Show resolved Hide resolved
@@ -28,6 +28,24 @@ func newStubPromChecker() prometheusChecker {
return prometheusChecker{
promHandler: http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) {
_, _ = w.Write([]byte(`
# HELP exporter_send_failed_spans Number of spans in failed attempts to send to destination.
Copy link
Member

Choose a reason for hiding this comment

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

@paivagustavo @jaronoff97 please in a separate PR move this to a file

@bogdandrutu bogdandrutu merged commit 0a55d0b into open-telemetry:main Nov 1, 2022
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.

4 participants