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

Treat empty labels like unset labels #494

Closed
juliusv opened this Issue Jan 30, 2015 · 8 comments

Comments

Projects
None yet
4 participants
@juliusv
Copy link
Member

juliusv commented Jan 30, 2015

{x=""} should return any time series which don't have the x label set, as well as series where it's empty. Optionally, we may also decide to drop empty labels completely upon ingestion. This makes it possible to find time series that don't have certain labels set at all (useful in rare cases for finding certain metrics), but also is more consistent with the syntax for unsetting labels on the left-hand-side in recording rules (by setting a label to empty, it is unset).

@fabxc

This comment has been minimized.

Copy link
Member

fabxc commented Feb 26, 2015

Probably {} should be a valid query in that case. Otherwise hackish stuff like {_=""} is introduced to retrieve all time series.

@brian-brazil

This comment has been minimized.

Copy link
Member

brian-brazil commented Feb 26, 2015

I'd overall prefer a hackish stuff to retrieve all time series. It's an advanced use case, and a great way to take out a prometheus server.

{} is a bit easy to type by mistake.

@fabxc

This comment has been minimized.

Copy link
Member

fabxc commented Feb 26, 2015

Mh, at least have a label name that is guaranteed to be always unset? Probably the case for _ anyway but it should be explicitly agreed on.

@brian-brazil

This comment has been minimized.

Copy link
Member

brian-brazil commented Feb 26, 2015

{job~=".*"} will do it.

@fabxc

This comment has been minimized.

Copy link
Member

fabxc commented Feb 26, 2015

Sure, under the whole "only if you know what you are doing assumption" this seems fair as well.

I would give this one a go. As far as I can see one needs to check all archived and in-memory series? Or did I overlook a better way?
I don't have enough background knowledge to judge the performance impact of this. It would iterate over the whole archivedFingerprintToMetrics index once.

@beorn7

This comment has been minimized.

Copy link
Member

beorn7 commented Jun 12, 2015

Recent discussions: Match for unset labels will be very slow to process in a query. Not sure how much effort we should invest into making it faster.

But even if we do not allow the querying for unset labels, we should finally implement throwing away labels with empty values before storing and indexing them (but after the whole relabeling shebang that happens during scraping, so that empty label values can be used to prevent auto-attaching labels).

@fabxc

This comment has been minimized.

Copy link
Member

fabxc commented Jun 23, 2015

Closed via #810 with the limitation of requiring one or more matchers not matching the empty string.

@fabxc fabxc closed this Jun 23, 2015

simonpasquier pushed a commit to simonpasquier/prometheus that referenced this issue Oct 12, 2017

Merge pull request prometheus#494 from prometheus/master
Update next-release branch to master.
@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.