Skip to content

Commit

Permalink
Merge branch 'influxdata:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
asaharn authored Dec 10, 2024
2 parents c7ee0c2 + 316f2d9 commit dd2d003
Show file tree
Hide file tree
Showing 560 changed files with 12,970 additions and 8,337 deletions.
8 changes: 4 additions & 4 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ executors:
working_directory: '/go/src/github.com/influxdata/telegraf'
resource_class: large
docker:
- image: 'quay.io/influxdb/telegraf-ci:1.23.2'
- image: 'quay.io/influxdb/telegraf-ci:1.23.4'
environment:
GOFLAGS: -p=4
mac:
Expand Down Expand Up @@ -106,7 +106,7 @@ jobs:
- run: 'make check-deps'
- run:
name: "Install golangci-lint"
command: go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.61.0
command: go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.62.2
- run:
name: "golangci-lint/Linux"
# There are only 4 vCPUs available for this executor, so use only 4 instead of the default number
Expand All @@ -120,7 +120,7 @@ jobs:
- check-changed-files-or-halt
- run:
name: "Install golangci-lint"
command: go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.61.0
command: go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.62.2
- run:
name: "golangci-lint/macOS"
# There are only 4 vCPUs available for this executor, so use only 4 instead of the default number
Expand All @@ -134,7 +134,7 @@ jobs:
- check-changed-files-or-halt
- run:
name: "Install golangci-lint"
command: go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.61.0
command: go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.62.2
- run:
name: "golangci-lint/Windows"
# There are only 4 vCPUs available for this executor, so use only 4 instead of the default number
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ jobs:
# Run Linter against code base #
################################
- name: Lint Code Base
uses: super-linter/super-linter@v7.1.0
uses: super-linter/super-linter@v7.2.0
env:
VALIDATE_ALL_CODEBASE: false
DEFAULT_BRANCH: master
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/readme-linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
steps:
- uses: actions/setup-go@v5
with:
go-version: '1.23.2'
go-version: '1.23.4'
- uses: actions/checkout@v4
with:
fetch-depth: 0
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/semantic.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ jobs:
semantic:
uses: influxdata/validate-semantic-github-messages/.github/workflows/semantic.yml@main
with:
CHECK_PR_TITLE_OR_ONE_COMMIT: true
COMMITS_HISTORY: 0

31 changes: 15 additions & 16 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,8 @@ linters-settings:
- codegenComment
- commentedOutCode
- deferInLoop
- dupArg
- deprecatedComment
- dupArg
- dupBranchBody
- dupCase
- dupSubExpr
Expand Down Expand Up @@ -130,8 +130,8 @@ linters-settings:
# performance
- appendCombine
- equalFold
- indexAlloc
- hugeParam
- indexAlloc
- preferDecodeRune
- preferFprint
- preferStringWriter
Expand Down Expand Up @@ -265,6 +265,10 @@ linters-settings:
- name: enforce-map-style
arguments: ["make"]
exclude: [ "TEST" ]
- name: enforce-repeated-arg-type-style
arguments: ["short"]
- name: enforce-slice-style
arguments: ["make"]
- name: error-naming
- name: error-return
- name: error-strings
Expand Down Expand Up @@ -295,16 +299,10 @@ linters-settings:
- name: redundant-import-alias
- name: string-format
arguments:
- - 'fmt.Errorf[0]'
- - 'fmt.Errorf[0],errors.New[0]'
- '/^([^A-Z]|$)/'
- 'Error string must not start with a capital letter.'
- - 'fmt.Errorf[0]'
- '/(^|[^\.!?])$/'
- 'Error string must not end in punctuation.'
- - 'errors.New[0]'
- '/^([^A-Z]|$)/'
- 'Error string must not start with a capital letter.'
- - 'errors.New[0]'
- - 'fmt.Errorf[0],errors.New[0]'
- '/(^|[^\.!?])$/'
- 'Error string must not end in punctuation.'
- - 'panic'
Expand Down Expand Up @@ -343,6 +341,7 @@ linters-settings:
- expected-actual
- float-compare
- formatter
- go-require
- len
- negative-positive
- nil-compare
Expand All @@ -354,11 +353,6 @@ linters-settings:
- suite-thelper
- useless-assert

run:
# Timeout for analysis, e.g. 30s, 5m.
# Default: 1m
timeout: 10m

issues:
# List of regexps of issue texts to exclude.
#
Expand Down Expand Up @@ -397,7 +391,7 @@ issues:
text: "Use of weak random number generator" #gosec:G404

- path-except: ^plugins/(aggregators|inputs|outputs|parsers|processors|serializers)/...
text: "max-public-structs: you have exceeded the maximum number of public struct declarations" #revive:max-public-structs
text: "max-public-structs: you have exceeded the maximum number" #revive:max-public-structs

# Independently of option `exclude` we use default exclude patterns,
# it can be disabled by this option.
Expand Down Expand Up @@ -478,3 +472,8 @@ output:
# Show statistics per linter.
# Default: false
show-stats: true

run:
# Timeout for analysis, e.g. 30s, 5m.
# Default: 1m
timeout: 10m
109 changes: 109 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,111 @@
<!-- markdownlint-disable MD024 -->
# Changelog

## v1.33.0 [2024-12-09]

### New Plugins

- [#15754](https://github.com/influxdata/telegraf/pull/15754) `inputs.neoom_beaam` Add new plugin
- [#15869](https://github.com/influxdata/telegraf/pull/15869) `processors.batch` Add batch processor
- [#16144](https://github.com/influxdata/telegraf/pull/16144) `outputs.quix` Add plugin

### Features

- [#16010](https://github.com/influxdata/telegraf/pull/16010) `agent` Add --watch-interval option for polling config changes
- [#15948](https://github.com/influxdata/telegraf/pull/15948) `aggregators.basicstats` Add first field
- [#15891](https://github.com/influxdata/telegraf/pull/15891) `common.socket` Allow parallel parsing with a pool of workers
- [#16141](https://github.com/influxdata/telegraf/pull/16141) `inputs.amqp_consumer` Allow specification of queue arguments
- [#15950](https://github.com/influxdata/telegraf/pull/15950) `inputs.diskio` Add field io await and util
- [#15919](https://github.com/influxdata/telegraf/pull/15919) `inputs.kafka_consumer` Implement startup error behavior options
- [#15910](https://github.com/influxdata/telegraf/pull/15910) `inputs.memcached` Add support for external-store metrics
- [#15990](https://github.com/influxdata/telegraf/pull/15990) `inputs.mock` Add sine phase
- [#16040](https://github.com/influxdata/telegraf/pull/16040) `inputs.modbus` Allow grouping across register types
- [#15865](https://github.com/influxdata/telegraf/pull/15865) `inputs.prometheus` Allow to use secrets for credentials
- [#16230](https://github.com/influxdata/telegraf/pull/16230) `inputs.smart` Add Power on Hours and Cycle Count
- [#15935](https://github.com/influxdata/telegraf/pull/15935) `inputs.snmp` Add displayhint conversion
- [#16027](https://github.com/influxdata/telegraf/pull/16027) `inputs.snmp` Convert uneven bytes to int
- [#15976](https://github.com/influxdata/telegraf/pull/15976) `inputs.socket_listener` Use reception time as timestamp
- [#15853](https://github.com/influxdata/telegraf/pull/15853) `inputs.statsd` Allow reporting sets and timings count as floats
- [#11591](https://github.com/influxdata/telegraf/pull/11591) `inputs.vsphere` Add VM memory configuration
- [#16109](https://github.com/influxdata/telegraf/pull/16109) `inputs.vsphere` Add cpu temperature field
- [#15917](https://github.com/influxdata/telegraf/pull/15917) `inputs` Add option to choose the metric time source
- [#16242](https://github.com/influxdata/telegraf/pull/16242) `logging` Allow overriding message key for structured logging
- [#15742](https://github.com/influxdata/telegraf/pull/15742) `outputs.influxdb_v2` Add rate limit implementation
- [#15943](https://github.com/influxdata/telegraf/pull/15943) `outputs.mqtt` Add sprig functions for topic name generator
- [#16041](https://github.com/influxdata/telegraf/pull/16041) `outputs.postgresql` Allow limiting of column name length
- [#16258](https://github.com/influxdata/telegraf/pull/16258) `outputs` Add rate-limiting infrastructure
- [#16146](https://github.com/influxdata/telegraf/pull/16146) `outputs` Implement partial write errors
- [#15883](https://github.com/influxdata/telegraf/pull/15883) `outputs` Only copy metric if its not filtered out
- [#15893](https://github.com/influxdata/telegraf/pull/15893) `serializers.prometheusremotewrite` Log metric conversion errors

### Bugfixes

- [#16248](https://github.com/influxdata/telegraf/pull/16248) `inputs.netflow` Decode flags in TCP and IP headers correctly
- [#16257](https://github.com/influxdata/telegraf/pull/16257) `inputs.procstat` Handle running processes correctly across multiple filters
- [#16219](https://github.com/influxdata/telegraf/pull/16219) `logging` Add Close() func for redirectLogger
- [#16255](https://github.com/influxdata/telegraf/pull/16255) `logging` Clean up extra empty spaces when redirectLogger is used
- [#16274](https://github.com/influxdata/telegraf/pull/16274) `logging` Fix duplicated prefix and attrMsg in log message when redirectLogger is used

### Dependency Updates

- [#16232](https://github.com/influxdata/telegraf/pull/16232) `deps` Bump cloud.google.com/go/bigquery from 1.63.1 to 1.64.0
- [#16235](https://github.com/influxdata/telegraf/pull/16235) `deps` Bump cloud.google.com/go/storage from 1.43.0 to 1.47.0
- [#16198](https://github.com/influxdata/telegraf/pull/16198) `deps` Bump github.com/aws/aws-sdk-go-v2/service/cloudwatch from 1.42.2 to 1.43.1
- [#16234](https://github.com/influxdata/telegraf/pull/16234) `deps` Bump github.com/aws/aws-sdk-go-v2/service/kinesis from 1.29.3 to 1.32.6
- [#16201](https://github.com/influxdata/telegraf/pull/16201) `deps` Bump github.com/intel/powertelemetry from 1.0.1 to 1.0.2
- [#16200](https://github.com/influxdata/telegraf/pull/16200) `deps` Bump github.com/rclone/rclone from 1.68.1 to 1.68.2
- [#16199](https://github.com/influxdata/telegraf/pull/16199) `deps` Bump github.com/vishvananda/netns from 0.0.4 to 0.0.5
- [#16236](https://github.com/influxdata/telegraf/pull/16236) `deps` Bump golang.org/x/net from 0.30.0 to 0.31.0
- [#16250](https://github.com/influxdata/telegraf/pull/16250) `deps` Bump golangci-lint from v1.62.0 to v1.62.2
- [#16233](https://github.com/influxdata/telegraf/pull/16233) `deps` Bump google.golang.org/grpc from 1.67.1 to 1.68.0
- [#16202](https://github.com/influxdata/telegraf/pull/16202) `deps` Bump modernc.org/sqlite from 1.33.1 to 1.34.1
- [#16203](https://github.com/influxdata/telegraf/pull/16203) `deps` Bump super-linter/super-linter from 7.1.0 to 7.2.0

## v1.32.3 [2024-11-18]

### 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.

### Bugfixes

- [#16123](https://github.com/influxdata/telegraf/pull/16123) `agent` Restore setup order of stateful plugins to Init() then SetState()
- [#16111](https://github.com/influxdata/telegraf/pull/16111) `common.socket` Make sure the scanner buffer matches the read-buffer size
- [#16156](https://github.com/influxdata/telegraf/pull/16156) `common.socket` Use read buffer size config setting as a datagram reader buffer size
- [#16015](https://github.com/influxdata/telegraf/pull/16015) `inputs.bind` Convert counters to uint64
- [#16171](https://github.com/influxdata/telegraf/pull/16171) `inputs.gnmi` Register connection statistics before creating client
- [#16197](https://github.com/influxdata/telegraf/pull/16197) `inputs.netflow` Cast TCP ports to uint16
- [#16110](https://github.com/influxdata/telegraf/pull/16110) `inputs.ntpq` Avoid panic on empty lines and make sure -p is present
- [#16155](https://github.com/influxdata/telegraf/pull/16155) `inputs.snmp` Fix crash when trying to format fields from unknown OIDs
- [#16145](https://github.com/influxdata/telegraf/pull/16145) `inputs.snmp_trap` Remove timeout deprecation
- [#16108](https://github.com/influxdata/telegraf/pull/16108) `logger` Avoid setting the log-format default too early

### Dependency Updates

- [#16093](https://github.com/influxdata/telegraf/pull/16093) `deps` Bump cloud.google.com/go/pubsub from 1.42.0 to 1.45.1
- [#16175](https://github.com/influxdata/telegraf/pull/16175) `deps` Bump github.com/aws/aws-sdk-go-v2/credentials from 1.17.37 to 1.17.44
- [#16096](https://github.com/influxdata/telegraf/pull/16096) `deps` Bump github.com/gofrs/uuid/v5 from 5.2.0 to 5.3.0
- [#16136](https://github.com/influxdata/telegraf/pull/16136) `deps` Bump github.com/golang-jwt/jwt/v4 from 4.5.0 to 4.5.1
- [#16094](https://github.com/influxdata/telegraf/pull/16094) `deps` Bump github.com/gopacket/gopacket from 1.2.0 to 1.3.0
- [#16133](https://github.com/influxdata/telegraf/pull/16133) `deps` Bump github.com/jackc/pgtype from 1.14.3 to 1.14.4
- [#16131](https://github.com/influxdata/telegraf/pull/16131) `deps` Bump github.com/openconfig/gnmi from 0.10.0 to 0.11.0
- [#16092](https://github.com/influxdata/telegraf/pull/16092) `deps` Bump github.com/prometheus/client_golang from 1.20.4 to 1.20.5
- [#16178](https://github.com/influxdata/telegraf/pull/16178) `deps` Bump github.com/rclone/rclone from 1.67.0 to 1.68.1
- [#16132](https://github.com/influxdata/telegraf/pull/16132) `deps` Bump github.com/shirou/gopsutil/v4 from 4.24.9 to 4.24.10
- [#16176](https://github.com/influxdata/telegraf/pull/16176) `deps` Bump github.com/sijms/go-ora/v2 from 2.8.19 to 2.8.22
- [#16134](https://github.com/influxdata/telegraf/pull/16134) `deps` Bump github.com/testcontainers/testcontainers-go/modules/kafka from 0.33.0 to 0.34.0
- [#16174](https://github.com/influxdata/telegraf/pull/16174) `deps` Bump github.com/tidwall/gjson from 1.17.1 to 1.18.0
- [#16135](https://github.com/influxdata/telegraf/pull/16135) `deps` Bump github.com/vmware/govmomi from 0.39.0 to 0.45.1
- [#16095](https://github.com/influxdata/telegraf/pull/16095) `deps` Bump golang.org/x/sys from 0.25.0 to 0.26.0
- [#16177](https://github.com/influxdata/telegraf/pull/16177) `deps` Bump golang.org/x/text from 0.19.0 to 0.20.0
- [#16172](https://github.com/influxdata/telegraf/pull/16172) `deps` Bump golangci-lint from v1.61.0 to v1.62.0

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

### Bugfixes
Expand Down Expand Up @@ -42,6 +147,10 @@
delivery state update of un-parseable messages from `ACK` to `NACK` without
requeueing. This way, those messages are not lost and can optionally be
handled using a dead-letter exchange by other means.
- Removal of old-style serializer creation. This should not directly affect
users as it is an API change. All serializers in Telegraf are already ported
to the new framework. If you experience any issues with not being able to
create serializers let us know!

### Bugfixes

Expand Down
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ vet:
.PHONY: lint-install
lint-install:
@echo "Installing golangci-lint"
go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.61.0
go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.62.2

@echo "Installing markdownlint"
npm install -g markdownlint-cli
Expand Down Expand Up @@ -257,8 +257,8 @@ plugins/parsers/influx/machine.go: plugins/parsers/influx/machine.go.rl

.PHONY: ci
ci:
docker build -t quay.io/influxdb/telegraf-ci:1.23.2 - < scripts/ci.docker
docker push quay.io/influxdb/telegraf-ci:1.23.2
docker build -t quay.io/influxdb/telegraf-ci:1.23.3 - < scripts/ci.docker
docker push quay.io/influxdb/telegraf-ci:1.23.3

.PHONY: install
install: $(buildbin)
Expand Down
2 changes: 1 addition & 1 deletion agent/accumulator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ func TestSetPrecision(t *testing.T) {

func TestAddTrackingMetricGroupEmpty(t *testing.T) {
ch := make(chan telegraf.Metric, 10)
metrics := []telegraf.Metric{}
metrics := make([]telegraf.Metric, 0)
acc := NewAccumulator(&TestMetricMaker{}, ch).WithTracking(1)

id := acc.AddTrackingMetricGroup(metrics)
Expand Down
18 changes: 7 additions & 11 deletions agent/agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,11 @@ func (a *Agent) Run(ctx context.Context) error {
time.Duration(a.Config.Agent.Interval), a.Config.Agent.Quiet,
a.Config.Agent.Hostname, time.Duration(a.Config.Agent.FlushInterval))

log.Printf("D! [agent] Initializing plugins")
if err := a.InitPlugins(); err != nil {
return err
}

if a.Config.Persister != nil {
log.Printf("D! [agent] Initializing plugin states")
if err := a.initPersister(); err != nil {
Expand All @@ -119,11 +124,6 @@ func (a *Agent) Run(ctx context.Context) error {
}
}

log.Printf("D! [agent] Initializing plugins")
if err := a.InitPlugins(); err != nil {
return err
}

startTime := time.Now()

log.Printf("D! [agent] Connecting outputs")
Expand Down Expand Up @@ -672,11 +672,7 @@ func (a *Agent) runProcessors(
}

// startAggregators sets up the aggregator unit and returns the source channel.
func (a *Agent) startAggregators(
aggC chan<- telegraf.Metric,
outputC chan<- telegraf.Metric,
aggregators []*models.RunningAggregator,
) (chan<- telegraf.Metric, *aggregatorUnit) {
func (a *Agent) startAggregators(aggC, outputC chan<- telegraf.Metric, aggregators []*models.RunningAggregator) (chan<- telegraf.Metric, *aggregatorUnit) {
src := make(chan telegraf.Metric, 100)
unit := &aggregatorUnit{
src: src,
Expand Down Expand Up @@ -815,7 +811,7 @@ func (a *Agent) startOutputs(
return src, unit, nil
}

// connectOutputs connects to all outputs.
// connectOutput connects to all outputs.
func (a *Agent) connectOutput(ctx context.Context, output *models.RunningOutput) error {
log.Printf("D! [agent] Attempting connection to [%s]", output.LogName())
if err := output.Connect(); err != nil {
Expand Down
1 change: 0 additions & 1 deletion agent/agent_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ func TestAgent_LoadOutput(t *testing.T) {
require.Len(t, a.Config.Outputs, 1)

c = config.NewConfig()
c.OutputFilters = []string{}
err = c.LoadConfig("../config/testdata/telegraf-agent.toml")
require.NoError(t, err)
a = NewAgent(c)
Expand Down
10 changes: 4 additions & 6 deletions agent/tick_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,7 @@ func TestAlignedTicker(t *testing.T) {
time.Unix(60, 0).UTC(),
}

actual := []time.Time{}

actual := make([]time.Time, 0)
clk.Add(10 * time.Second)
for !clk.Now().After(until) {
tm := <-ticker.Elapsed()
Expand Down Expand Up @@ -109,8 +108,7 @@ func TestAlignedTickerOffset(t *testing.T) {
time.Unix(53, 0).UTC(),
}

actual := []time.Time{}

actual := make([]time.Time, 0)
clk.Add(10*time.Second + offset)
for !clk.Now().After(until) {
tm := <-ticker.Elapsed()
Expand Down Expand Up @@ -174,7 +172,7 @@ func TestUnalignedTicker(t *testing.T) {
time.Unix(61, 0).UTC(),
}

actual := []time.Time{}
actual := make([]time.Time, 0)
for !clk.Now().After(until) {
select {
case tm := <-ticker.Elapsed():
Expand Down Expand Up @@ -215,7 +213,7 @@ func TestRollingTicker(t *testing.T) {
time.Unix(61, 0).UTC(),
}

actual := []time.Time{}
actual := make([]time.Time, 0)
for !clk.Now().After(until) {
select {
case tm := <-ticker.Elapsed():
Expand Down
2 changes: 1 addition & 1 deletion build_version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.33.0
1.34.0
Loading

0 comments on commit dd2d003

Please sign in to comment.