Skip to content

Conversation

bwplotka
Copy link
Member

@bwplotka bwplotka commented Mar 18, 2025

Implementation of prometheus/proposals#39

Previous (unmerged) experiments:

TODO:

  • fix lints/tests
  • More tests (especially on promql path)

Not in this PR, but in the same feature flag we should:

  • Add tests for relabelling
  • When a query for a metric returns multiple metrics with a different type or unit label, but the same name, the query returns an info annotation, which is surfaced to the user in the UI.
  • fix "detectFamilySwitch" issue

@bwplotka bwplotka force-pushed the type-and-unit-labels branch from 4858450 to e50a616 Compare March 18, 2025 12:51
@bwplotka bwplotka requested review from ywwg and ArthurSens March 18, 2025 12:52
@bwplotka bwplotka force-pushed the type-and-unit-labels branch 2 times, most recently from d352464 to 0a274f5 Compare March 18, 2025 13:10
bwplotka added a commit to prometheus/proposals that referenced this pull request Mar 18, 2025
PR with the implementation is also available: prometheus/prometheus#16228

Signed-off-by: bwplotka <bwplotka@gmail.com>
@bwplotka bwplotka force-pushed the type-and-unit-labels branch from 0a274f5 to 87f94b0 Compare March 18, 2025 13:45
@bwplotka bwplotka force-pushed the type-and-unit-labels branch 3 times, most recently from 7417d2c to 69ccac6 Compare March 18, 2025 17:20
Copy link
Member

@ArthurSens ArthurSens left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not in this PR, but in the same feature flag we should:

  • Update UI as proposed in the proposal

Just to clarify what you mean here. Do you want this PR to hide type and unit labels, and the following PR will have that checkbox to show them? Or do you want to leave hiding type and unit to the following PR as well?

I'm asking because while testing, I noticed that those labels are present during query-time
image

@bwplotka
Copy link
Member Author

bwplotka commented Apr 1, 2025

Will adress all comments after KubeCon! Thanks for reviewing!

@bwplotka
Copy link
Member Author

Thanks for the epic reviews @ArthurSens @ywwg !

I am progressing on the rebase and update, currently cannot decide on naming of that internal group of metadata/metric family/metric descriptor/metric desc, will play around those... 🙈

@ArthurSens

Just to clarify what you mean here. Do you want this PR to hide type and unit labels, and the following PR will have that checkbox to show them? Or do you want to leave hiding type and unit to the following PR as well?
I'm asking because while testing, I noticed that those labels are present during query-time

As in our updated proposal I propose to not change UI for now, so we can talk about this later. Personally I think UI option for hiding those is nice, but majority of ecosystem will have those labels "exposed" anyway, so it's not a helping a lot, thus not a blocker/game changer.

@bwplotka
Copy link
Member Author

bwplotka commented May 6, 2025

Thanks for helping @ArthurSens -- what's next for this? I believe we need to add some test cases for proto and OM parsing and what we expect from the storage (if we don't have this already).

Then also that PromQL engine warning

I ended up with "MetricDescriptor" for the internal structure -- might be good enough.

@ArthurSens
Copy link
Member

Thanks for helping @ArthurSens -- what's next for this? I believe we need to add some test cases for proto and OM parsing and what we expect from the storage (if we don't have this already).

Sounds good, I want to find time to work on this during this week or during the next one at max

Then also that PromQL engine warning

I was talking with @carrieedwards, and she volunteered to tackle this part since PromQL Engine is completely alien to me 😭. She is busy for a while though; she is presenting at GrafanaCon this week and will be at an offsite in the following week. Could you confirm, Carrie?

I ended up with "MetricDescriptor" for the internal structure -- might be good enough.

Looks good to me :)

@bwplotka bwplotka changed the title feature: type-and-unit-labels (extended MetricIdentity) feature: type-and-unit-labels May 9, 2025
@bwplotka bwplotka changed the title feature: type-and-unit-labels feature: type-and-unit-labels (PROM-39 implementation) May 9, 2025
@carrieedwards
Copy link
Contributor

I was talking with @carrieedwards, and she volunteered to tackle this part since PromQL Engine is completely alien to me 😭. She is busy for a while though; she is presenting at GrafanaCon this week and will be at an offsite in the following week. Could you confirm, Carrie?

Yes, I will take a look at this next week or the week after!

@bwplotka
Copy link
Member Author

Cool, amazing!

I will try to progress in the meantime. I decided to refactor the weird "MetricDescriptor" into schema.Metadata -- might be more clear. I will add test cases and I propose we tackle PromQL engine warning on mixed units/types in separate PR (:

@bwplotka bwplotka force-pushed the type-and-unit-labels branch 3 times, most recently from 009c8d9 to 73100ba Compare May 12, 2025 11:18
bwplotka added 8 commits May 16, 2025 09:50
Signed-off-by: bwplotka <bwplotka@gmail.com>
Signed-off-by: bwplotka <bwplotka@gmail.com>
Signed-off-by: bwplotka <bwplotka@gmail.com>
Signed-off-by: bwplotka <bwplotka@gmail.com>
Signed-off-by: bwplotka <bwplotka@gmail.com>
Signed-off-by: bwplotka <bwplotka@gmail.com>
Signed-off-by: bwplotka <bwplotka@gmail.com>
Signed-off-by: bwplotka <bwplotka@gmail.com>
@bwplotka bwplotka force-pushed the type-and-unit-labels branch from 7cad4e1 to 5e91463 Compare May 16, 2025 08:51
Signed-off-by: bwplotka <bwplotka@gmail.com>
@bwplotka bwplotka force-pushed the type-and-unit-labels branch from d6d166b to a86b297 Compare May 16, 2025 12:32
Copy link
Member

@ArthurSens ArthurSens left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have two nits, but LGTM!

Signed-off-by: bwplotka <bwplotka@gmail.com>
@bwplotka bwplotka enabled auto-merge (squash) May 17, 2025 09:30
@bwplotka bwplotka merged commit 8e6b008 into main May 17, 2025
44 checks passed
@bwplotka bwplotka deleted the type-and-unit-labels branch May 17, 2025 09:37
charleskorn added a commit to grafana/mimir that referenced this pull request May 27, 2025
charleskorn added a commit to grafana/mimir that referenced this pull request Jun 2, 2025
* Update mimir-prometheus

* Replace references to `InstanceName` removed in prometheus/prometheus#16228

* Fix native histogram mangling behaviour to be compatible with prometheus/prometheus#16565

* Make build tags consistent with Prometheus

* Update MQE tests to match upstream

* Reinstate test cases that were skipped due to upstream issues

* Bring in changes from grafana/mimir-prometheus#880

* Add changelog entries

* Regenerate OTLP files

* Fix breaking change

* Update upstream tests
roidelapluie pushed a commit to roidelapluie/proposals that referenced this pull request Jun 10, 2025
PR with the implementation is also available: prometheus/prometheus#16228

Signed-off-by: bwplotka <bwplotka@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants