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
@@ -187,6 +187,7 @@ func (h *HTTP) write(reqBody []byte) error {
|
||||
req.SetBasicAuth(h.Username, h.Password)
|
||||
}
|
||||
|
||||
req.Header.Set("User-Agent", "Telegraf/"+internal.Version())
|
||||
req.Header.Set("Content-Type", defaultContentType)
|
||||
if h.ContentEncoding == "gzip" {
|
||||
req.Header.Set("Content-Encoding", "gzip")
|
||||
|
||||
Reference in New Issue
Block a user