Open jmichalek132 opened 4 months ago
So for now I went with a workaround which got at least some of the panels working which is adding a relabaling rule to service monitor in the helm chart, to make the job label match what the dashboards expect.
monitoring:
serviceMonitor:
enabled: true
interval: 60s
relabelings:
- action: replace
replacement: loki/$1
regex: loki/loki-(.*)
sourceLabels:
- job
targetLabel: job
Describe the bug Job label selectors used in dashboards from loki mixin (https://github.com/grafana/loki/blob/main/production/loki-mixin/dashboards/loki-writes.libsonnet#L21) don't match the job label value on loki, when running it in the distributed mode using the helm chart from loki repo in combination with enabling the service monitor for scraping metrics.
The job label selector snippet from one of the dashboards.
ends up producing
job=~"(loki)/distributor"
label selector. but in our case the actual value of the labels isjob="loki/loki-distributor"
not matching the label selector. This is due to the service monitor:The
loki/
part is added using relabeling, and theloki-distributor
is the name of the service.To Reproduce Steps to reproduce the behavior:
Expected behavior Dashboards present in loki mixin would work out of box with loki in the distributed mode deployed using the helm chart.
Environment:
Screenshots, Promtail config, or terminal output If applicable, add any output to help explain your problem.