Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions config/v1alpha1/types_cluster_monitoring.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the current default behavior?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should document what the current default behavior is.

// 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).
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 "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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 "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.
Expand Down
1 change: 1 addition & 0 deletions config/v1alpha1/zz_generated.swagger_doc_generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions openapi/generated_openapi/zz_generated.openapi.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions openapi/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -14767,6 +14767,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. 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": {},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 "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.
Expand Down