Skip to content

Commit

Permalink
space
Browse files Browse the repository at this point in the history
  • Loading branch information
captncraig committed Nov 14, 2023
1 parent 1daa10f commit d82354a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 3 additions & 1 deletion pkg/useragent/useragent.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
// package useragent provides a consistent way to get a user agent for outbound http requests from Grafana Agent.
// The default User-Agent is `GrafanaAgent/$VERSION($MODE)`
// Where version is the build version of the agent and MODE is one of "static" or "flow".
package useragent

import (
Expand All @@ -11,7 +13,7 @@ import (
func UserAgent() string {
parenthesis := ""
if mode := getRunMode(); mode != "" {
parenthesis = fmt.Sprintf("(%s)", mode)
parenthesis = fmt.Sprintf(" (%s)", mode)
}
return fmt.Sprintf("GrafanaAgent/%s%s", build.Version, parenthesis)
}
Expand Down
6 changes: 3 additions & 3 deletions pkg/useragent/useragent_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,17 @@ func TestUserAgent(t *testing.T) {
{
Name: "basic",
Mode: "",
Expected: "GrafanaAgent/v1.2.3(static)",
Expected: "GrafanaAgent/v1.2.3 (static)",
},
{
Name: "flow",
Mode: "flow",
Expected: "GrafanaAgent/v1.2.3(flow)",
Expected: "GrafanaAgent/v1.2.3 (flow)",
},
{
Name: "static",
Mode: "static",
Expected: "GrafanaAgent/v1.2.3(static)",
Expected: "GrafanaAgent/v1.2.3 (static)",
},
{
Name: "unknown",
Expand Down

0 comments on commit d82354a

Please sign in to comment.