Skip to content

Commit

Permalink
Don't add system input uptime_format as a counter (#3578)
Browse files Browse the repository at this point in the history
  • Loading branch information
ildarsv authored and danielnelson committed Dec 13, 2017
1 parent 8785c7d commit d935dfa
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion plugins/inputs/system/SYSTEM_README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,6 @@ $ telegraf --config ~/ws/telegraf.conf --input-filter system --test
* Plugin: system, Collection 1
* Plugin: inputs.system, Collection 1
> system,host=tyrion load1=3.72,load5=2.4,load15=2.1,n_users=3i,n_cpus=4i 1483964144000000000
> system,host=tyrion uptime=1249632i,uptime_format="14 days, 11:07" 1483964144000000000
> system,host=tyrion uptime=1249632i 1483964144000000000
> system,host=tyrion uptime_format="14 days, 11:07" 1483964144000000000
```
4 changes: 3 additions & 1 deletion plugins/inputs/system/system.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@ func (_ *SystemStats) Gather(acc telegraf.Accumulator) error {
"n_cpus": runtime.NumCPU(),
}, nil)
acc.AddCounter("system", map[string]interface{}{
"uptime": hostinfo.Uptime,
"uptime": hostinfo.Uptime,
}, nil)
acc.AddFields("system", map[string]interface{}{
"uptime_format": format_uptime(hostinfo.Uptime),
}, nil)

Expand Down

0 comments on commit d935dfa

Please sign in to comment.