Skip to content

feat(nh): mark native histograms as stable and keep optional#17232

Merged
krajorama merged 2 commits intomainfrom
krajo/nh-stable
Oct 24, 2025
Merged

feat(nh): mark native histograms as stable and keep optional#17232
krajorama merged 2 commits intomainfrom
krajo/nh-stable

Conversation

@krajorama
Copy link
Member

@krajorama krajorama commented Sep 26, 2025

Keep the feature optional but mark as stable, meaning that breaking changes are only allowed together with major version release of Prometheus.

Which issue(s) does the PR fix:

Related to: #16572

Does this PR introduce a user-facing change?

[FEATURE] Native histograms are now a stable, but optional feature. This means that breaking changes will require a major release bump.

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.

just some small comments, but non blocking

@roidelapluie
Copy link
Member

As far as I remember, this should be enabled with --scrape.native-histograms or another real cli variable.

Every feature behind --enable-feature is considered experimental.

Here is a list of features that are disabled by default since they are breaking changes or are considered experimental. Their behaviour can change in future releases which will be communicated via the release changelog.

https://prometheus.io/docs/prometheus/latest/feature_flags/

It also means that the documentatin needs to be moved as well.

@juliusv
Copy link
Member

juliusv commented Sep 29, 2025

@roidelapluie Good point, that's true!

@krajorama krajorama marked this pull request as draft September 29, 2025 16:59
@beorn7
Copy link
Member

beorn7 commented Sep 30, 2025

We have a new plan. Presumably, some things need adjustment here in this PR.

Maybe we should first implement the new scrape config option and then come back to this?

beorn7 added a commit that referenced this pull request Oct 9, 2025
The detailed plan for this is laid out in
#16572 .

This commit adds a global and local scrape config option
`scrape_native_histograms`, which has to be set to true to ingest
native histograms.

To ease the transition, the feature flag is changed to simply set the
default of `scrape_native_histograms` to true.

Further implications:

- The default scrape protocols now depend on the
  `scrape_native_histograms` setting.
- Everywhere else, histograms are now "on by default".

Documentation beyond the one for the feature flag and the scrape
config are deliberately left out. See
#17232 for that.

Signed-off-by: beorn7 <beorn@grafana.com>
beorn7 added a commit that referenced this pull request Oct 9, 2025
The detailed plan for this is laid out in
#16572 .

This commit adds a global and local scrape config option
`scrape_native_histograms`, which has to be set to true to ingest
native histograms.

To ease the transition, the feature flag is changed to simply set the
default of `scrape_native_histograms` to true.

Further implications:

- The default scrape protocols now depend on the
  `scrape_native_histograms` setting.
- Everywhere else, histograms are now "on by default".

Documentation beyond the one for the feature flag and the scrape
config are deliberately left out. See
#17232 for that.

Signed-off-by: beorn7 <beorn@grafana.com>
beorn7 added a commit that referenced this pull request Oct 9, 2025
The detailed plan for this is laid out in
#16572 .

This commit adds a global and local scrape config option
`scrape_native_histograms`, which has to be set to true to ingest
native histograms.

To ease the transition, the feature flag is changed to simply set the
default of `scrape_native_histograms` to true.

Further implications:

- The default scrape protocols now depend on the
  `scrape_native_histograms` setting.
- Everywhere else, histograms are now "on by default".

Documentation beyond the one for the feature flag and the scrape
config are deliberately left out. See
#17232 for that.

Signed-off-by: beorn7 <beorn@grafana.com>
beorn7 added a commit that referenced this pull request Oct 9, 2025
The detailed plan for this is laid out in
#16572 .

This commit adds a global and local scrape config option
`scrape_native_histograms`, which has to be set to true to ingest
native histograms.

To ease the transition, the feature flag is changed to simply set the
default of `scrape_native_histograms` to true.

Further implications:

- The default scrape protocols now depend on the
  `scrape_native_histograms` setting.
- Everywhere else, histograms are now "on by default".

Documentation beyond the one for the feature flag and the scrape
config are deliberately left out. See
#17232 for that.

Signed-off-by: beorn7 <beorn@grafana.com>
beorn7 added a commit that referenced this pull request Oct 9, 2025
The detailed plan for this is laid out in
#16572 .

This commit adds a global and local scrape config option
`scrape_native_histograms`, which has to be set to true to ingest
native histograms.

To ease the transition, the feature flag is changed to simply set the
default of `scrape_native_histograms` to true.

Further implications:

- The default scrape protocols now depend on the
  `scrape_native_histograms` setting.
- Everywhere else, histograms are now "on by default".

Documentation beyond the one for the feature flag and the scrape
config are deliberately left out. See
#17232 for that.

Signed-off-by: beorn7 <beorn@grafana.com>
beorn7 added a commit that referenced this pull request Oct 9, 2025
The detailed plan for this is laid out in
#16572 .

This commit adds a global and local scrape config option
`scrape_native_histograms`, which has to be set to true to ingest
native histograms.

To ease the transition, the feature flag is changed to simply set the
default of `scrape_native_histograms` to true.

Further implications:

- The default scrape protocols now depend on the
  `scrape_native_histograms` setting.
- Everywhere else, histograms are now "on by default".

Documentation beyond the one for the feature flag and the scrape
config are deliberately left out. See
#17232 for that.

Signed-off-by: beorn7 <beorn@grafana.com>
beorn7 added a commit that referenced this pull request Oct 12, 2025
The detailed plan for this is laid out in
#16572 .

This commit adds a global and local scrape config option
`scrape_native_histograms`, which has to be set to true to ingest
native histograms.

To ease the transition, the feature flag is changed to simply set the
default of `scrape_native_histograms` to true.

Further implications:

- The default scrape protocols now depend on the
  `scrape_native_histograms` setting.
- Everywhere else, histograms are now "on by default".

Documentation beyond the one for the feature flag and the scrape
config are deliberately left out. See
#17232 for that.

Signed-off-by: beorn7 <beorn@grafana.com>
beorn7 added a commit that referenced this pull request Oct 12, 2025
The detailed plan for this is laid out in
#16572 .

This commit adds a global and local scrape config option
`scrape_native_histograms`, which has to be set to true to ingest
native histograms.

To ease the transition, the feature flag is changed to simply set the
default of `scrape_native_histograms` to true.

Further implications:

- The default scrape protocols now depend on the
  `scrape_native_histograms` setting.
- Everywhere else, histograms are now "on by default".

Documentation beyond the one for the feature flag and the scrape
config are deliberately left out. See
#17232 for that.

Signed-off-by: beorn7 <beorn@grafana.com>
beorn7 added a commit that referenced this pull request Oct 13, 2025
The detailed plan for this is laid out in
#16572 .

This commit adds a global and local scrape config option
`scrape_native_histograms`, which has to be set to true to ingest
native histograms.

To ease the transition, the feature flag is changed to simply set the
default of `scrape_native_histograms` to true.

Further implications:

- The default scrape protocols now depend on the
  `scrape_native_histograms` setting.
- Everywhere else, histograms are now "on by default".

Documentation beyond the one for the feature flag and the scrape
config are deliberately left out. See
#17232 for that.

Signed-off-by: beorn7 <beorn@grafana.com>
beorn7 added a commit that referenced this pull request Oct 14, 2025
The detailed plan for this is laid out in
#16572 .

This commit adds a global and local scrape config option
`scrape_native_histograms`, which has to be set to true to ingest
native histograms.

To ease the transition, the feature flag is changed to simply set the
default of `scrape_native_histograms` to true.

Further implications:

- The default scrape protocols now depend on the
  `scrape_native_histograms` setting.
- Everywhere else, histograms are now "on by default".

Documentation beyond the one for the feature flag and the scrape
config are deliberately left out. See
#17232 for that.

Signed-off-by: beorn7 <beorn@grafana.com>
beorn7 added a commit that referenced this pull request Oct 14, 2025
The detailed plan for this is laid out in
#16572 .

This commit adds a global and local scrape config option
`scrape_native_histograms`, which has to be set to true to ingest
native histograms.

To ease the transition, the feature flag is changed to simply set the
default of `scrape_native_histograms` to true.

Further implications:

- The default scrape protocols now depend on the
  `scrape_native_histograms` setting.
- Everywhere else, histograms are now "on by default".

Documentation beyond the one for the feature flag and the scrape
config are deliberately left out. See
#17232 for that.

Signed-off-by: beorn7 <beorn@grafana.com>
beorn7 added a commit that referenced this pull request Oct 14, 2025
The detailed plan for this is laid out in
#16572 .

This commit adds a global and local scrape config option
`scrape_native_histograms`, which has to be set to true to ingest
native histograms.

To ease the transition, the feature flag is changed to simply set the
default of `scrape_native_histograms` to true.

Further implications:

- The default scrape protocols now depend on the
  `scrape_native_histograms` setting.
- Everywhere else, histograms are now "on by default".

Documentation beyond the one for the feature flag and the scrape
config are deliberately left out. See
#17232 for that.

Signed-off-by: beorn7 <beorn@grafana.com>
beorn7 added a commit that referenced this pull request Oct 15, 2025
The detailed plan for this is laid out in
#16572 .

This commit adds a global and local scrape config option
`scrape_native_histograms`, which has to be set to true to ingest
native histograms.

To ease the transition, the feature flag is changed to simply set the
default of `scrape_native_histograms` to true.

Further implications:

- The default scrape protocols now depend on the
  `scrape_native_histograms` setting.
- Everywhere else, histograms are now "on by default".

Documentation beyond the one for the feature flag and the scrape
config are deliberately left out. See
#17232 for that.

Signed-off-by: beorn7 <beorn@grafana.com>
beorn7 added a commit that referenced this pull request Oct 15, 2025
The detailed plan for this is laid out in
#16572 .

This commit adds a global and local scrape config option
`scrape_native_histograms`, which has to be set to true to ingest
native histograms.

To ease the transition, the feature flag is changed to simply set the
default of `scrape_native_histograms` to true.

Further implications:

- The default scrape protocols now depend on the
  `scrape_native_histograms` setting.
- Everywhere else, histograms are now "on by default".

Documentation beyond the one for the feature flag and the scrape
config are deliberately left out. See
#17232 for that.

Signed-off-by: beorn7 <beorn@grafana.com>
@krajorama krajorama force-pushed the krajo/nh-stable branch 2 times, most recently from 837cf8c to 6ee7265 Compare October 16, 2025 07:28
@krajorama krajorama marked this pull request as ready for review October 16, 2025 07:28
@beorn7
Copy link
Member

beorn7 commented Oct 16, 2025

Note: Updated the release notes line to be shorter and "more correct".

@beorn7
Copy link
Member

beorn7 commented Oct 16, 2025

Not sure if needed, but the migration.md file says "If you use the --enable-feature=native-histograms feature flag...". If somebody migrates from v2 to v3 now, we should probably tell them "If you have set scrape_native_histograms: true in your scrape config..."

Maybe we mention both: "If you have set scrape_native_histograms: true in your scrape config or you use the --enable-feature=native-histograms feature flag..."

@beorn7
Copy link
Member

beorn7 commented Oct 18, 2025

Not sure if needed, but the migration.md file says "If you use the --enable-feature=native-histograms feature flag...". If somebody migrates from v2 to v3 now, we should probably tell them "If you have set scrape_native_histograms: true in your scrape config..."

Maybe we mention both: "If you have set scrape_native_histograms: true in your scrape config or you use the --enable-feature=native-histograms feature flag..."

Do you want to keep migration.md as is or adopt my suggestion? (I'm fine if you want to keep it as is, but I would like to make sure you have seen my comment.)

@krajorama
Copy link
Member Author

Not sure if needed, but the migration.md file says "If you use the --enable-feature=native-histograms feature flag...". If somebody migrates from v2 to v3 now, we should probably tell them "If you have set scrape_native_histograms: true in your scrape config..."
Maybe we mention both: "If you have set scrape_native_histograms: true in your scrape config or you use the --enable-feature=native-histograms feature flag..."

Do you want to keep migration.md as is or adopt my suggestion? (I'm fine if you want to keep it as is, but I would like to make sure you have seen my comment.)

Not sure. Technically we should mention that from 3.8 the feature flag is deprecated. But do we really have to keep updating this doc?

@beorn7
Copy link
Member

beorn7 commented Oct 20, 2025

Not sure if needed, but the migration.md file says "If you use the --enable-feature=native-histograms feature flag...". If somebody migrates from v2 to v3 now, we should probably tell them "If you have set scrape_native_histograms: true in your scrape config..."
Maybe we mention both: "If you have set scrape_native_histograms: true in your scrape config or you use the --enable-feature=native-histograms feature flag..."

Do you want to keep migration.md as is or adopt my suggestion? (I'm fine if you want to keep it as is, but I would like to make sure you have seen my comment.)

Not sure. Technically we should mention that from 3.8 the feature flag is deprecated. But do we really have to keep updating this doc?

Not forever, of course, but this is an easy update, and I assume that there are still a bunch of users who migrate from v2 to v3 these days, probably even when v3.9 is out, and we save them a lot of confusion by adding this.

Copy link
Member

@beorn7 beorn7 left a comment

Choose a reason for hiding this comment

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

Just a few things left.

@krajorama
Copy link
Member Author

Not sure if needed, but the migration.md file says "If you use the --enable-feature=native-histograms feature flag...". If somebody migrates from v2 to v3 now, we should probably tell them "If you have set scrape_native_histograms: true in your scrape config..."
Maybe we mention both: "If you have set scrape_native_histograms: true in your scrape config or you use the --enable-feature=native-histograms feature flag..."

Do you want to keep migration.md as is or adopt my suggestion? (I'm fine if you want to keep it as is, but I would like to make sure you have seen my comment.)

Not sure. Technically we should mention that from 3.8 the feature flag is deprecated. But do we really have to keep updating this doc?

Not forever, of course, but this is an easy update, and I assume that there are still a bunch of users who migrate from v2 to v3 these days, probably even when v3.9 is out, and we save them a lot of confusion by adding this.

I've made an update , but not here, rather at the feature flags section, ptal

Copy link
Member

@beorn7 beorn7 left a comment

Choose a reason for hiding this comment

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

Only the location of the gauge vs counter histograms left.

krajorama and others added 2 commits October 24, 2025 12:31
Fixes: #16572

Mark as stable means that breaking changes are only allowed together with
major version release of Prometheus.

Co-authored-by: Björn Rabenstein <beorn@grafana.com>
Signed-off-by: George Krajcsovits <krajorama@users.noreply.github.com>
Signed-off-by: György Krajcsovits <gyorgy.krajcsovits@grafana.com>
Plus some docstrings

Signed-off-by: György Krajcsovits <gyorgy.krajcsovits@grafana.com>
@krajorama krajorama enabled auto-merge October 24, 2025 10:34
@krajorama krajorama merged commit d237230 into main Oct 24, 2025
46 checks passed
@krajorama krajorama deleted the krajo/nh-stable branch October 24, 2025 10:49
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.

5 participants