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 broken metrics exporting in the example #2381

Merged
merged 1 commit into from
Jan 20, 2021

Conversation

tigrannajaryan
Copy link
Member

Pusher was missing in the metric controller creation. Due to this no metrics
were exported at all.

Added pusher similar to this example: https://github.com/open-telemetry/opentelemetry-go/blob/c066f15ed74fec52c4755014bfcf2bdfb8e0e661/example/otel-collector/main.go#L81

Tested with Collector and verified that now metrics are exported.

Also renamed "pusher" to "cont" since it is not a Pusher but a Controller.

Pusher was missing in the metric controller creation. Due to this no metrics
were exported at all.

Added pusher similar to this example: https://github.com/open-telemetry/opentelemetry-go/blob/c066f15ed74fec52c4755014bfcf2bdfb8e0e661/example/otel-collector/main.go#L81

Tested with Collector and verified that now metrics are exported.

Also renamed "pusher" to "cont" since it is not a Pusher but a Controller.
@tigrannajaryan tigrannajaryan requested a review from a team January 20, 2021 15:20
processor.New(
simple.NewWithExactDistribution(),
exp,
),
controller.WithCollectPeriod(7*time.Second),
controller.WithPusher(exp),
Copy link
Member Author

Choose a reason for hiding this comment

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

This line is the bug fix.

@codecov
Copy link

codecov bot commented Jan 20, 2021

Codecov Report

Merging #2381 (84f59ad) into master (86feb9e) will increase coverage by 0.02%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2381      +/-   ##
==========================================
+ Coverage   92.00%   92.02%   +0.02%     
==========================================
  Files         272      272              
  Lines       15402    15402              
==========================================
+ Hits        14170    14174       +4     
+ Misses        850      847       -3     
+ Partials      382      381       -1     
Impacted Files Coverage Δ
exporter/otlpexporter/otlp.go 74.35% <0.00%> (+2.56%) ⬆️
exporter/exporterhelper/metricshelper.go 100.00% <0.00%> (+5.40%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 86feb9e...84f59ad. Read the comment docs.

@bogdandrutu bogdandrutu merged commit e8cc015 into master Jan 20, 2021
@bogdandrutu bogdandrutu deleted the feature/tigran/fixexample branch January 20, 2021 17:00
hughesjj pushed a commit to hughesjj/opentelemetry-collector that referenced this pull request Apr 27, 2023
Troels51 pushed a commit to Troels51/opentelemetry-collector that referenced this pull request Jul 5, 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