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

[RFC] metric relabelling support for dropping labels #2233

Closed
tcolgate opened this Issue Nov 29, 2016 · 5 comments

Comments

Projects
None yet
3 participants
@tcolgate
Copy link
Contributor

tcolgate commented Nov 29, 2016

I'm working with cadvisor, and importing some environment variables in from containers (to get mesos task ID and marathon app id, but it could be anything). These result in rather unpleasant labels (container_env_mesos_task_id).
Later I need to make this against a mesos_task_id label coming from elsewhere, so have elected to rename this label in metric relabeling.
Ideally there would be an easy way to bulk remove all container_env_ labels. Currently the only option is to explicitly replace the labels by name.
Possible solutions could be:

  • Support stripping out of __label_name labels, as it done in target relabelling (then I can teach cadvisor to expose them with the __ prefix
  • Provide additional actions that drop labels matching a pattern (labeldrop/labelkeep)

My personal preference would be for the former, since it matches the target relabelling behaviour. Though that behaviour could actually be implemented with a labeldrop action anyway.

@beorn7

This comment has been minimized.

Copy link
Member

beorn7 commented Nov 29, 2016

Just for anecdotal evidence: We have a very similar need (and solved it, as so often, on the level of config management, i.e. a Ruby loop in a Chef recipe creates all the individual label replacement rules).

@tcolgate

This comment has been minimized.

Copy link
Contributor Author

tcolgate commented Nov 30, 2016

One more thought.
Stripping __ would imply checking every label name on every scraped metric.
labeldrop/labelkeep would only be invoked if they are included in a set of relabelling rules.
The latter seems preferable.

@tcolgate

This comment has been minimized.

Copy link
Contributor Author

tcolgate commented Dec 13, 2016

Attempted in #2279

@tcolgate

This comment has been minimized.

Copy link
Contributor Author

tcolgate commented Dec 14, 2016

Closed by #2279

@tcolgate tcolgate closed this Dec 14, 2016

@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.