diff --git a/pkg/alert/alert.go b/pkg/alert/alert.go index ef28ec7ef9..6af16674e8 100644 --- a/pkg/alert/alert.go +++ b/pkg/alert/alert.go @@ -17,8 +17,9 @@ import ( "github.com/go-kit/kit/log/level" "github.com/pkg/errors" "github.com/prometheus/client_golang/prometheus" - + "github.com/prometheus/common/version" "github.com/prometheus/prometheus/pkg/labels" + "github.com/thanos-io/thanos/pkg/runutil" ) @@ -27,6 +28,8 @@ const ( contentTypeJSON = "application/json" ) +var userAgent = fmt.Sprintf("Thanos/%s", version.Version) + // Alert is a generic representation of an alert in the Prometheus eco-system. type Alert struct { // Label value pairs for purpose of aggregation, matching, and disposition @@ -369,6 +372,7 @@ func (s *Sender) sendOne(ctx context.Context, url string, b []byte) error { } req = req.WithContext(ctx) req.Header.Set("Content-Type", contentTypeJSON) + req.Header.Set("User-Agent", userAgent) resp, err := s.doReq(req) if err != nil {