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

labeldrop does not work as expected #2367

Closed
roman-vynar opened this Issue Jan 25, 2017 · 4 comments

Comments

Projects
None yet
3 participants
@roman-vynar
Copy link
Contributor

roman-vynar commented Jan 25, 2017

Prometheus 1.5.0 introduced labeldrop relabeling action. However, it does not work as expected.

The following config results in dropping all time series containing that label container_label_com_amazonaws_ecs_task_arn instead of just a single label:

    metric_relabel_configs
      - source_labels: [container_label_com_amazonaws_ecs_task_arn]
        action: labeldrop

This config does nothing to the time series and label when using something on matching regex:

    metric_relabel_configs
      - source_labels: [container_label_com_amazonaws_ecs_task_arn]
        regex: 'arn:.*'
        action: labeldrop

The same story when placing the above into relabel_configs.
How does it suppose to work?

Thanks.

@brian-brazil

This comment has been minimized.

Copy link
Member

brian-brazil commented Jan 25, 2017

Source labels aren't relevant for label drop, it's applying to the label names.

It looks like you want a normal replace in this case.

@roman-vynar

This comment has been minimized.

Copy link
Contributor Author

roman-vynar commented Jan 25, 2017

@brian-brazil thanks!

Nevermind, the syntax is:

      - regex: 'container_label_com_amazonaws_ecs_task_arn'
        action: labeldrop
@tcolgate

This comment has been minimized.

Copy link
Contributor

tcolgate commented Jan 25, 2017

To drop an individual label you can use replace with a replacement value of "". labeldrop is for bulk dropping of labels.

@lock

This comment has been minimized.

Copy link

lock bot commented Mar 24, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked and limited conversation to collaborators Mar 24, 2019

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.