-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
[exporter/prometheusremotewrite] disallow setting compression type other than snappy #38371
base: main
Are you sure you want to change the base?
[exporter/prometheusremotewrite] disallow setting compression type other than snappy #38371
Conversation
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.
LGTM.
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.
Just some very small comments and LGTM, thanks for tackling this :)
# These lines will be padded with 2 spaces and then inserted directly into the document. | ||
# Use pipe (|) for multiline entries. | ||
subtext: | | ||
This change ensures that, only snappy compression type can be set as it's required by the Prometheus Remote Write protocol. |
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.
This change ensures that, only snappy compression type can be set as it's required by the Prometheus Remote Write protocol. | |
This change ensures that only the snappy compression type can be set, as required by the Prometheus Remote Write protocol. |
@@ -124,5 +124,9 @@ func (cfg *Config) Validate() error { | |||
cfg.MaxBatchSizeBytes = 3000000 | |||
} | |||
|
|||
if len(cfg.ClientConfig.Compression) > 0 && cfg.ClientConfig.Compression != "snappy" { |
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.
CompressionType is a string[1], there's no need to check for length :)
if len(cfg.ClientConfig.Compression) > 0 && cfg.ClientConfig.Compression != "snappy" { | |
if cfg.ClientConfig.Compression != "snappy" { |
The Prometheus Remote Write exporter only supports
snappy
compression type as it's required by the remote write protocol.Description
This PR prevents users from accidentally setting the compression type other than
snappy
and notifying them.Link to tracking issue
Fixes #37232
Testing
Documentation