-
Notifications
You must be signed in to change notification settings - Fork 93
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 Traefik Dashboard #797
Conversation
Adam-D-Lewis
commented
Aug 31, 2021
•
edited by tylerpotts
Loading
edited by tylerpotts
- Configures Traefik to produce data for Prometheus to Scrape
- Configures Prometheus to scrape data from Traefik
- Adds a grafana dashboard displaying relevant traefik data
…rometheus_grafana
# This job will scrape from any service with the label app.kubernetes.io/component=traefik-internal-service | ||
# and the annotation app.kubernetes.io/scrape=true | ||
- job_name: 'traefik' | ||
|
||
kubernetes_sd_configs: | ||
- role: service | ||
|
||
relabel_configs: | ||
- source_labels: [__meta_kubernetes_service_label_app_kubernetes_io_component] | ||
action: keep | ||
regex: traefik-internal-service | ||
- source_labels: [__meta_kubernetes_service_annotation_prometheus_io_scrape] | ||
action: keep | ||
regex: true |
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.
As set up now, this will scrape only k8s services with both labels app.kubernetes.io/component: traefik-internal-service
and prometheus.io/scrape: true
(see relabel configs).
It is possible to instead scrape all services with the label prometheus.io/scrape: true
, but they'll all be included under the same prometheus job. I'm not sure if that's the "right way" to do things in Prometheus given their definition of job which I've pasted below (from here):
In Prometheus terms, an endpoint you can scrape is called an instance, usually corresponding to a single process. A collection of instances with the same purpose, a process replicated for scalability or reliability for example, is called a job.
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.
@costrouc, your thoughts?
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.
As set up now, this will scrape only k8s services with both labels app.kubernetes.io/component: traefik-internal-service and prometheus.io/scrape: true (see relabel configs).
I'm not a fan of this since for each new service we'll have to add a new job for scraping.
It is possible to instead scrape all services with the label prometheus.io/scrape: true, but they'll all be included under the same prometheus job.
This is exactly what I'd like to have. I'd like to not have to require development to qhub to require additional modifications to the monitoring configuration.
I also had to edit the traefik dashboard a bit since our traefik container (not pod) is called |
Asside from requiring two labels this PR looks good to me. I'd like to have anything with |
|