Skip to content

Commit 5e293b2

Browse files
authored
Merge pull request #1960 from mrueg/useragent
Enrich UserAgent with more information
2 parents bc7b5b6 + b41d5ca commit 5e293b2

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pkg/app/server.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ import (
2626
"net/http/pprof"
2727
"os"
2828
"path/filepath"
29+
"runtime"
2930
"strconv"
3031
"strings"
3132
"time"
@@ -334,7 +335,7 @@ func createKubeClient(apiserver string, kubeconfig string, factories ...customre
334335
return nil, nil, nil, err
335336
}
336337

337-
config.UserAgent = version.Version
338+
config.UserAgent = fmt.Sprintf("%s/%s (%s/%s) kubernetes/%s", "kube-state-metrics", version.Version, runtime.GOOS, runtime.GOARCH, version.Revision)
338339
config.AcceptContentTypes = "application/vnd.kubernetes.protobuf,application/json"
339340
config.ContentType = "application/vnd.kubernetes.protobuf"
340341

0 commit comments

Comments
 (0)