Add telegraf version to User-Agent header (#4838)
Header is added in influxdb, influxdb_v2, and http outputs.
This commit is contained in:
committed by
Daniel Nelson
parent
502d9ab499
commit
44fd74d688
@@ -40,7 +40,6 @@ const (
|
||||
defaultRequestTimeout = time.Second * 5
|
||||
defaultMaxWait = 10 // seconds
|
||||
defaultDatabase = "telegraf"
|
||||
defaultUserAgent = "telegraf"
|
||||
)
|
||||
|
||||
type HTTPConfig struct {
|
||||
@@ -82,7 +81,7 @@ func NewHTTPClient(config *HTTPConfig) (*httpClient, error) {
|
||||
|
||||
userAgent := config.UserAgent
|
||||
if userAgent == "" {
|
||||
userAgent = defaultUserAgent
|
||||
userAgent = "Telegraf/" + internal.Version()
|
||||
}
|
||||
|
||||
var headers = make(map[string]string, len(config.Headers)+2)
|
||||
|
||||
Reference in New Issue
Block a user