Skip to content

Conversation

@SungJin1212
Copy link
Member

@SungJin1212 SungJin1212 commented Oct 30, 2025

Add a per-tenant flag -distributor.enable-type-and-unit-labels which enables to add __unit__ and __type__ labels for remote write v2 and OTLP requests.

Which issue(s) this PR fixes:
Fixes #7059

Checklist

  • Tests updated
  • Documentation added
  • CHANGELOG.md updated - the order of entries should be [CHANGE], [FEATURE], [ENHANCEMENT], [BUGFIX]

@dosubot dosubot bot added the type/feature label Oct 30, 2025
@SungJin1212 SungJin1212 force-pushed the Add-type-and-unit-labels-to-prw2 branch from c14d273 to 5ab3a6a Compare October 30, 2025 06:06
# EXPERIMENTAL: If true, the __type__ and __unit__ labels are added to metrics.
# This only applies to remote write v2 requests.
# CLI flag: -distributor.rw2-enable-type-and-unit-labels
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need to mention rw2 in the config name? I would align the config name with Prometheus and callout that this feature is only for RW2 in the description.

Copy link
Member Author

Choose a reason for hiding this comment

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

Then this flag has same name with the -distributor.otlp.enable-type-and-unit-labels field. Doesn't it matter?

Copy link
Contributor

Choose a reason for hiding this comment

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

My concern is that users don't know what rw2 means. We should avoid using abbreviations in the config name. I think it should be ok to use 1 flag to control both. Maybe we can unify to be distributor.enable-type-and-unit-labels?

Copy link
Member Author

Choose a reason for hiding this comment

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

I add -distributor.enable-type-and-unit-labels flag which works for OTLP and PRW2. I think this PR should be included in version 1.20.

@SungJin1212 SungJin1212 force-pushed the Add-type-and-unit-labels-to-prw2 branch 4 times, most recently from 52703db to b19b5cf Compare November 4, 2025 08:41
@SungJin1212 SungJin1212 force-pushed the Add-type-and-unit-labels-to-prw2 branch 2 times, most recently from 28e61e7 to c860a65 Compare November 14, 2025 07:58
@yeya24
Copy link
Contributor

yeya24 commented Nov 17, 2025

I think one issue today for this feature is that type and unit labels are not correctly handled by thanos engine. They are handled only by promql engine. Maybe we need to call it out in the doc or the config description

@SungJin1212
Copy link
Member Author

@yeya24
thanks, I added descriptions to latest commit.

@SungJin1212 SungJin1212 force-pushed the Add-type-and-unit-labels-to-prw2 branch from 59fc644 to 6dfdc80 Compare November 17, 2025 11:02
@SungJin1212
Copy link
Member Author

@yeya24
The thanos-io/promql-engine#652 is just merged, I updated Thanos engine.

Signed-off-by: SungJin1212 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

PRW2: support type and unit labels

2 participants