Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(inputs.bind): Convert counters to uint64 #16015

Merged
merged 3 commits into from
Oct 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
<!-- markdownlint-disable MD024 -->
# Changelog

## Unreleased

### Important Changes

- PR [#16015](https://github.com/influxdata/telegraf/pull/16015) changes the internal
counters of the Bind plugin to unsigned integers matching the server
implementation. We keep backward compatibility by setting
`report_counters_as_int` to `true` by default to avoid type conflicts on the
output side. However, you should change this setting to `false` as soon as
possible to avoid invalid values and parsing errors with the v3 XML statistics.

## v1.32.2 [2024-10-28]

### Bugfixes
Expand Down
5 changes: 5 additions & 0 deletions plugins/inputs/bind/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ See the [CONFIGURATION.md][CONFIGURATION.md] for more details.
# gather_memory_contexts = false
# gather_views = false

## Report xml v3 counters as integers instead of unsigned for backward
## compatibility. Set this to false as soon as possible!
## Values are clipped if exceeding the integer range.
# report_counters_as_int = true

## Timeout for http requests made by bind nameserver
# timeout = "4s"
```
Expand Down
9 changes: 5 additions & 4 deletions plugins/inputs/bind/bind.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,11 @@ import (
var sampleConfig string

type Bind struct {
Urls []string
GatherMemoryContexts bool
GatherViews bool
Urls []string `toml:"urls"`
GatherMemoryContexts bool `toml:"gather_memory_contexts"`
GatherViews bool `toml:"gather_views"`
Timeout config.Duration `toml:"timeout"`
CountersAsInt bool `toml:"report_counters_as_int"`

client http.Client
}
Expand Down Expand Up @@ -84,5 +85,5 @@ func (b *Bind) gatherURL(addr *url.URL, acc telegraf.Accumulator) error {
}

func init() {
inputs.Add("bind", func() telegraf.Input { return &Bind{} })
inputs.Add("bind", func() telegraf.Input { return &Bind{CountersAsInt: true} })
}
Loading
Loading