-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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 missing roles in prometheus kubernetes example #1840
Conversation
Needed with Prometheus 1.0
@@ -60,6 +61,7 @@ scrape_configs: | |||
- api_servers: | |||
- 'https://kubernetes.default.svc' | |||
in_cluster: true | |||
role: endpoint | |||
|
|||
relabel_configs: | |||
- source_labels: [__meta_kubernetes_role, __meta_kubernetes_service_annotation_prometheus_io_scrape] |
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.
You can also drop the __meta_kubernetes_role
in each of the source_labels
.
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.
And the corresponding true;
in the regexp.
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 see potential problem for the job kubernetes-cluster as there is a combination of two roles. If you set role to apiserver directly, you will not have entries for nodes targets.
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.
Good point - this needs a another job with role: node
.
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.
Awesome, thanks. Will do.
👍 |
1 similar comment
👍 |
Needed with Prometheus 1.0