Add enableFeatures field to MonitoringStack prometheusConfig#996
Add enableFeatures field to MonitoringStack prometheusConfig#996emilarnesen wants to merge 1 commit intorhobs:mainfrom
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: emilarnesen The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Hi @emilarnesen. Thanks for your PR. I'm waiting for a rhobs member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
Summary
Adds a new
enableFeaturesfield to theMonitoringStackprometheusConfigspec, allowing users to enable Prometheus feature flags (e.g.exemplar-storage,native-histograms) on Prometheus instances managed by the observability-operator.The underlying
CommonPrometheusFieldsin the prometheus-operator already supportsEnableFeatures []EnableFeature, but the MonitoringStack CRD did not expose it. This PR wires it through.Resolves #995
Changes
pkg/apis/monitoring/v1alpha1/types.go— AddedEnableFeatures []stringfield toPrometheusConfigwith kubebuilder validationpkg/controllers/monitoring/monitoring-stack/components.go— WireEnableFeaturesthrough to the Prometheus CR via atoEnableFeatures()conversion function ([]string→[]monv1.EnableFeature)pkg/apis/monitoring/v1alpha1/zz_generated.deepcopy.go— Deep copy support for the new slice fieldpkg/controllers/monitoring/monitoring-stack/components_test.go— Unit tests fortoEnableFeatures()test/e2e/monitoring_stack_controller_test.go— AddedEnableFeaturesto the managed fields e2e testUsage
This propagates as
--enable-feature=exemplar-storageon the Prometheus container args.Motivation
We use Tempo's metrics generator to produce span-metrics (
traces_spanmetrics_calls_total,traces_spanmetrics_latency_bucket) and write them to a MonitoringStack Prometheus via remote write withsend_exemplars: true. The exemplars carry trace IDs enabling Metrics → Traces correlation in Grafana. Withoutexemplar-storageenabled on the receiving Prometheus, exemplars are silently dropped.Currently there is no way to enable this through the MonitoringStack API. The existing
enableRemoteWriteReceiverandenableOtlpHttpReceiverfields are feature-specific booleans —enableFeaturesprovides a generic escape hatch for any Prometheus feature flag.