Skip to content

Commit

Permalink
fix(output.zabbix): simplify code
Browse files Browse the repository at this point in the history
  • Loading branch information
adrianlzt committed Dec 14, 2023
1 parent 5615ac5 commit 627838b
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions plugins/outputs/zabbix/lld.go
Original file line number Diff line number Diff line change
Expand Up @@ -194,13 +194,11 @@ func (zl *zabbixLLD) Add(in telegraf.Metric) error {
data[key] = tag.Value
}

var key string
if len(keys) > 0 {
key = in.Name() + "." + strings.Join(keys, ".")
} else {
if len(keys) == 0 {
// Ignore metrics without tags (apart from the host tag)
return nil
}
key := in.Name() + "." + strings.Join(keys, ".")

// If hostname is not defined, use the hostname of the system
if hostname == "" {
Expand Down

0 comments on commit 627838b

Please sign in to comment.