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

[service] fix opencensus bridge in periodic readers #9361

Merged
merged 2 commits into from
Jan 24, 2024

Conversation

codeboten
Copy link
Contributor

The periodic metric readers were not connecting to the opencensus bridge prior to this change, meaning anyone trying to emit metrics via the console or OTLP from components that used opencensus were failing to do so.

Alex Boten added 2 commits January 23, 2024 14:18
The periodic metric readers were not connecting to the opencensus bridge prior to this change, meaning anyone trying to emit metrics via the console or OTLP from components that used opencensus were failing to do so.

Signed-off-by: Alex Boten <aboten@lightstep.com>
Signed-off-by: Alex Boten <aboten@lightstep.com>
Copy link

codecov bot commented Jan 23, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (946dc24) 90.27% compared to head (47c83fb) 90.24%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #9361      +/-   ##
==========================================
- Coverage   90.27%   90.24%   -0.03%     
==========================================
  Files         343      343              
  Lines       18003    18005       +2     
==========================================
- Hits        16252    16249       -3     
- Misses       1424     1428       +4     
- Partials      327      328       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@codeboten codeboten marked this pull request as ready for review January 23, 2024 23:22
@codeboten codeboten requested review from a team and jpkrohling January 23, 2024 23:22
@codeboten
Copy link
Contributor Author

I tested this manually to confirm this fixes the bug.

Not sure the best way to test this in a unit test, i would need a destination where I can send periodic reader data configured, which i don't have in a test here... I figured this was a temporary piece of code anyways, until the remaining contrib components are migrated away from opencensus

@@ -71,7 +71,9 @@ func InitMetricReader(ctx context.Context, reader config.MetricReader, asyncErro
return initPullExporter(reader.Pull.Exporter, asyncErrorChannel)
}
if reader.Periodic != nil {
opts := []sdkmetric.PeriodicReaderOption{}
opts := []sdkmetric.PeriodicReaderOption{
sdkmetric.WithProducer(opencensus.NewMetricProducer()),
Copy link
Member

Choose a reason for hiding this comment

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

I dont think I understand what WithProducer does, how was this doing anything before? Or has it been very broken without this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it has been very broken for periodic metric readers that cares about components that produce opencensus metrics.

@codeboten codeboten merged commit b076408 into open-telemetry:main Jan 24, 2024
35 checks passed
@codeboten codeboten deleted the codeboten/fix-census-bridge branch January 24, 2024 16:22
@github-actions github-actions bot added this to the next release milestone Jan 24, 2024
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.

3 participants