Skip to content

storage-prw: send Unit and Type when feature flag is enabled#17033

Merged
bwplotka merged 24 commits intoprometheus:mainfrom
perebaj:chore/send-unit-type-when-feature-flag-enabled
Aug 29, 2025
Merged

storage-prw: send Unit and Type when feature flag is enabled#17033
bwplotka merged 24 commits intoprometheus:mainfrom
perebaj:chore/send-unit-type-when-feature-flag-enabled

Conversation

@perebaj
Copy link
Copy Markdown
Contributor

@perebaj perebaj commented Aug 10, 2025

According to this thread we would like to send type and unit data to be accessed on the PRW2. This will unlock some issues that we are facing on the OTEL side. This because some metrics can be sent without type even if the feature flag is set, causing errors in the parsing process.

Related issue on otel-collector-contrib -> open-telemetry/opentelemetry-collector-contrib#41840 (comment)

Which issue(s) does the PR fix:

Partially fixes: #16610.

Does this PR introduce a user-facing change?

NONE

@ChetanFTW
Copy link
Copy Markdown

Hey @perebaj, I think you forget to sign off your commit DCO Failed !! In checks

@perebaj
Copy link
Copy Markdown
Contributor Author

perebaj commented Aug 12, 2025

Hey @perebaj, I think you forget to sign off your commit DCO Failed !! In checks

Thanks. I will take a look.

Copy link
Copy Markdown
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.

Looks like you're in a good direction, besides the test 😛

Also, probably a good idea to build prometheus (make build), start it and test sending data to the prometheusremotewrite receiver to see if things work as you expect

@perebaj perebaj force-pushed the chore/send-unit-type-when-feature-flag-enabled branch from 5ee4585 to 87af644 Compare August 18, 2025 00:40
@perebaj perebaj changed the title chore: send Unit and Type when feature flag is enabled storage-prw: send Unit and Type when feature flag is enabled Aug 21, 2025
@perebaj perebaj marked this pull request as ready for review August 21, 2025 02:10
Copy link
Copy Markdown
Member

@bwplotka bwplotka left a comment

Choose a reason for hiding this comment

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

Amazing work, I kind of need this now, so would love to have it merged 🤗

Generally looks ok, just some questions around config field and some flows.

Relates to #16610

@perebaj perebaj force-pushed the chore/send-unit-type-when-feature-flag-enabled branch from 8deaa9a to 4273b78 Compare August 22, 2025 13:09
@bwplotka
Copy link
Copy Markdown
Member

Can you rebase/squash commits to only relevant ones?

@perebaj perebaj force-pushed the chore/send-unit-type-when-feature-flag-enabled branch from 417ad72 to 27b045c Compare August 22, 2025 14:06
Signed-off-by: perebaj <[email protected]>
Signed-off-by: perebaj <[email protected]>
Signed-off-by: perebaj <[email protected]>
Signed-off-by: perebaj <[email protected]>
@perebaj perebaj requested review from ArthurSens and bwplotka August 28, 2025 02:44
Signed-off-by: perebaj <[email protected]>
Copy link
Copy Markdown
Member

@bwplotka bwplotka left a comment

Choose a reason for hiding this comment

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

Thanks for iterating this!

There are bunch of nits to make it perfect, but otherwise LGTM!

Copy link
Copy Markdown
Member

@bwplotka bwplotka left a comment

Choose a reason for hiding this comment

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

Amazing! Thanks for prompt work on this 💪🏽

@bwplotka bwplotka enabled auto-merge (squash) August 29, 2025 03:52
@bwplotka bwplotka merged commit c808a71 into prometheus:main Aug 29, 2025
28 checks passed
bwplotka added a commit that referenced this pull request Aug 29, 2025
bwplotka added a commit that referenced this pull request Aug 29, 2025
siavashs pushed a commit to siavashs/prometheus that referenced this pull request Aug 29, 2025
…ed (prometheus#17033)

* chore: send Unit and Type when feature flag is enabled

Signed-off-by: perebaj <[email protected]>

* remove unused code and comments

Signed-off-by: perebaj <[email protected]>

* remove unreal scenario

Signed-off-by: perebaj <[email protected]>

* remove unused if

Signed-off-by: perebaj <[email protected]>

* remove unused labels

Signed-off-by: perebaj <[email protected]>

* linter

Signed-off-by: perebaj <[email protected]>

* enable type and unit through remotewrite config

Signed-off-by: perebaj <[email protected]>

* remove test comment and capture type and unit when flag is enabled

Signed-off-by: perebaj <[email protected]>

* gofumpt

Signed-off-by: perebaj <[email protected]>

* modelTypeToWriteV2Type

Signed-off-by: perebaj <[email protected]>

* use NewMetadataFromLabels

Signed-off-by: perebaj <[email protected]>

* capture feature flag from main

Signed-off-by: perebaj <[email protected]>

* simplifying logic

Signed-off-by: perebaj <[email protected]>

* remove unused function

Signed-off-by: perebaj <[email protected]>

* formatting code

Signed-off-by: perebaj <[email protected]>

* gofumpt

Signed-off-by: perebaj <[email protected]>

* remove public var: EnableTypeAndUnitLabels

Signed-off-by: perebaj <[email protected]>

* remove enableTypeAndUnitLabels from TestPopulateV2TimeSeries_typeAndUnitLabels

Signed-off-by: perebaj <[email protected]>

* remove enableTypeAndUnitLabels from main

Signed-off-by: perebaj <[email protected]>

* use schema helper to populate metadata

Signed-off-by: perebaj <[email protected]>

* remove metadata since nil is the default value

Signed-off-by: perebaj <[email protected]>

* add TestPopulateV2TimeSeries_UnexpectedMetadata

Signed-off-by: perebaj <[email protected]>

* Update storage/remote/queue_manager_test.go

Signed-off-by: Bartlomiej Plotka <[email protected]>

---------

Signed-off-by: perebaj <[email protected]>
Signed-off-by: Bartlomiej Plotka <[email protected]>
Co-authored-by: Bartlomiej Plotka <[email protected]>
siavashs pushed a commit to siavashs/prometheus that referenced this pull request Aug 29, 2025
siavashs pushed a commit to siavashs/prometheus that referenced this pull request Aug 29, 2025
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.

[meta] PROM-39 type-and-unit-labels stability

4 participants