diff --git a/config/v1alpha1/types_cluster_monitoring.go b/config/v1alpha1/types_cluster_monitoring.go index d4846fd1cdb..b39acd340bd 100644 --- a/config/v1alpha1/types_cluster_monitoring.go +++ b/config/v1alpha1/types_cluster_monitoring.go @@ -1550,6 +1550,12 @@ type RemoteWriteSpec struct { // +kubebuilder:validation:MaxLength=63 // +kubebuilder:validation:XValidation:rule="self.matches('^[a-zA-Z0-9_-]+$')",message="must contain only alphanumeric characters, hyphens, and underscores" Name string `json:"name,omitempty"` + // messageVersion defines the Remote Write message's version to use when writing to the endpoint. + // When omitted, this means no opinion and the platform is left to choose a reasonable default, which is subject to change over time. + // When set to "Version1.0", Prometheus uses the `prometheus.WriteRequest` protobuf message introduced in Remote Write 1.0. + // When set to "Version2.0", Prometheus uses the `io.prometheus.write.v2.Request` protobuf message introduced in Remote Write 2.0. + // +optional + MessageVersion RemoteWriteMessageVersion `json:"messageVersion,omitempty,omitzero"` // authorization defines the authorization method for the remote write endpoint. // When omitted, no authorization is performed. // When set, type must be one of Authorization, BasicAuth, OAuth2, SigV4, or ServiceAccount; the corresponding nested config must be set (ServiceAccount has no config). @@ -1747,6 +1753,17 @@ type RemoteWriteAuthorization struct { // SafeAuthorization *v1.SecretKeySelector `json:"safeAuthorization,omitempty"` } +// RemoteWriteMessageVersion defines the version of the remote-write protocol. +// +kubebuilder:validation:Enum=V1.0;V2.0 +type RemoteWriteMessageVersion string + +const ( + // RemoteWriteMessageVersion1_0 indicates the version 1.0 of the remote-write protocol. + RemoteWriteMessageVersion1_0 RemoteWriteMessageVersion = "V1.0" + // RemoteWriteMessageVersion2_0 indicates the version 2.0 of the remote-write protocol. + RemoteWriteMessageVersion2_0 RemoteWriteMessageVersion = "V2.0" +) + // MetadataConfigSendPolicy defines whether to send metadata with platform defaults or with custom settings. // +kubebuilder:validation:Enum=Default;Custom type MetadataConfigSendPolicy string diff --git a/config/v1alpha1/zz_generated.crd-manifests/0000_10_config-operator_01_clustermonitorings.crd.yaml b/config/v1alpha1/zz_generated.crd-manifests/0000_10_config-operator_01_clustermonitorings.crd.yaml index bb427426d04..069cdc925ca 100644 --- a/config/v1alpha1/zz_generated.crd-manifests/0000_10_config-operator_01_clustermonitorings.crd.yaml +++ b/config/v1alpha1/zz_generated.crd-manifests/0000_10_config-operator_01_clustermonitorings.crd.yaml @@ -3849,6 +3849,16 @@ spec: x-kubernetes-list-map-keys: - name x-kubernetes-list-type: map + messageVersion: + description: |- + messageVersion defines the Remote Write message's version to use when writing to the endpoint. + When omitted, this means no opinion and the platform is left to choose a reasonable default, which is subject to change over time. + When set to "Version1.0", Prometheus uses the `prometheus.WriteRequest` protobuf message introduced in Remote Write 1.0. + When set to "Version2.0", Prometheus uses the `io.prometheus.write.v2.Request` protobuf message introduced in Remote Write 2.0. + enum: + - V1.0 + - V2.0 + type: string metadataConfig: description: |- metadataConfig configures the sending of series metadata to remote storage. diff --git a/config/v1alpha1/zz_generated.featuregated-crd-manifests/clustermonitorings.config.openshift.io/ClusterMonitoringConfig.yaml b/config/v1alpha1/zz_generated.featuregated-crd-manifests/clustermonitorings.config.openshift.io/ClusterMonitoringConfig.yaml index af278ae490c..c9ce3a11132 100644 --- a/config/v1alpha1/zz_generated.featuregated-crd-manifests/clustermonitorings.config.openshift.io/ClusterMonitoringConfig.yaml +++ b/config/v1alpha1/zz_generated.featuregated-crd-manifests/clustermonitorings.config.openshift.io/ClusterMonitoringConfig.yaml @@ -3849,6 +3849,16 @@ spec: x-kubernetes-list-map-keys: - name x-kubernetes-list-type: map + messageVersion: + description: |- + messageVersion defines the Remote Write message's version to use when writing to the endpoint. + When omitted, this means no opinion and the platform is left to choose a reasonable default, which is subject to change over time. + When set to "Version1.0", Prometheus uses the `prometheus.WriteRequest` protobuf message introduced in Remote Write 1.0. + When set to "Version2.0", Prometheus uses the `io.prometheus.write.v2.Request` protobuf message introduced in Remote Write 2.0. + enum: + - V1.0 + - V2.0 + type: string metadataConfig: description: |- metadataConfig configures the sending of series metadata to remote storage. diff --git a/config/v1alpha1/zz_generated.swagger_doc_generated.go b/config/v1alpha1/zz_generated.swagger_doc_generated.go index 8f6cda1915a..25adf55a317 100644 --- a/config/v1alpha1/zz_generated.swagger_doc_generated.go +++ b/config/v1alpha1/zz_generated.swagger_doc_generated.go @@ -635,6 +635,7 @@ var map_RemoteWriteSpec = map[string]string{ "": "RemoteWriteSpec represents configuration for remote write endpoints.", "url": "url is the URL of the remote write endpoint. Must be a valid URL with http or https scheme and a non-empty hostname. Query parameters, fragments, and user information (e.g. user:password@host) are not allowed. Empty string is invalid. Must be between 1 and 2048 characters in length.", "name": "name is a required identifier for this remote write configuration (name is the list key for the remoteWrite list). This name is used in metrics and logging to differentiate remote write queues. Must contain only alphanumeric characters, hyphens, and underscores. Must be between 1 and 63 characters in length.", + "messageVersion": "messageVersion defines the Remote Write message's version to use when writing to the endpoint. When omitted, this means no opinion and the platform is left to choose a reasonable default, which is subject to change over time. When set to \"Version1.0\", Prometheus uses the `prometheus.WriteRequest` protobuf message introduced in Remote Write 1.0. When set to \"Version2.0\", Prometheus uses the `io.prometheus.write.v2.Request` protobuf message introduced in Remote Write 2.0.", "authorization": "authorization defines the authorization method for the remote write endpoint. When omitted, no authorization is performed. When set, type must be one of Authorization, BasicAuth, OAuth2, SigV4, or ServiceAccount; the corresponding nested config must be set (ServiceAccount has no config).", "headers": "headers specifies the custom HTTP headers to be sent along with each remote write request. Sending custom headers makes the configuration of a proxy in between optional and helps the receiver recognize the given source better. Clients MAY allow users to send custom HTTP headers; they MUST NOT allow users to configure them in such a way as to send reserved headers. Headers set by Prometheus cannot be overwritten. When omitted, no custom headers are sent. Maximum of 50 headers can be specified. Each header name must be unique. Each header name must contain only alphanumeric characters, hyphens, and underscores, and must not be a reserved Prometheus header (Host, Authorization, Content-Encoding, Content-Type, X-Prometheus-Remote-Write-Version, User-Agent, Connection, Keep-Alive, Proxy-Authenticate, Proxy-Authorization, WWW-Authenticate).", "metadataConfig": "metadataConfig configures the sending of series metadata to remote storage. When omitted, no metadata is sent. When set to sendPolicy: Default, metadata is sent using platform-chosen defaults (e.g. send interval 30 seconds). When set to sendPolicy: Custom, metadata is sent using the settings in the custom field (e.g. custom.sendIntervalSeconds).", diff --git a/openapi/generated_openapi/zz_generated.openapi.go b/openapi/generated_openapi/zz_generated.openapi.go index 5c8d52a020d..9907fa5327f 100644 --- a/openapi/generated_openapi/zz_generated.openapi.go +++ b/openapi/generated_openapi/zz_generated.openapi.go @@ -26818,6 +26818,14 @@ func schema_openshift_api_config_v1alpha1_RemoteWriteSpec(ref common.ReferenceCa Format: "", }, }, + "messageVersion": { + SchemaProps: spec.SchemaProps{ + Description: "messageVersion defines the Remote Write message's version to use when writing to the endpoint. When omitted, this means no opinion and the platform is left to choose a reasonable default, which is subject to change over time. When set to \"Version1.0\", Prometheus uses the `prometheus.WriteRequest` protobuf message introduced in Remote Write 1.0. When set to \"Version2.0\", Prometheus uses the `io.prometheus.write.v2.Request` protobuf message introduced in Remote Write 2.0.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, "authorization": { SchemaProps: spec.SchemaProps{ Description: "authorization defines the authorization method for the remote write endpoint. When omitted, no authorization is performed. When set, type must be one of Authorization, BasicAuth, OAuth2, SigV4, or ServiceAccount; the corresponding nested config must be set (ServiceAccount has no config).", diff --git a/openapi/openapi.json b/openapi/openapi.json index d972ef74c85..17384eb75d5 100644 --- a/openapi/openapi.json +++ b/openapi/openapi.json @@ -14767,6 +14767,11 @@ ], "x-kubernetes-list-type": "map" }, + "messageVersion": { + "description": "messageVersion defines the Remote Write message's version to use when writing to the endpoint. When omitted, this means no opinion and the platform is left to choose a reasonable default, which is subject to change over time. When set to \"Version1.0\", Prometheus uses the `prometheus.WriteRequest` protobuf message introduced in Remote Write 1.0. When set to \"Version2.0\", Prometheus uses the `io.prometheus.write.v2.Request` protobuf message introduced in Remote Write 2.0.", + "type": "string", + "default": "" + }, "metadataConfig": { "description": "metadataConfig configures the sending of series metadata to remote storage. When omitted, no metadata is sent. When set to sendPolicy: Default, metadata is sent using platform-chosen defaults (e.g. send interval 30 seconds). When set to sendPolicy: Custom, metadata is sent using the settings in the custom field (e.g. custom.sendIntervalSeconds).", "default": {}, diff --git a/payload-manifests/crds/0000_10_config-operator_01_clustermonitorings.crd.yaml b/payload-manifests/crds/0000_10_config-operator_01_clustermonitorings.crd.yaml index bb427426d04..069cdc925ca 100644 --- a/payload-manifests/crds/0000_10_config-operator_01_clustermonitorings.crd.yaml +++ b/payload-manifests/crds/0000_10_config-operator_01_clustermonitorings.crd.yaml @@ -3849,6 +3849,16 @@ spec: x-kubernetes-list-map-keys: - name x-kubernetes-list-type: map + messageVersion: + description: |- + messageVersion defines the Remote Write message's version to use when writing to the endpoint. + When omitted, this means no opinion and the platform is left to choose a reasonable default, which is subject to change over time. + When set to "Version1.0", Prometheus uses the `prometheus.WriteRequest` protobuf message introduced in Remote Write 1.0. + When set to "Version2.0", Prometheus uses the `io.prometheus.write.v2.Request` protobuf message introduced in Remote Write 2.0. + enum: + - V1.0 + - V2.0 + type: string metadataConfig: description: |- metadataConfig configures the sending of series metadata to remote storage.