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

Port loki/#10752 to Agent #5481

Merged
merged 3 commits into from
Oct 16, 2023
Merged

Conversation

salvacorts
Copy link
Contributor

@salvacorts salvacorts commented Oct 16, 2023

PR Description

This PR upstreams the promtail changes from grafana/loki#10752 into the Grafana Agent.

This is rather expected behavior, so no need to update the docs.

PR Checklist

  • CHANGELOG.md updated
  • Documentation added
  • Tests updated
  • Config converters updated

@CLAassistant
Copy link

CLAassistant commented Oct 16, 2023

CLA assistant check
All committers have signed the CLA.

@salvacorts salvacorts marked this pull request as ready for review October 16, 2023 09:03
@salvacorts salvacorts requested a review from a team as a code owner October 16, 2023 09:03
Copy link
Member

@tpaschalis tpaschalis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks for porting the changes over @salvacorts!

@tpaschalis tpaschalis enabled auto-merge (squash) October 16, 2023 09:16
@tpaschalis tpaschalis merged commit 3dbe261 into main Oct 16, 2023
@tpaschalis tpaschalis deleted the salvacorts/port-loki-10752-to-agent branch October 16, 2023 09:34
@alexinfoblox
Copy link

alexinfoblox commented Jan 12, 2024

Hi @salvacorts, Is this feature available in the v0.39.0 release?
Trying to extract labels into the structed_metadata, however, discovered labels are getting added to the stream.
Config:

scrape_configs:
- job_name: kubernetes-pods
  pipeline_stages:
    - cri: {}
    - structured_metadata:
        container_image:
        app_version:
  kubernetes_sd_configs:
    - role: pod
  relabel_configs:
    - source_labels:
      - __meta_kubernetes_pod_label_app_kubernetes_io_version
      action: replace
      target_label: app_version
    - source_labels:
      - __meta_kubernetes_pod_container_image
      action: replace
      target_label: container_image

In the Loki there are duplicated labels:
image
image

And discovered labels getting added to the Label Filters
image

When I'm trying to use this structed_metadata in Promtail (using the latest image) with the same configuration, the feature works as expected. The extracted labels are not being added to the stream as new labels.

Why this doesn't work in Grafana-Agent?

@mattdurham
Copy link
Collaborator

This was only added to flow mode and it looks like you are using static mode.

@alexinfoblox
Copy link

Yeah. I'm using static mode.
Ok, will give it a try with flow mode. @mattdurham Thanks for the pointer

@github-actions github-actions bot added the frozen-due-to-age Locked due to a period of inactivity. Please open new issues or PRs if more discussion is needed. label Feb 21, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 21, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
frozen-due-to-age Locked due to a period of inactivity. Please open new issues or PRs if more discussion is needed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants