From 9fea63d1c81371ed6bca6c2d0012eae831f664ac Mon Sep 17 00:00:00 2001 From: Aliaksandr Valialkin Date: Wed, 4 May 2022 20:39:38 +0300 Subject: [PATCH] app/vmagent: rename -remoteWrite.useSigv4 command-line flag to -remoteWrite.aws.useSigv4, so its name is consistent with the other -remoteWrite.aws.* command-line flags --- app/vmagent/README.md | 15 +++++++++++++++ app/vmagent/remotewrite/client.go | 14 +++++++------- docs/vmagent.md | 15 +++++++++++++++ 3 files changed, 37 insertions(+), 7 deletions(-) diff --git a/app/vmagent/README.md b/app/vmagent/README.md index 9c6eb144cb..395e57beb7 100644 --- a/app/vmagent/README.md +++ b/app/vmagent/README.md @@ -914,6 +914,21 @@ See the docs at https://docs.victoriametrics.com/vmagent.html . Whether to suppress 'duplicate scrape target' errors; see https://docs.victoriametrics.com/vmagent.html#troubleshooting for details -promscrape.suppressScrapeErrors Whether to suppress scrape errors logging. The last error for each target is always available at '/targets' page even if scrape errors logging is suppressed + -remoteWrite.aws.accessKey array + Optional AWS AccessKey to use for -remoteWrite.url if -remoteWrite.aws.useSigv4 is set. If multiple args are set, then they are applied independently for the corresponding -remoteWrite.url + Supports an array of values separated by comma or specified via multiple flags. + -remoteWrite.aws.region array + Optional AWS region to use for -remoteWrite.url if -remoteWrite.aws.useSigv4 is set. If multiple args are set, then they are applied independently for the corresponding -remoteWrite.url + Supports an array of values separated by comma or specified via multiple flags. + -remoteWrite.aws.roleARN array + Optional AWS roleARN to use for -remoteWrite.url if -remoteWrite.aws.useSigv4 is set. If multiple args are set, then they are applied independently for the corresponding -remoteWrite.url + Supports an array of values separated by comma or specified via multiple flags. + -remoteWrite.aws.secretKey array + Optional AWS SecretKey to use for -remoteWrite.url if -remoteWrite.aws.useSigv4 is set. If multiple args are set, then they are applied independently for the corresponding -remoteWrite.url + Supports an array of values separated by comma or specified via multiple flags. + -remoteWrite.aws.useSigv4 array + Enables SigV4 request signing for -remoteWrite.url. It is expected that other -remoteWrite.aws.* command-line flags are set if sigv4 request signing is enabled. If multiple args are set, then they are applied independently for the corresponding -remoteWrite.url + Supports array of values separated by comma or specified via multiple flags. -remoteWrite.basicAuth.password array Optional basic auth password to use for -remoteWrite.url. If multiple args are set, then they are applied independently for the corresponding -remoteWrite.url Supports an array of values separated by comma or specified via multiple flags. diff --git a/app/vmagent/remotewrite/client.go b/app/vmagent/remotewrite/client.go index a1216289eb..156d802171 100644 --- a/app/vmagent/remotewrite/client.go +++ b/app/vmagent/remotewrite/client.go @@ -11,7 +11,6 @@ import ( "time" "github.com/VictoriaMetrics/VictoriaMetrics/lib/awsapi" - "github.com/VictoriaMetrics/VictoriaMetrics/lib/flagutil" "github.com/VictoriaMetrics/VictoriaMetrics/lib/logger" "github.com/VictoriaMetrics/VictoriaMetrics/lib/persistentqueue" @@ -62,15 +61,16 @@ var ( oauth2Scopes = flagutil.NewArray("remoteWrite.oauth2.scopes", "Optional OAuth2 scopes to use for -remoteWrite.url. Scopes must be delimited by ';'. "+ "If multiple args are set, then they are applied independently for the corresponding -remoteWrite.url") - useSigV4 = flagutil.NewArrayBool("remoteWrite.useSigv4", "Enables SigV4 request signing to use for -remoteWrite.url. "+ + awsUseSigv4 = flagutil.NewArrayBool("remoteWrite.aws.useSigv4", "Enables SigV4 request signing for -remoteWrite.url. "+ + "It is expected that other -remoteWrite.aws.* command-line flags are set if sigv4 request signing is enabled. "+ "If multiple args are set, then they are applied independently for the corresponding -remoteWrite.url") - awsRegion = flagutil.NewArray("remoteWrite.aws.region", "Optional AWS region to use for -remoteWrite.url if -remoteWrite.useSigv4 is set. "+ + awsRegion = flagutil.NewArray("remoteWrite.aws.region", "Optional AWS region to use for -remoteWrite.url if -remoteWrite.aws.useSigv4 is set. "+ "If multiple args are set, then they are applied independently for the corresponding -remoteWrite.url") - awsRoleARN = flagutil.NewArray("remoteWrite.aws.roleARN", "Optional AWS roleARN to use for -remoteWrite.url if -remoteWrite.useSigv4 is set. "+ + awsRoleARN = flagutil.NewArray("remoteWrite.aws.roleARN", "Optional AWS roleARN to use for -remoteWrite.url if -remoteWrite.aws.useSigv4 is set. "+ "If multiple args are set, then they are applied independently for the corresponding -remoteWrite.url") - awsAccessKey = flagutil.NewArray("remoteWrite.aws.accessKey", "Optional AWS AccessKey to use for -remoteWrite.url if -remoteWrite.useSigv4 is set. "+ + awsAccessKey = flagutil.NewArray("remoteWrite.aws.accessKey", "Optional AWS AccessKey to use for -remoteWrite.url if -remoteWrite.aws.useSigv4 is set. "+ "If multiple args are set, then they are applied independently for the corresponding -remoteWrite.url") - awsSecretKey = flagutil.NewArray("remoteWrite.aws.secretKey", "Optional AWS SecretKey to use for -remoteWrite.url if -remoteWrite.useSigv4 is set. "+ + awsSecretKey = flagutil.NewArray("remoteWrite.aws.secretKey", "Optional AWS SecretKey to use for -remoteWrite.url if -remoteWrite.aws.useSigv4 is set. "+ "If multiple args are set, then they are applied independently for the corresponding -remoteWrite.url") ) @@ -225,7 +225,7 @@ func getAuthConfig(argIdx int) (*promauth.Config, error) { } func getAWSAPIConfig(argIdx int) (*awsapi.Config, error) { - if !useSigV4.GetOptionalArg(argIdx) { + if !awsUseSigv4.GetOptionalArg(argIdx) { return nil, nil } region := awsRegion.GetOptionalArg(argIdx) diff --git a/docs/vmagent.md b/docs/vmagent.md index 7bd59d684d..b5931fb036 100644 --- a/docs/vmagent.md +++ b/docs/vmagent.md @@ -918,6 +918,21 @@ See the docs at https://docs.victoriametrics.com/vmagent.html . Whether to suppress 'duplicate scrape target' errors; see https://docs.victoriametrics.com/vmagent.html#troubleshooting for details -promscrape.suppressScrapeErrors Whether to suppress scrape errors logging. The last error for each target is always available at '/targets' page even if scrape errors logging is suppressed + -remoteWrite.aws.accessKey array + Optional AWS AccessKey to use for -remoteWrite.url if -remoteWrite.aws.useSigv4 is set. If multiple args are set, then they are applied independently for the corresponding -remoteWrite.url + Supports an array of values separated by comma or specified via multiple flags. + -remoteWrite.aws.region array + Optional AWS region to use for -remoteWrite.url if -remoteWrite.aws.useSigv4 is set. If multiple args are set, then they are applied independently for the corresponding -remoteWrite.url + Supports an array of values separated by comma or specified via multiple flags. + -remoteWrite.aws.roleARN array + Optional AWS roleARN to use for -remoteWrite.url if -remoteWrite.aws.useSigv4 is set. If multiple args are set, then they are applied independently for the corresponding -remoteWrite.url + Supports an array of values separated by comma or specified via multiple flags. + -remoteWrite.aws.secretKey array + Optional AWS SecretKey to use for -remoteWrite.url if -remoteWrite.aws.useSigv4 is set. If multiple args are set, then they are applied independently for the corresponding -remoteWrite.url + Supports an array of values separated by comma or specified via multiple flags. + -remoteWrite.aws.useSigv4 array + Enables SigV4 request signing for -remoteWrite.url. It is expected that other -remoteWrite.aws.* command-line flags are set if sigv4 request signing is enabled. If multiple args are set, then they are applied independently for the corresponding -remoteWrite.url + Supports array of values separated by comma or specified via multiple flags. -remoteWrite.basicAuth.password array Optional basic auth password to use for -remoteWrite.url. If multiple args are set, then they are applied independently for the corresponding -remoteWrite.url Supports an array of values separated by comma or specified via multiple flags.