Skip to content

Commit 3d0fb69

Browse files
committed
fixup! MON-3500: Enable sending exemplars over RW in UWM
1 parent 75569e2 commit 3d0fb69

File tree

4 files changed

+8
-16
lines changed

4 files changed

+8
-16
lines changed

Documentation/api.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -525,7 +525,7 @@ The `RemoteWriteSpec` resource defines the settings for remote write storage.
525525
| proxyUrl | string | Defines an optional proxy URL. |
526526
| queueConfig | *[monv1.QueueConfig](https://github.com/prometheus-operator/prometheus-operator/blob/v0.66.0/Documentation/api.md#queueconfig) | Allows tuning configuration for remote write queue parameters. |
527527
| remoteTimeout | string | Defines the timeout value for requests to the remote write endpoint. |
528-
| sendExemplars | *bool | Enables sending of exemplars over remote write. Note that the experimental \"exemplar-storage\" feature must be enabled using the `spec.enableFeature` option for exemplars to be scraped in the first place. Only supported for UWM configurations. |
528+
| sendExemplars | *bool | Enables sending of exemplars over remote write. Note when enabled, Prometheus is configured to store exemplars in memory with a maximum number of 100,000 exemplars. The setting is only effective for user-defined monitoring and has no effect for cluster monitoring. |
529529
| sigv4 | *monv1.Sigv4 | Defines AWS Signature Version 4 authentication settings. |
530530
| tlsConfig | *[monv1.SafeTLSConfig](https://github.com/prometheus-operator/prometheus-operator/blob/v0.66.0/Documentation/api.md#safetlsconfig) | Defines TLS authentication settings for the remote write endpoint. |
531531
| url | string | Defines the URL of the remote write endpoint to which samples will be sent. |

Documentation/openshiftdocs/modules/remotewritespec.adoc

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ link:prometheusrestrictedconfig.adoc[PrometheusRestrictedConfig]
4141

4242
|remoteTimeout|string|Defines the timeout value for requests to the remote write endpoint.
4343

44-
|sendExemplars|*bool|Enables sending of exemplars over remote write. Note that the experimental \"exemplar-storage\" feature must be enabled using the `spec.enableFeature` option for exemplars to be scraped in the first place. Only supported for UWM configurations.
44+
|sendExemplars|*bool|Enables sending of exemplars over remote write. Note when enabled, Prometheus is configured to store exemplars in memory with a maximum number of 100,000 exemplars. The setting is only effective for user-defined monitoring and has no effect for cluster monitoring.
4545

4646
|sigv4|*monv1.Sigv4|Defines AWS Signature Version 4 authentication settings.
4747

pkg/manifests/manifests.go

+2-10
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import (
2222
"fmt"
2323
"hash/fnv"
2424
"io"
25+
"k8s.io/utils/ptr"
2526
"net"
2627
"net/url"
2728
"path/filepath"
@@ -49,7 +50,6 @@ import (
4950
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
5051
"k8s.io/apimachinery/pkg/util/yaml"
5152
auditv1 "k8s.io/apiserver/pkg/apis/audit/v1"
52-
"k8s.io/klog/v2"
5353
apiregistrationv1 "k8s.io/kube-aggregator/pkg/apis/apiregistration/v1"
5454
)
5555

@@ -1459,14 +1459,6 @@ func (f *Factory) PrometheusK8s(grpcTLS *v1.Secret, trustedCABundleCM *v1.Config
14591459

14601460
if len(f.config.ClusterMonitoringConfiguration.PrometheusK8sConfig.RemoteWrite) > 0 {
14611461
p.Spec.RemoteWrite = addRemoteWriteConfigs(clusterID, p.Spec.RemoteWrite, f.config.ClusterMonitoringConfiguration.PrometheusK8sConfig.RemoteWrite...)
1462-
1463-
// Explicitly warn that we are ignoring the `SendExemplars` configuration for in-cluster scenarios.
1464-
for _, rws := range f.config.ClusterMonitoringConfiguration.PrometheusK8sConfig.RemoteWrite {
1465-
if rws.SendExemplars != nil && *rws.SendExemplars {
1466-
klog.Warningln("Enabling `SendExemplars` in the in-cluster Prometheus configuration has no affect, as it is only supported for UWM configurations.")
1467-
break
1468-
}
1469-
}
14701462
}
14711463

14721464
for _, rw := range p.Spec.RemoteWrite {
@@ -1775,7 +1767,7 @@ func (f *Factory) PrometheusUserWorkload(grpcTLS *v1.Secret, trustedCABundleCM *
17751767
// Since `SendExemplars` is experimental currently, we need to enable "exemplar-storage" explicitly to make sure
17761768
// CMO turns this on automatically in Prometheus if any *UWM* RemoteWrite[] enables this.
17771769
for _, rws := range f.config.UserWorkloadConfiguration.Prometheus.RemoteWrite {
1778-
if *rws.SendExemplars {
1770+
if ptr.Deref(rws.SendExemplars, false) {
17791771
p.Spec.EnableFeatures = append(p.Spec.EnableFeatures, EnableFeatureExemplarStorageString)
17801772
break
17811773
}

pkg/manifests/types.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -753,10 +753,10 @@ type RemoteWriteSpec struct {
753753
QueueConfig *monv1.QueueConfig `json:"queueConfig,omitempty"`
754754
// Defines the timeout value for requests to the remote write endpoint.
755755
RemoteTimeout string `json:"remoteTimeout,omitempty"`
756-
// Enables sending of exemplars over remote write. Note that the experimental
757-
// "exemplar-storage" feature must be enabled using the `spec.enableFeature`
758-
// option for exemplars to be scraped in the first place. Only supported for
759-
// UWM configurations.
756+
// Enables sending of exemplars over remote write. Note when enabled, Prometheus is
757+
// configured to store exemplars in memory with a maximum number of 100,000 exemplars.
758+
// The setting is only effective for user-defined monitoring and has no effect for
759+
// cluster monitoring.
760760
SendExemplars *bool `json:"sendExemplars,omitempty"`
761761
// Defines AWS Signature Version 4 authentication settings.
762762
Sigv4 *monv1.Sigv4 `json:"sigv4,omitempty"`

0 commit comments

Comments
 (0)