diff --git a/config/v1alpha1/types_cluster_monitoring.go b/config/v1alpha1/types_cluster_monitoring.go index 6a6bfcb6979..636603cfca7 100644 --- a/config/v1alpha1/types_cluster_monitoring.go +++ b/config/v1alpha1/types_cluster_monitoring.go @@ -1571,6 +1571,13 @@ 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. + // The default value is "V1.0". + // When set to "V1.0", Prometheus uses the `prometheus.WriteRequest` protobuf message introduced in Remote Write 1.0. + // When set to "V2.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). @@ -1768,6 +1775,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 8a25a8e92a3..51816207f2c 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 @@ -3871,6 +3871,17 @@ 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. + The default value is "V1.0". + When set to "V1.0", Prometheus uses the `prometheus.WriteRequest` protobuf message introduced in Remote Write 1.0. + When set to "V2.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 d9b2492aab6..c918e841829 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 @@ -3871,6 +3871,17 @@ 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. + The default value is "V1.0". + When set to "V1.0", Prometheus uses the `prometheus.WriteRequest` protobuf message introduced in Remote Write 1.0. + When set to "V2.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 b53520e86d5..649547d914a 100644 --- a/config/v1alpha1/zz_generated.swagger_doc_generated.go +++ b/config/v1alpha1/zz_generated.swagger_doc_generated.go @@ -645,6 +645,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. The default value is \"V1.0\". When set to \"V1.0\", Prometheus uses the `prometheus.WriteRequest` protobuf message introduced in Remote Write 1.0. When set to \"V2.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 65e31f45b76..f1ee1df4978 100644 --- a/openapi/generated_openapi/zz_generated.openapi.go +++ b/openapi/generated_openapi/zz_generated.openapi.go @@ -26848,6 +26848,13 @@ 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. The default value is \"V1.0\". When set to \"V1.0\", Prometheus uses the `prometheus.WriteRequest` protobuf message introduced in Remote Write 1.0. When set to \"V2.0\", Prometheus uses the `io.prometheus.write.v2.Request` protobuf message introduced in Remote Write 2.0.", + 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 905160afdf9..089125cc583 100644 --- a/openapi/openapi.json +++ b/openapi/openapi.json @@ -14789,6 +14789,10 @@ ], "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. The default value is \"V1.0\". When set to \"V1.0\", Prometheus uses the `prometheus.WriteRequest` protobuf message introduced in Remote Write 1.0. When set to \"V2.0\", Prometheus uses the `io.prometheus.write.v2.Request` protobuf message introduced in Remote Write 2.0.", + "type": "string" + }, "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 8a25a8e92a3..51816207f2c 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 @@ -3871,6 +3871,17 @@ 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. + The default value is "V1.0". + When set to "V1.0", Prometheus uses the `prometheus.WriteRequest` protobuf message introduced in Remote Write 1.0. + When set to "V2.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.