PROM-39: Provide PromQL info annotations when series with the same name have mismatched type or unit#16841
PROM-39: Provide PromQL info annotations when series with the same name have mismatched type or unit#16841carrieedwards wants to merge 5 commits intomainfrom
Conversation
Signed-off-by: Carrie Edwards <[email protected]>
b4e2329 to
6797162
Compare
storage/annotating_storage.go
Outdated
| // AnnotatingStorage wraps given storage and tracks type and unit | ||
| // labels across series. It will produce an info annotation if there | ||
| // is a mismatch between type or unit in series with the same name. | ||
| func AnnotatingStorage(s Storage) Storage { |
There was a problem hiding this comment.
Hm, why generic name ("annotating"?); Would more specific name be a bit better e.g. the exact semantics for annotations (SchemaMismatchStorage or MismatchStorage TypeAndUnitMismatchStorage)?
storage/annotating_storage.go
Outdated
| mType := series.Labels().Get("__type__") | ||
| mUnit := series.Labels().Get("__unit__") | ||
|
|
||
| if prev, ok := s.seen[metric]; ok { |
There was a problem hiding this comment.
Do we need to maintain a full map here? I was thinking that for the single seriesSet coming from storage for a single Select, we really only expect a single type and unit, so just prevType and prevUnit would suffice. What are the cases where it's not true? 🤔
bwplotka
left a comment
There was a problem hiding this comment.
Looks great, I like the place we inject this functionality! Some initial questions, otherwise looks nice!
Signed-off-by: Carrie Edwards <[email protected]>
Signed-off-by: Carrie Edwards <[email protected]>
Signed-off-by: Carrie Edwards <[email protected]>
Signed-off-by: Carrie Edwards <[email protected]>
|
Stumbled upon this during bug scrub. This has been sitting for a while. What's the plan here? |
|
Hello from the bug scrub! Same question as before, what is the status of this work ? Sounds interesting. |
|
This was originally being done for the type and unit/delta work. If there's interest, I can look back into it |
This PR adds a wrapper around storage.Storage in order to track the type and unit of series with the same name, and return an info annotation when the type and/or unit mismatch.
Part of #16610. Addresses #16641.