Skip to content

Commit

Permalink
Multi instances in win_perf_counters (influxdata#2352)
Browse files Browse the repository at this point in the history
  • Loading branch information
bullshit authored and Vladislav Mugultyanov (Lazada Group) committed May 30, 2017
1 parent 283f9ad commit ab47801
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@ be deprecated eventually.
- [#2520](https://github.com/influxdata/telegraf/pull/2520): Update default value for Cloudwatch rate limit
- [#2513](https://github.com/influxdata/telegraf/issues/2513): create /etc/telegraf/telegraf.d directory in tarball.
- [#2541](https://github.com/influxdata/telegraf/issues/2541): Return error on unsupported serializer data format.
- [#1827](https://github.com/influxdata/telegraf/issues/1827): Fix Windows Performance Counters multi instance identifier


## v1.2.1 [2017-02-01]

Expand Down
5 changes: 5 additions & 0 deletions plugins/inputs/win_perf_counters/win_perf_counters.go
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,11 @@ func (m *Win_PerfCounters) Gather(acc telegraf.Accumulator) error {
} else if metric.instance == s {
// Catch if we set it to total or some form of it
add = true
} else if strings.Contains(metric.instance, "#") && strings.HasPrefix(metric.instance, s) {
// If you are using a multiple instance identifier such as "w3wp#1"
// phd.dll returns only the first 2 characters of the identifier.
add = true
s = metric.instance
} else if metric.instance == "------" {
add = true
}
Expand Down

0 comments on commit ab47801

Please sign in to comment.