-
Notifications
You must be signed in to change notification settings - Fork 797
MON-4620: expose remote-write protocol version #2958
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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. | ||
|
Comment on lines
+1555
to
+1556
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Based on the enum constraints, "Version1.0" and "Version2.0" would be rejected inputs. Either align this text with the actual allowed inputs or update the allowed inputs to match these documented strings. |
||
| // +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 | ||
|
|
||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -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 | ||||||||||||||||||||||
|
Comment on lines
+3856
to
+3860
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win Document the enum values accepted by the schema The descriptions say to use Proposed fix- 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.
+ 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.📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||
| type: string | ||||||||||||||||||||||
| metadataConfig: | ||||||||||||||||||||||
| description: |- | ||||||||||||||||||||||
| metadataConfig configures the sending of series metadata to remote storage. | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
There was a problem hiding this comment.
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?