Skip to content

Commit a769006

Browse files
author
Tyler Reid
committed
Add common/sigv4 with the sigv4 config
Signed-off-by: Tyler Reid <[email protected]>
1 parent bd82f70 commit a769006

File tree

3 files changed

+265
-31
lines changed

3 files changed

+265
-31
lines changed

config/notifiers.go

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import (
2020
"time"
2121

2222
"github.com/pkg/errors"
23+
"github.com/prometheus/common/sigv4"
2324

2425
commoncfg "github.com/prometheus/common/config"
2526
)
@@ -589,25 +590,13 @@ func (c *PushoverConfig) UnmarshalYAML(unmarshal func(interface{}) error) error
589590
return nil
590591
}
591592

592-
// SigV4Config is the configuration for signing remote write requests with
593-
// AWS's SigV4 verification process. Empty values will be retrieved using the
594-
// AWS default credentials chain.
595-
// TODO: Move to common.
596-
type SigV4Config struct {
597-
Region string `yaml:"region,omitempty"`
598-
AccessKey string `yaml:"access_key,omitempty"`
599-
SecretKey Secret `yaml:"secret_key,omitempty"`
600-
Profile string `yaml:"profile,omitempty"`
601-
RoleARN string `yaml:"role_arn,omitempty"`
602-
}
603-
604593
type SNSConfig struct {
605594
NotifierConfig `yaml:",inline" json:",inline"`
606595

607596
HTTPConfig *commoncfg.HTTPClientConfig `yaml:"http_config,omitempty" json:"http_config,omitempty"`
608597

609598
APIUrl string `yaml:"api_url,omitempty" json:"api_url,omitempty"`
610-
Sigv4 SigV4Config `yaml:"sigv4" json:"sigv4"`
599+
Sigv4 sigv4.SigV4Config `yaml:"sigv4" json:"sigv4"`
611600
TopicARN string `yaml:"topic_arn,omitempty" json:"topic_arn,omitempty"`
612601
PhoneNumber string `yaml:"phone_number,omitempty" json:"phone_number,omitempty"`
613602
TargetARN string `yaml:"target_arn,omitempty" json:"target_arn,omitempty"`

go.mod

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,17 @@ require (
2323
github.com/oklog/run v1.1.0
2424
github.com/oklog/ulid v1.3.1
2525
github.com/pkg/errors v0.9.1
26-
github.com/prometheus/client_golang v1.10.0
27-
github.com/prometheus/common v0.24.0
26+
github.com/prometheus/client_golang v1.11.0
27+
github.com/prometheus/common v0.29.0
28+
github.com/prometheus/common/sigv4 v0.1.0
2829
github.com/prometheus/exporter-toolkit v0.5.1
2930
github.com/rs/cors v1.7.0
3031
github.com/shurcooL/httpfs v0.0.0-20190707220628-8d4bc4ba7749
3132
github.com/shurcooL/vfsgen v0.0.0-20200824052919-0d455de96546
3233
github.com/stretchr/testify v1.7.0
3334
github.com/xlab/treeprint v1.1.0
3435
go.uber.org/atomic v1.5.0
35-
golang.org/x/net v0.0.0-20210421230115-4e50805a0758
36+
golang.org/x/net v0.0.0-20210525063256-abc453219eb5
3637
golang.org/x/tools v0.1.0
3738
gopkg.in/alecthomas/kingpin.v2 v2.2.6
3839
gopkg.in/yaml.v2 v2.4.0

0 commit comments

Comments
 (0)