Skip to content

Add enableFeatures field to MonitoringStack prometheusConfig#996

Open
emilarnesen wants to merge 1 commit intorhobs:mainfrom
emilarnesen:add-enable-features-to-monitoringstack
Open

Add enableFeatures field to MonitoringStack prometheusConfig#996
emilarnesen wants to merge 1 commit intorhobs:mainfrom
emilarnesen:add-enable-features-to-monitoringstack

Conversation

@emilarnesen
Copy link

Summary

Adds a new enableFeatures field to the MonitoringStack prometheusConfig spec, allowing users to enable Prometheus feature flags (e.g. exemplar-storage, native-histograms) on Prometheus instances managed by the observability-operator.

The underlying CommonPrometheusFields in the prometheus-operator already supports EnableFeatures []EnableFeature, but the MonitoringStack CRD did not expose it. This PR wires it through.

Resolves #995

Changes

  • pkg/apis/monitoring/v1alpha1/types.go — Added EnableFeatures []string field to PrometheusConfig with kubebuilder validation
  • pkg/controllers/monitoring/monitoring-stack/components.go — Wire EnableFeatures through to the Prometheus CR via a toEnableFeatures() conversion function ([]string[]monv1.EnableFeature)
  • pkg/apis/monitoring/v1alpha1/zz_generated.deepcopy.go — Deep copy support for the new slice field
  • pkg/controllers/monitoring/monitoring-stack/components_test.go — Unit tests for toEnableFeatures()
  • test/e2e/monitoring_stack_controller_test.go — Added EnableFeatures to the managed fields e2e test

Usage

apiVersion: monitoring.rhobs/v1alpha1
kind: MonitoringStack
metadata:
  name: monitoring-stack
spec:
  prometheusConfig:
    enableRemoteWriteReceiver: true
    enableFeatures:
      - exemplar-storage

This propagates as --enable-feature=exemplar-storage on 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 with send_exemplars: true. The exemplars carry trace IDs enabling Metrics → Traces correlation in Grafana. Without exemplar-storage enabled on the receiving Prometheus, exemplars are silently dropped.

Currently there is no way to enable this through the MonitoringStack API. The existing enableRemoteWriteReceiver and enableOtlpHttpReceiver fields are feature-specific booleans — enableFeatures provides a generic escape hatch for any Prometheus feature flag.

@openshift-ci
Copy link

openshift-ci bot commented Feb 17, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: emilarnesen
Once this PR has been reviewed and has the lgtm label, please assign jgbernalp for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci
Copy link

openshift-ci bot commented Feb 17, 2026

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 /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE] Add enableFeatures field to MonitoringStack prometheusConfig

1 participant