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

[receiver/hostmetrics] register scrapers with scraper names #35837

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

braydonk
Copy link
Contributor

@braydonk braydonk commented Oct 16, 2024

Description

This PR changes each scraper's factory to create a scraper with the scraper's name. This is to ensure that logs from the scrapercontroller will contain the name of the scraper.

Link to tracking issue

Fixes #35814

Testing

New unit tests

Built the collector with cpu scraper modified to immediately return an error and got the following message:

2024-10-16T14:58:46.396Z        error   scraperhelper/scrapercontroller.go:205  Error scraping metrics  {"kind": "receiver", "name": "hostmetrics", "data_type": "metrics", "error": "hi i failed", "scraper": "cpu"}

Documentation

Not needed.

This PR changes each scraper's factory to create a scraper with the
scraper's name. This is to ensure that logs from the `scrapercontroller`
will contain the name of the scraper.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[receiver/hostmetrics] should report scraper that failed in case of error
3 participants