Phase out native histogram feature flag, add scrape config option#17315
Phase out native histogram feature flag, add scrape config option#17315
Conversation
0ceecfd to
f4f0fc5
Compare
f4f0fc5 to
2e1b338
Compare
krajorama
left a comment
There was a problem hiding this comment.
I feel like the ground rules aren't clear here. Can we agree that explicitly setting something (either directly or indirectly) in the configuration file has precedence over the ? This is not stated explicitly in the docs , but I think so far we worked this way and maybe we should state it.
That would mean that if I use the created-timestamp-zero-ingestion feature flag it can only overwrite the scrape protocol if it is not set globally or in the local scrape config. And it doesn't matter if the scrape protocol is set directly or set by using the scrape_native_histograms parameter.
Hmm?
Is there a word missing? What did you want to write after the "the"? |
I don't think that logic makes sense. Most users should and will never touch So still assuming a user will not and does not want to touch
If I understand your idea above correctly, you would say However, the logic as implemented in this PR handles all four cases as needed. The problem is the asymmetry between the feature flag (which is one global setting) and the
So this IMHO fulfills all "intuitive" demands of the user:
|
2e1b338 to
6ebeb0f
Compare
|
As a general note to give us some relief: In v4, we should really give the |
437eec4 to
db9c71a
Compare
|
With the recent push:
Let's maybe meet tomorrow and discuss the details in person based on this version. |
Applied the analyzer "modernize" to the test files. $ go run golang.org/x/tools/gopls/internal/analysis/modernize/cmd/modernize@latest -fix -test ./... Signed-off-by: beorn7 <beorn@grafana.com>
ec0c01e to
917a038
Compare
krajorama
left a comment
There was a problem hiding this comment.
LGTM as a compromise/workaround. Some nit comments.
I've approved mostly because of
I mostly think claiming that the default is already set here at the global level is confusing because it doesn't show up as such in the web view of the config (and that's where I would look first if I want to understand what's going on):
To me this means that we need an internal API that keeps track of what feature requests are enabled/disabled to avoid having to encode it in the default configuration. Feature flags behave differently from configuration. This is explicitly stated at the top of our documentation. Implementing that would mean that we can show the default on the UI , filtered through the feature flag.
917a038 to
bc966fc
Compare
|
FTR: I don't think the problem with the "empty default" is because of feature flags. This particular problem is because we have a "dynamic default" that has to be set in each local scrape config separately. It will go away with #17336 . |
|
In different news: In some parts of the documentation, the list of scrape protocols was missing |
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>
bc966fc to
ad7d1ae
Compare
Ironically, if you set |
## Summary This PR upgrades the `github.com/prometheus/prometheus` dependency from v0.307.3 to v0.308.0. ## Changes Made #### Fixed `RemoteWriteProtoMsg` unrecognized In prometheus/prometheus v0.308.0, the remote write protocol message types were moved from `github.com/prometheus/prometheus/config` to `github.com/prometheus/client_golang/exp/api/remote` as part of [prometheus/prometheus#17197](prometheus/prometheus#17197). #### Fixed `CreatedTimestamp` → `StartTimestamp` In [prometheus/prometheus#17411](prometheus/prometheus#17411), the Remote Write 2.0 spec was updated to 2.0-rc.4. The `CreatedTimestamp` field was renamed to `StartTimestamp` and moved from `TimeSeries` to individual `Sample` and `Histogram` messages. #### Fixed not enough arguments in`api_v1.NewAPI` The `api_v1.NewAPI` function signature changed due to [prometheus/prometheus#17470](prometheus/prometheus#17470) - Added `appendMetadata bool` parameter for remote write metadata handling. Added the new parameter `appendMetadata = false` - prometheusreceiver scrapes targets, doesn't receive remote write requests ## Remaining Issues ### `EnableNativeHistogramsIngestion` removed from `scrape.Options` There's one change in this upgrade that I'd love to get the community's input on before finalizing. In [prometheus/prometheus#17315](prometheus/prometheus#17315), Prometheus removed the `EnableNativeHistogramsIngestion` field from `scrape.Options`. Native histogram ingestion is now controlled through the Prometheus scrape config option `scrape_native_histograms` rather than programmatically. This creates an interesting situation for us. Currently, we have the feature gate `receiver.prometheusreceiver.EnableNativeHistograms` that controls whether native histograms are converted to OTel exponential histograms. But with this Prometheus change, the *ingestion* of native histograms during scraping is now a separate concern controlled by Prometheus config. I see two paths forward here. We could automatically inject `scrape_native_histograms: true` into the scrape config whenever our feature gate is enabled, preserving the current behavior where enabling the feature gate is all users need to do. Alternatively, we could simply remove the line and require users to configure `scrape_native_histograms: true` in their Prometheus scrape config themselves, which is more explicit but adds an extra configuration step. What do you think? I'm also wondering if this constitutes a breaking change that should be called out in the changelog. Would appreciate any thoughts! --------- Signed-off-by: Arthur Silva Sens <arthursens2005@gmail.com>

Part of #16572.
Still TODO (in this PR):
This commit adds a global and local scrape config option
scrape_native_histograms, which has to be set to true to ingestnative histograms.
To ease the transition, the feature flag is changed to simply set the
default of
scrape_native_histogramsto true.Further implications:
scrape_native_histogramssetting.Documentation beyond the one for the feature flag and the scrape
config are deliberately left out. See
#17232 for that.
Does this PR introduce a user-facing change?