Skip to content

Conversation

prymitive
Copy link
Contributor

This removes the stringlabels build tag, makes that implementation the default one, and moves the old labels implementation under the slicelabels build tag. Fixes #16064.

This removes the stringlabels build tag, makes that implementation the default one, and moves the old labels implementation under the slicelabels build tag.
Fixes prometheus#16064.

Signed-off-by: Lukasz Mierzwa <l.mierzwa@gmail.com>
Mostly comment issues and unused variables.

Signed-off-by: Lukasz Mierzwa <l.mierzwa@gmail.com>
Signed-off-by: Lukasz Mierzwa <l.mierzwa@gmail.com>
Copy link
Member

@machine424 machine424 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 this, lgtm.
I assume test_go_oldest was inadvertedly ran with slice labels, I think it's better to have it run with default stringlabels as it's the case now.

same for others like GOARCH=386 go test ./...

@roidelapluie roidelapluie requested a review from bboreham April 24, 2025 07:17
@aknuds1 aknuds1 requested a review from Copilot April 25, 2025 07:30
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR makes the stringlabels implementation the default by removing the stringlabels build tag and shifts the old implementation under the slicelabels build tag, fixing #16064. Key changes include updating test functions to reflect the new default label collision behavior, revising build tags in multiple label-related files, and adjusting CI configuration to remove the stringlabels flag.

Reviewed Changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.

File Description
tsdb/head_test.go Updates expected hash collision inputs for label tests.
tsdb/agent/series_test.go Mirrors head_test.go label collision adjustments for agent tests.
model/labels/*.go Revises build tags and updates comments to match new defaults.
.promu.yml and .github/workflows/ci.yml Removes stringlabels flag from build configurations and tests.
Comments suppressed due to low confidence (2)

tsdb/head_test.go:6289

  • [nitpick] There is a change in the label key from 'lbl1' in the fallback assignment to 'lbl' in the initial assignment. Please confirm that using 'lbl' initially and 'lbl1' later is intentional to differentiate behaviors between the default (slicelabels) and legacy implementations.
ls1 := labels.FromStrings("__name__", "metric", "lbl", "HFnEaGl")

tsdb/agent/series_test.go:80

  • [nitpick] The label key changes between the initial assignment and the fallback (using 'lbl1' and 'lbl2') may be confusing. Please verify that this inconsistency is expected as part of the change in default label handling.
ls1 := labels.FromStrings("__name__", "metric", "lbl", "HFnEaGl")

Copy link
Member

@bboreham bboreham left a comment

Choose a reason for hiding this comment

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

LGTM. We should take care to highlight the change in release notes etc., so downstream projects can react.

Copy link
Member

@jesusvazquez jesusvazquez left a comment

Choose a reason for hiding this comment

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

LGTM

Signed-off-by: Bryan Boreham <bjboreham@gmail.com>
@bboreham bboreham enabled auto-merge May 2, 2025 09:33
@bboreham bboreham merged commit 2e9ab9c into prometheus:main May 2, 2025
26 checks passed
charleskorn added a commit to grafana/mimir that referenced this pull request May 16, 2025
charleskorn added a commit to grafana/mimir that referenced this pull request May 16, 2025
charleskorn added a commit to grafana/mimir that referenced this pull request May 16, 2025
* Upgrade mimir-prometheus

* Fix breaking change in `NewAPI`

* Sync upstream PromQL engine test cases

* Modify `histogram_stddev` and `histogram_stdvar` to match new behaviour introduced in prometheus/prometheus#16444

* Simplify code

* Remove outdated comment

This issue was fixed in prometheus/prometheus#15828.

* Remove unnecessary variable

* Rename operator and files

* Extract `histogram_quantile`-specific logic

* Add support for classic histograms in `histogram_fraction`

See prometheus/prometheus#16095

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

* Invert build tag logic to match prometheus/prometheus#16436

* Sync query engine tests with upstream

* Fix breaking changes

* Regenerate OTLP code
@bboreham bboreham mentioned this pull request Jul 17, 2025
32 tasks
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.

Use the stringlabels build tag by default
4 participants