-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
Add scraping for Prometheus endpoint in Kubernetes #4920
Conversation
This will allow users to add Prometheus annotations in services in Kubernetes, and have telegraf scan for them and add them to the list of endpoints to collect metrics from
Thank you so much for taking this over. I've been swamped doing other stuff. |
} | ||
|
||
p.wg = sync.WaitGroup{} | ||
in := make(chan payload) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove, unused.
for { | ||
select { | ||
case <-ctx.Done(): | ||
break |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to use a return or we won't exit the for loop
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we remove the err checking logic on the p.watch as well, since it doesn't effectively do anything for us?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would probably move the logging from line 84 up to this function, and just return err
in the watch function. I see that there is both an error and debug level message in watch, but since they both terminate the watch function I think they should both be error level.
Picks up from, replaces, and closes #3901