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

Drop the metric name after any transformation #380

Closed
juliusv opened this issue Feb 26, 2014 · 6 comments
Closed

Drop the metric name after any transformation #380

juliusv opened this issue Feb 26, 2014 · 6 comments

Comments

@juliusv
Copy link
Member

juliusv commented Feb 26, 2014

Prometheus has no way of telling whether the original name of a metric is still semantically correct after applying any kind of transformation to it, so the metric name should be dropped in that case.

This requires some refactoring, as we currently don't deal well with metrics without a name everywhere (in one place, we even panic).

@juliusv
Copy link
Member Author

juliusv commented Sep 28, 2014

@brian-brazil I'd like to get your opinion on this: I'm actually working on a change which tries to be clever about assigning automatic new metric names after transformations, when possible. Some examples:

sum(http_request_duration_microseconds) by (job, instance)`
  =>
`job_instance:http_request_duration_microseconds:sum{instance="http://localhost:9090/metrics",job="prometheus"}`

// What about this case? You said using only one colon in a name is ugly.
// Would we want to invent some "global" aggregation level name if no by-clause is given?
sum(http_request_duration_microseconds)
  =>
http_request_duration_microseconds:sum{}

// Not implemented yet, but possible. Same problem about having only one colon:
rate(http_request_duration_microseconds[5m])
  =>
http_request_duration_microseconds:rate5m{...}

// Any binops still end up erasing the metric name, as they probably change the original meaning.
http_request_duration_microseconds / 10
  =>
{}

If the corner-cases and combinations of multiple aggregations end up generating too ugly metric names, we can still decide for just always dropping the metric names after any transformations. Just wanted to throw this idea out there.

@juliusv
Copy link
Member Author

juliusv commented Sep 28, 2014

/cc @u-c-l

@brian-brazil
Copy link
Contributor

I think this may be workable, and avoid a lot of problems if we can pull it off. I suspect there's too many edge cases though.

For example the purpose of the level: prefix is so you can tell what labels are on a variable, a form of Hungarian notation that makes it obvious if you've messed up your label modifiers. That doesn't work when a label being empty is the same as it not existing, and I don't think it's practical to add in the strong typing needed to make it work.

@juliusv
Copy link
Member Author

juliusv commented Oct 20, 2014

For now, this is solved by completely dropping the metric name in f3e9f6b. This has yet to be merged into master after merging the exp/storage-ng branch. Keeping this issue open until then to not lose track of this.

@beorn7
Copy link
Member

beorn7 commented Nov 26, 2014

Merged. I'm going to close this. Please reopen if needed.

@beorn7 beorn7 closed this as completed Nov 26, 2014
simonpasquier pushed a commit to simonpasquier/prometheus that referenced this issue Oct 12, 2017
add notice for default behavior of using 3GB RAM
@lock
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.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants