Possibly remove k8s label relabel scrapeconfig action?
Bug
Description
When deploying PLG to any sizable K8s cluster with a normal use of K8s labels, the Promtail scrapeconfig relabel configs are causing Loki to store logs in chunks that are too small to retrieve efficiently since Loki stores logs by unique combinations of labels (see label best practices in the Loki docs). While this means log collection works fine, querying logs can take a very long time and timeouts have to be continuously extended. In order to resolve this, the entire default scrapeconfig string has to be overridden to remove all the extra, unneeded labels.
Could the actions here and here in the scrapeconfig either be removed or moved under extra scrapeconfigs so that deployments to sizable clusters can get reasonably sized chunks and timely query results more easily?
BigBang Version
What version of BigBang were you running? Any
Designs
- Show closed items
Activity
-
Newest first Oldest first
-
Show all activity Show comments only Show history only
- bigbang bot added teamObservability label
added teamObservability label
- bigbang bot added community-contribution label
added community-contribution label
- bigbang bot added triage-kind label
added triage-kind label
- bigbang bot added triage-priority label
added triage-priority label
- Jimmy Ungerman added statusready-to-work label
added statusready-to-work label
- Jimmy Ungerman changed iteration to Big Bang Iterations Jun 11, 2024 - Jun 24, 2024
changed iteration to Big Bang Iterations Jun 11, 2024 - Jun 24, 2024
- Jimmy Ungerman set weight to 3
set weight to 3
- Jimmy Ungerman assigned to @jimmyungerman
assigned to @jimmyungerman
- Jimmy Ungerman added kindenhancement priority4 labels
added kindenhancement priority4 labels
- Jimmy Ungerman removed triage-priority label
removed triage-priority label
- Jimmy Ungerman removed triage-kind label
removed triage-kind label
- Contributor
This could be a good issue to set a defined set of "BigBang Labels" we want to add as right now we're just adding every kubernetes label imaginable which is resulting in a lot of noise.
Edited by Jimmy Ungerman - Contributor
Test scrape config provided by @michaelabixler:
scrapeConfigs: | # See also https://github.com/grafana/loki/blob/master/production/ksonnet/promtail/scrape_config.libsonnet for reference - job_name: kubernetes-pods pipeline_stages: - cri: {} kubernetes_sd_configs: - role: pod relabel_configs: - source_labels: - __meta_kubernetes_pod_node_name target_label: host - action: replace replacement: $1 separator: / source_labels: - __meta_kubernetes_namespace - __meta_kubernetes_pod_name target_label: job - action: replace source_labels: - __meta_kubernetes_namespace target_label: namespace - replacement: /var/log/pods/*$1/*.log separator: / source_labels: - __meta_kubernetes_pod_uid - __meta_kubernetes_pod_container_name target_label: __path__ - job_name: systemd-journal journal: json: true max_age: 6h path: /var/log/journal relabel_configs: - source_labels: - __journal_systemd_unit target_label: systemd_unit - source_labels: - __journal_hostname target_label: systemd_hostname - source_labels: - __journal_syslog_identifier target_label: syslog_identifier
- Jimmy Ungerman removed statusready-to-work label
removed statusready-to-work label
- Jimmy Ungerman added promtail statusdoing labels
added promtail statusdoing labels
- Jimmy Ungerman added statusready-to-work label and removed statusdoing label
added statusready-to-work label and removed statusdoing label
- Jimmy Ungerman added statusdoing label and removed statusready-to-work label
added statusdoing label and removed statusready-to-work label
- GitLab Automation Bot removed iteration Big Bang Iterations Jun 11, 2024 - Jun 24, 2024
removed iteration Big Bang Iterations Jun 11, 2024 - Jun 24, 2024
- GitLab Automation Bot changed iteration to Big Bang Iterations Jun 25, 2024 - Jul 8, 2024
changed iteration to Big Bang Iterations Jun 25, 2024 - Jul 8, 2024
- Jimmy Ungerman changed milestone to %2.31.0
changed milestone to %2.31.0
- Jimmy Ungerman created branch
52-possibly-remove-k8s-label-relabel-scrapeconfig-action
to address this issuecreated branch
52-possibly-remove-k8s-label-relabel-scrapeconfig-action
to address this issue - Jimmy Ungerman mentioned in merge request !83 (merged)
mentioned in merge request !83 (merged)
- Contributor
Github Comment Mirrored Here
Github Comment Mirrored Here
Github Comment Mirrored Here
Github Comment Mirrored Here
Github Comment Mirrored Here
Github Comment Mirrored Here
Github Comment Mirrored Here
Github Comment Mirrored Here
Github Comment Mirrored Here
Github Comment Mirrored Here
Github Comment Mirrored Here
Github Comment Mirrored Here
Github Comment Mirrored Here
Github Comment Mirrored Here
Github Comment Mirrored Here
Github Comment Mirrored Here
Github Comment Mirrored Here
Github Comment Mirrored Here
Github Comment Mirrored Here
Github Comment Mirrored Here
Github Comment Mirrored Here
Github Comment Mirrored Here
Github Comment Mirrored Here
Github Comment Mirrored Here
Github Comment Mirrored Here
Github Comment Mirrored Here
Github Comment Mirrored Here
Github Comment Mirrored Here
Github Comment Mirrored Here
Github Comment Mirrored Here
Github Comment Mirrored Here
Github Comment Mirrored Here
Github Comment Mirrored Here
Github Comment Mirrored Here
Github Comment Mirrored Here
Github Comment Mirrored Here
Github Comment Mirrored Here
Github Comment Mirrored Here
Github Comment Mirrored Here
Github Comment Mirrored Here
Github Comment Mirrored Here
Github Comment Mirrored Here
Github Comment Mirrored Here
Github Comment Mirrored Here
Github Comment Mirrored Here
Github Comment Mirrored Here
Github Comment Mirrored Here
Github Comment Mirrored Here
Github Comment Mirrored Here
Github Comment Mirrored Here
Github Comment Mirrored Here
Github Comment Mirrored Here
Github Comment Mirrored Here
Github Comment Mirrored Here
Github Comment Mirrored Here
Github Comment Mirrored Here
Github Comment Mirrored Here
Github Comment Mirrored Here
Github Comment Mirrored Here
Github Comment Mirrored Here
Github Comment Mirrored Here
Github Comment Mirrored Here
Github Comment Mirrored Here
Github Comment Mirrored Here
Github Comment Mirrored Here
Github Comment Mirrored Here
Github Comment Mirrored Here
Github Comment Mirrored Here
Github Comment Mirrored Here
After reading the Best Practices doc, it appears we want the absolute least amount of labels as possible so we don't have to chunk our queries.To do this, I'm formally proposing the following default labels config:
pipelineStages: - cri: {} - labeldrop: - filename common: - action: replace source_labels: - __meta_kubernetes_pod_node_name target_label: node_name - action: replace source_labels: - __meta_kubernetes_namespace target_label: namespace - action: replace source_labels: - __meta_kubernetes_pod_name target_label: pod - action: replace source_labels: - __meta_kubernetes_pod_container_name target_label: container - action: replace replacement: /var/log/pods/*$1/*.log separator: / source_labels: - __meta_kubernetes_pod_uid - __meta_kubernetes_pod_container_name target_label: __path__ scrapeConfigs: | - job_name: kubernetes-pods pipeline_stages: {{- toYaml .Values.config.snippets.pipelineStages | nindent 4 }} kubernetes_sd_configs: - role: pod relabel_configs: {{- if .Values.config.snippets.addScrapeJobLabel }} - replacement: kubernetes-pods target_label: scrape_job {{- end }} {{- toYaml .Values.config.snippets.common | nindent 4 }} {{- with .Values.config.snippets.extraRelabelConfigs }} {{- toYaml . | nindent 4 }} {{- end }}
This supplies us with the following default labels for all pods:
And shows we're drastically reducing our chunk flushing as well:
This should greatly improve the speed of our Loki queries.
@andrewshoell @chris.oconnell @michaelmartin Any thoughts?
Edited by Jeremy Twidt Collapse replies - Owner
that looks good to me, out of curiosity what did the old chunk flushing look like?
- Jeremy Twidt closed
closed
Github Comment Mirrored Here
Github Comment Mirrored Here
Github Comment Mirrored Here
Github Comment Mirrored Here
Github Comment Mirrored Here
Github Comment Mirrored Here
Github Comment Mirrored Here
Github Comment Mirrored Here
Github Comment Mirrored Here
Github Comment Mirrored Here
Github Comment Mirrored Here
Github Comment Mirrored Here
Github Comment Mirrored Here
Github Comment Mirrored Here
Github Comment Mirrored Here
Github Comment Mirrored Here
Github Comment Mirrored Here
Github Comment Mirrored Here
closing github issue due to endless loop of comments. gitlab issue still persistsEdited by Jeremy Twidt- Jimmy Ungerman reopened
reopened
- Jimmy Ungerman mentioned in merge request big-bang/bigbang!4600 (merged)
mentioned in merge request big-bang/bigbang!4600 (merged)
- Michael Martin closed with merge request big-bang/bigbang!4600 (merged)
closed with merge request big-bang/bigbang!4600 (merged)
- Michael Martin mentioned in commit big-bang/bigbang@6d63b582
mentioned in commit big-bang/bigbang@6d63b582