PromQL engine: Support automatic inclusion of info metric data labels.#14634
PromQL engine: Support automatic inclusion of info metric data labels.#14634aknuds1 wants to merge 5 commits intoprometheus:mainfrom
Conversation
f479a2f to
8df48e6
Compare
2a2ff53 to
f757fa8
Compare
|
I think as a PoC, this is interesting. It would be interested to feed this to a test audience to see how this flies. However, I have concerns if this should ever be generally accessible, even behind a feature flag. In general, introducing a whole new configuration section on the PromQL level rubs me the wrong way. Feature flags are already putting conditions to how a given PromQL query is executed, but at least those are fairly simple binary decisions. This config is quite complex and deep, and it will essentially change how PromQL works in a fairly invasive fashion. For exploring a feature, that's fine. But I don't want to live in a world where people look at a PromQL expression, and the next question they ask is if they could see the PromQL engine config used to evaluate the expression. I'm ~fine with configuring scrapes so that info metrics can be described there. That's just changing the input data on ingestion. (But of course, for that to work, we need to implement storing this information in the TSDB, and that's a much bigger barrier.) |
|
Nice! I like the discussion as well. 2c:
|
I think it's a reasonable thing to say "the outcome of your PromQL expression depends mostly on what's in your TSDB". That's why I think if there is ingestion config that changes the date ultimately stored in the TSDB, that's nothing new and expected. Adding an additional config is a different thing. (Feature flags are already like that, but they are simple and inherently meant for experimental things.) |
Yeah, I am also in the "explicit is better than implicit" camp. I imagine the desire for "auto-adding" labels from info metrics comes from one problem with the "map all the labels on ingestion" approach: With the latter, you cannot change your mind later. If you realize you want to map more labels, you cannot easily apply that retroactively to historic data. But you can always change the query-time config and use it to query historic data. |
690a113 to
7756b14
Compare
7756b14 to
61ea790
Compare
578cdc1 to
0c04eb6
Compare
|
I share Beorn's and Bartek's concern here, I don't think a query language should give different results depending on configuration. I believe the main use-case for the info() function is to unblock folks coming from OpenTelemetry background and it's already set in stone that their info metric is I understand that this would unblock with other info metrics, mostly coming from kube-state-metrics, but I'd love to see this being solved with an approach that doesn't require query language configuration. Bonus points if we don't even need the info() metric at all, e.g. storing info as metadata and make metadata part of query results 😬 |
8f0ee42 to
2602d4c
Compare
@beorn7 The second problem that arises is that when changing which OTel resource attributes to promote to labels, you also have a temporary doubling in series (i.e. old label set + new label set). |
@ArthurSens actually, the point of this approach is rather the different UX of not having to call |
I think that's the core of what we are discussing here. Some users want to "automatically" change the result of their queries without actually changing the queries. This rubs some of us the wrong way, because now we make the outcome of a query depend on some external setting. I think it is fine to "preprocess" the query in a wrapper, separate from core Prometheus. I assume the kind of users requiring "change the result of my query without changing the query" will work through some kind of UI that could do that for them. To solve this within PromQL, maybe it could be piggybacked into the vaguely planned |
Thanks @beorn7! I had never heard of |
|
It is very vaguely planned. Hidden in a dev summit note from ages ago… |
This MVP of info simplifies the implementation by assuming: * Only support for the target_info metric * That target_info's identifying labels are job and instance Signed-off-by: Arve Knudsen <[email protected]>
Signed-off-by: Arve Knudsen <[email protected]>
Co-authored-by: Augustin Husson <[email protected]> Signed-off-by: Arve Knudsen <[email protected]>
This MVP of info simplifies the implementation by assuming: * Only support for the target_info metric * That target_info's identifying labels are job and instance Signed-off-by: Arve Knudsen <[email protected]>
Signed-off-by: Arve Knudsen <[email protected]>
2602d4c to
b49ad6d
Compare
|
Closing PR, as it's not what the team would like to proceed with :) |
Make the PromQL engine, when configured to do so, automatically include info metric data labels when expanding time series. This is intended as experimental functionality, although I haven't yet marked it as such (the PR is WIP after all).
See proposal Simplify joins with info metrics in PromQL for background. The automation in this PR should form the basis of the proposed
infofunction, just with configurability to execute without explicit function calls in queries. I don't know for sure if this will be desirable UX in the end, but at least it's helpful during development.This is especially useful for OpenTelemetry, since it enables automatically adding back (select) OTel resource attributes (encoded as
target_infometric labels) to metrics (cheaper than promoting them to labels at ingestion time).BenchmarkInfoFunctionshows great performance gains vs. traditional join queries against info metrics (due to only fetching info metrics with matching join labels mostly):TODO:
rate