Skip to content
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

Set custom User-Agent for remote_write #166

Merged
merged 3 commits into from
Aug 26, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@
- [EHANCEMENT] The embedded Prometheus version has been updated to 2.20.1.
(@rfratto, @gotjosh)

- [ENHANCEMENT] The User-Agent header written by the Agent when remote_writing
will now be `GrafanaCloudAgent/<Version>` instead of `Prometheus/<Prometheus Version>`.
(@rfratto)

- [BUGFIX] The documentation for Tanka configs is now correct. (@amckinley)

- [BUGFIX] Minor corrections and spelling issues have been fixed in the Overview
Expand Down
5 changes: 5 additions & 0 deletions pkg/prom/instance/instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import (

"github.com/go-kit/kit/log"
"github.com/go-kit/kit/log/level"
"github.com/grafana/agent/pkg/build"
"github.com/grafana/agent/pkg/prom/wal"
"github.com/oklog/run"
"github.com/prometheus/client_golang/prometheus"
Expand All @@ -32,6 +33,10 @@ import (
"gopkg.in/yaml.v2"
)

func init() {
remote.UserAgent = fmt.Sprintf("GrafanaCloudAgent/%s", build.Version)
}

var (
remoteWriteMetricName = "queue_highest_sent_timestamp_seconds"
managerMtx sync.Mutex
Expand Down