chore(inputs): Remove unnecessary nil check (#13749)

Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
This commit is contained in:
Eng Zer Jun 2023-08-14 16:39:56 +08:00 committed by GitHub
parent 2f1edfbbfc
commit 7e6b98226e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 9 deletions

View File

@ -410,11 +410,9 @@ func (p *Prometheus) gatherURL(u URLAndAddress, acc telegraf.Accumulator) error
req.SetBasicAuth(p.Username, p.Password)
}
if p.HTTPHeaders != nil {
for key, value := range p.HTTPHeaders {
req.Header.Set(key, value)
}
}
var resp *http.Response
if u.URL.Scheme != "unix" {

View File

@ -1388,13 +1388,11 @@ func (e *Endpoint) populateTags(objectRef *objectRef, resourceType string, resou
}
// Fill in custom values if they exist
if objectRef.customValues != nil {
for k, v := range objectRef.customValues {
if v != "" {
t[k] = v
}
}
}
}
func (e *Endpoint) makeMetricIdentifier(prefix, metric string) (metricName string, fieldName string) {