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

Move sarama initialization to scraper start method #3104

Conversation

dshomoye
Copy link
Contributor

@dshomoye dshomoye commented Apr 14, 2021

Description: scrapers are updated to initialize sarama client and admin in Start instead of the createMetricsReceiver method. This way, the receiver is immediately created (instead of contacting broker(s) first). If no brokers are reachable, the receiver will fail to start. ref

  • Also updated the CHANGELOG to indicate new component under unreleased changes

Link to tracking Issue:

Testing: Unit test and integration test updated.

Documentation:

@dshomoye dshomoye requested a review from a team April 14, 2021 20:57
@codecov
Copy link

codecov bot commented Apr 14, 2021

Codecov Report

Merging #3104 (a76133d) into main (fbef6d4) will increase coverage by 0.02%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3104      +/-   ##
==========================================
+ Coverage   91.59%   91.62%   +0.02%     
==========================================
  Files         486      486              
  Lines       23515    23525      +10     
==========================================
+ Hits        21539    21554      +15     
+ Misses       1469     1461       -8     
- Partials      507      510       +3     
Flag Coverage Δ
integration 63.44% <64.28%> (+0.13%) ⬆️
unit 90.62% <100.00%> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
receiver/kafkametricsreceiver/receiver.go 100.00% <ø> (ø)
receiver/kafkametricsreceiver/broker_scraper.go 100.00% <100.00%> (ø)
receiver/kafkametricsreceiver/consumer_scraper.go 100.00% <100.00%> (ø)
receiver/kafkametricsreceiver/topic_scraper.go 97.05% <100.00%> (+0.08%) ⬆️
receiver/k8sclusterreceiver/watcher.go 95.29% <0.00%> (-2.36%) ⬇️
receiver/prometheusexecreceiver/receiver.go 88.33% <0.00%> (+2.50%) ⬆️
exporter/datadogexporter/metadata/metadata.go 90.14% <0.00%> (+5.63%) ⬆️

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 fbef6d4...a76133d. Read the comment docs.

@dshomoye
Copy link
Contributor Author

dshomoye commented Apr 14, 2021

the failing lint error seems to be related to this: mvdan/unparam#40
all create* methods are expected to have the same signature but it's not defined in any interface, so unparam is flagging a return value as unused

Resolved

receiver/kafkametricsreceiver/receiver.go Outdated Show resolved Hide resolved
receiver/kafkametricsreceiver/topic_scraper.go Outdated Show resolved Hide resolved
receiver/kafkametricsreceiver/topic_scraper_test.go Outdated Show resolved Hide resolved
receiver/kafkametricsreceiver/broker_scraper.go Outdated Show resolved Hide resolved
@dshomoye dshomoye requested a review from jrcamp April 20, 2021 16:36
@dshomoye
Copy link
Contributor Author

@bogdandrutu it would be great to get this merged before the next release

@bogdandrutu bogdandrutu merged commit 58561eb into open-telemetry:main Apr 20, 2021
pmatyjasek-sumo pushed a commit to pmatyjasek-sumo/opentelemetry-collector-contrib that referenced this pull request Apr 28, 2021
* move client and admin initialization

from create scraper to start scraper method

* update integration test

* update integration err msg

* fix client close before return

* fix for comments

* update CHANGELOG.md
alexperez52 referenced this pull request in open-o11y/opentelemetry-collector-contrib Aug 18, 2021
alexperez52 referenced this pull request in open-o11y/opentelemetry-collector-contrib Aug 18, 2021
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