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

Add scraping for Prometheus endpoint in Kubernetes #4920

Merged
merged 16 commits into from
Nov 5, 2018

Conversation

glinton
Copy link
Contributor

@glinton glinton commented Oct 24, 2018

Picks up from, replaces, and closes #3901

@glinton glinton added feat Improvement on an existing feature such as adding a new setting/mode to an existing plugin area/k8s labels Oct 24, 2018
@glinton glinton added this to the 1.9.0 milestone Oct 24, 2018
@sorenmat
Copy link

Thank you so much for taking this over. I've been swamped doing other stuff.

plugins/inputs/prometheus/prometheus.go Outdated Show resolved Hide resolved
plugins/inputs/prometheus/prometheus.go Outdated Show resolved Hide resolved
plugins/inputs/prometheus/kubernetes.go Outdated Show resolved Hide resolved
plugins/inputs/prometheus/prometheus.go Outdated Show resolved Hide resolved
plugins/inputs/prometheus/kubernetes.go Outdated Show resolved Hide resolved
plugins/inputs/prometheus/kubernetes.go Outdated Show resolved Hide resolved
plugins/inputs/prometheus/kubernetes.go Outdated Show resolved Hide resolved
plugins/inputs/prometheus/prometheus.go Outdated Show resolved Hide resolved
plugins/inputs/prometheus/prometheus.go Outdated Show resolved Hide resolved
plugins/inputs/prometheus/README.md Show resolved Hide resolved
plugins/inputs/prometheus/kubernetes.go Outdated Show resolved Hide resolved
plugins/inputs/prometheus/kubernetes.go Outdated Show resolved Hide resolved
plugins/inputs/prometheus/kubernetes.go Outdated Show resolved Hide resolved
plugins/inputs/prometheus/prometheus_test.go Outdated Show resolved Hide resolved
plugins/inputs/prometheus/prometheus.go Show resolved Hide resolved
plugins/inputs/prometheus/kubernetes.go Outdated Show resolved Hide resolved
plugins/inputs/prometheus/kubernetes.go Outdated Show resolved Hide resolved
plugins/inputs/prometheus/kubernetes.go Outdated Show resolved Hide resolved
plugins/inputs/prometheus/README.md Outdated Show resolved Hide resolved
plugins/inputs/prometheus/kubernetes.go Outdated Show resolved Hide resolved
}

p.wg = sync.WaitGroup{}
in := make(chan payload)
Copy link
Contributor

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
Copy link
Contributor

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

Copy link
Contributor Author

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?

Copy link
Contributor

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.

@danielnelson danielnelson merged commit 9c86655 into master Nov 5, 2018
@danielnelson danielnelson deleted the prometheus_scan branch November 5, 2018 21:30
otherpirate pushed a commit to otherpirate/telegraf that referenced this pull request Mar 15, 2019
otherpirate pushed a commit to otherpirate/telegraf that referenced this pull request Mar 15, 2019
dupondje pushed a commit to dupondje/telegraf that referenced this pull request Apr 22, 2019
athoune pushed a commit to bearstech/telegraf that referenced this pull request Apr 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/k8s feat Improvement on an existing feature such as adding a new setting/mode to an existing plugin
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants