Skip to content

Commit 39ae2ee

Browse files
committed
fix(inputs.bind): Convert counters to uint64
1 parent 275a9fd commit 39ae2ee

File tree

6 files changed

+1333
-24
lines changed

6 files changed

+1333
-24
lines changed

CHANGELOG.md

+11
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,17 @@
11
<!-- markdownlint-disable MD024 -->
22
# Changelog
33

4+
## Unreleased
5+
6+
### Important Changes
7+
8+
- PR [#](https://github.com/influxdata/telegraf/pull/) changes the internal
9+
counters of the Bind plugin to unsigned integers matching the server
10+
implementation. We keep backward compatibility by setting
11+
`report_counters_as_int` to `true` by default to avoid type conflicts on the
12+
output side. However, you should change this setting to `false` as soon as
13+
possible to avoid invalid values and parsing errors with the v3 XML statistics.
14+
415
## v1.32.1 [2024-10-07]
516

617
### Important Changes

plugins/inputs/bind/README.md

+5
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,11 @@ See the [CONFIGURATION.md][CONFIGURATION.md] for more details.
3535
# gather_memory_contexts = false
3636
# gather_views = false
3737

38+
## Report xml v3 counters as integers instead of unsigned for backward
39+
## compatibility. Set this to false as soon as possible!
40+
## Values are clipped if exceeding the integer range.
41+
# report_counters_as_int = true
42+
3843
## Timeout for http requests made by bind nameserver
3944
# timeout = "4s"
4045
```

plugins/inputs/bind/bind.go

+5-4
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,11 @@ import (
1818
var sampleConfig string
1919

2020
type Bind struct {
21-
Urls []string
22-
GatherMemoryContexts bool
23-
GatherViews bool
21+
Urls []string `tom:"urls"`
22+
GatherMemoryContexts bool `tom:"gather_memory_contexts"`
23+
GatherViews bool `tom:"gather_views"`
2424
Timeout config.Duration `toml:"timeout"`
25+
CountersAsInt bool `toml:"report_counters_as_int"`
2526

2627
client http.Client
2728
}
@@ -84,5 +85,5 @@ func (b *Bind) gatherURL(addr *url.URL, acc telegraf.Accumulator) error {
8485
}
8586

8687
func init() {
87-
inputs.Add("bind", func() telegraf.Input { return &Bind{} })
88+
inputs.Add("bind", func() telegraf.Input { return &Bind{CountersAsInt: true} })
8889
}

0 commit comments

Comments
 (0)