Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into postgres
Browse files Browse the repository at this point in the history
* origin/master: (211 commits)
  feat: update configs (influxdata#10676)
  feat[elastic output]: add elastic pipeline flags (influxdata#10505)
  Update changelog
  fix: ensure folders do not get loaded more than once (influxdata#10551)
  docs: update VMWare doc links (influxdata#10663)
  fix: prometheusremotewrite wrong timestamp unit (influxdata#10547)
  feat: update configs (influxdata#10662)
  fix: add graylog toml tags (influxdata#10660)
  feat: add socks5 proxy support for kafka output plugin (influxdata#8192)
  docs: override reported OpenSearch version (influxdata#10586)
  feat: update etc/telegraf.conf and etc/telegraf_windows.conf (influxdata#10659)
  fix: bump all go.opentelemetry.io dependencies (influxdata#10647)
  feat: collection offset implementation (influxdata#10545)
  chore: update go to 1.17.7 (influxdata#10658)
  fix: check for nil client before closing in amqp (influxdata#10635)
  fix: timestamp change during execution of json_v2 parser. (influxdata#10657)
  fix: bump github.com/signalfx/golib/v3 from 3.3.38 to 3.3.43 (influxdata#10652)
  fix: bump github.com/aliyun/alibaba-cloud-sdk-go (influxdata#10653)
  fix: incorrect handling of json_v2 timestamp_path (influxdata#10618)
  feat: gather additional stats from memcached (influxdata#10641)
  feat: update etc/telegraf.conf and etc/telegraf_windows.conf (influxdata#10649)
  fix: Revert deprecation of http_listener_v2 (influxdata#10648)
  fix: bump github.com/denisenkom/go-mssqldb from 0.10.0 to 0.12.0 (influxdata#10503)
  fix: bump github.com/gopcua/opcua from 0.2.3 to 0.3.1 (influxdata#10626)
  fix: use current time as ecs timestamp (influxdata#10636)
  fix: bump github.com/nats-io/nats-server/v2 from 2.6.5 to 2.7.2 (influxdata#10638)
  chore: add -race flag to go tests (influxdata#10629)
  feat: update etc/telegraf.conf and etc/telegraf_windows.conf (influxdata#10631)
  fix: license doc outdated causing CI failure (influxdata#10630)
  fix: bump k8s.io/client-go from 0.22.2 to 0.23.3 (influxdata#10589)
  feat: Implemented support for reading raw values, added tests and doc (influxdata#6501)
  fix: Improve parser tests by using go-cmp/cmp (influxdata#10497)
  feat(mongodb): add FsTotalSize and FsUsedSize informations (influxdata#10625)
  docs: update quay docs for auth (influxdata#10612)
  chore: allow downgrade of go version in windows script (influxdata#10614)
  chore: update CI go to 1.17.6 (influxdata#10611)
  feat: update etc/telegraf.conf and etc/telegraf_windows.conf (influxdata#10600)
  fix(inputs.opcua): add more data to error log (influxdata#10465)
  fix: bump github.com/aws/aws-sdk-go-v2/service/kinesis from 1.6.0 to 1.13.0 (influxdata#10601)
  refactor: use early return pattern (influxdata#10591)
  ...
  • Loading branch information
phemmer committed Feb 18, 2022
2 parents 0e511d6 + 2ca5cfe commit e87744d
Show file tree
Hide file tree
Showing 277 changed files with 19,954 additions and 3,039 deletions.
299 changes: 188 additions & 111 deletions .circleci/config.yml

Large diffs are not rendered by default.

13 changes: 10 additions & 3 deletions .github/ISSUE_TEMPLATE/BUG_REPORT.yml
Expand Up @@ -5,16 +5,23 @@ body:
- type: markdown
attributes:
value: |
Thanks for taking time to fill out this bug report! We reserve Telegraf issues for bugs for reproducible problems.
Thanks for taking time to fill out this bug report! We reserve Telegraf issues for bugs for reproducible problems.
Please redirect any questions about Telegraf usage to our [Community Slack](https://influxdata.com/slack) or [Community Page](https://community.influxdata.com/) we have a lot of talented community members there who could help answer your question more quickly.
- type: textarea
id: config
attributes:
label: Relevent telegraf.conf
label: Relevant telegraf.conf
description: Place config in the toml code section. This will be automatically formatted into toml, so no need for backticks.
render: toml
validations:
required: true
- type: textarea
id: logs
attributes:
label: Logs from Telegraf
description: Please include the Telegraf logs, ideally with `--debug` used.
validations:
required: true
- type: input
id: system-info
attributes:
Expand Down Expand Up @@ -63,4 +70,4 @@ body:
description: Include gist of relevant config, logs, etc.
validations:
required: false

2 changes: 2 additions & 0 deletions .gitignore
Expand Up @@ -9,3 +9,5 @@ process.yml
/.vscode
/*.toml
/*.conf
resource.syso
versioninfo.json
262 changes: 193 additions & 69 deletions CHANGELOG.md

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions EXTERNAL_PLUGINS.md
Expand Up @@ -26,6 +26,8 @@ Pull requests welcome.
- [dht_sensor](https://github.com/iAnatoly/telegraf-input-dht_sensor) - Gather temperature and humidity from DHTXX sensors
- [oracle](https://github.com/bonitoo-io/telegraf-input-oracle) - Gather the statistic data from Oracle RDBMS
- [db2](https://github.com/bonitoo-io/telegraf-input-db2) - Gather the statistic data from DB2 RDBMS
- [apt](https://github.com/x70b1/telegraf-apt) - Check Debian for package updates.
- [knot](https://github.com/x70b1/telegraf-knot) - Collect stats from Knot DNS.

## Outputs

Expand Down
41 changes: 34 additions & 7 deletions Makefile
Expand Up @@ -99,6 +99,16 @@ help:
deps:
go mod download -x

.PHONY: version
version:
@echo $(version)-$(commit)

.PHONY: versioninfo
versioninfo:
go install github.com/josephspurrier/goversioninfo/cmd/goversioninfo@v1.4.0; \
go run scripts/generate_versioninfo/main.go; \
go generate cmd/telegraf/telegraf_windows.go; \

.PHONY: telegraf
telegraf:
go build -ldflags "$(LDFLAGS)" ./cmd/telegraf
Expand Down Expand Up @@ -211,8 +221,8 @@ plugin-%:

.PHONY: ci-1.17
ci-1.17:
docker build -t quay.io/influxdb/telegraf-ci:1.17.3 - < scripts/ci-1.17.docker
docker push quay.io/influxdb/telegraf-ci:1.17.3
docker build -t quay.io/influxdb/telegraf-ci:1.17.7 - < scripts/ci-1.17.docker
docker push quay.io/influxdb/telegraf-ci:1.17.7

.PHONY: install
install: $(buildbin)
Expand All @@ -235,6 +245,7 @@ install: $(buildbin)
# the bin between deb/rpm/tar packages over building directly into the package
# directory.
$(buildbin):
echo $(GOOS)
@mkdir -pv $(dir $@)
go build -o $(dir $@) -ldflags "$(LDFLAGS)" ./cmd/telegraf

Expand Down Expand Up @@ -269,6 +280,10 @@ armhf += linux_armhf.tar.gz freebsd_armv7.tar.gz armhf.deb armv6hl.rpm
armhf:
@ echo $(armhf)
s390x += linux_s390x.tar.gz s390x.deb s390x.rpm
.PHONY: riscv64
riscv64:
@ echo $(riscv64)
riscv64 += linux_riscv64.tar.gz riscv64.rpm riscv64.deb
.PHONY: s390x
s390x:
@ echo $(s390x)
Expand All @@ -284,12 +299,17 @@ windows += windows_i386.zip windows_amd64.zip
.PHONY: windows
windows:
@ echo $(windows)
darwin += darwin_amd64.tar.gz
.PHONY: darwin
darwin:
@ echo $(darwin)
darwin-amd64 += darwin_amd64.tar.gz
.PHONY: darwin-amd64
darwin-amd64:
@ echo $(darwin-amd64)

darwin-arm64 += darwin_arm64.tar.gz
.PHONY: darwin-arm64
darwin-arm64:
@ echo $(darwin-arm64)

include_packages := $(mips) $(mipsel) $(arm64) $(amd64) $(static) $(armel) $(armhf) $(s390x) $(ppc64le) $(i386) $(windows) $(darwin)
include_packages := $(mips) $(mipsel) $(arm64) $(amd64) $(static) $(armel) $(armhf) $(riscv64) $(s390x) $(ppc64le) $(i386) $(windows) $(darwin-amd64) $(darwin-arm64)

.PHONY: package
package: $(include_packages)
Expand Down Expand Up @@ -317,6 +337,7 @@ $(include_packages):
--description "Plugin-driven server agent for reporting metrics into InfluxDB." \
--depends coreutils \
--depends shadow-utils \
--rpm-digest sha256 \
--rpm-posttrans scripts/rpm/post-install.sh \
--name telegraf \
--version $(version) \
Expand Down Expand Up @@ -378,6 +399,9 @@ mips.deb linux_mips.tar.gz: export GOARCH := mips
mipsel.deb linux_mipsel.tar.gz: export GOOS := linux
mipsel.deb linux_mipsel.tar.gz: export GOARCH := mipsle

riscv64.deb riscv64.rpm linux_riscv64.tar.gz: export GOOS := linux
riscv64.deb riscv64.rpm linux_riscv64.tar.gz: export GOARCH := riscv64

s390x.deb s390x.rpm linux_s390x.tar.gz: export GOOS := linux
s390x.deb s390x.rpm linux_s390x.tar.gz: export GOARCH := s390x

Expand All @@ -400,6 +424,9 @@ windows_amd64.zip: export GOARCH := amd64
darwin_amd64.tar.gz: export GOOS := darwin
darwin_amd64.tar.gz: export GOARCH := amd64

darwin_arm64.tar.gz: export GOOS := darwin
darwin_arm64.tar.gz: export GOARCH := arm64

windows_i386.zip: export GOOS := windows
windows_i386.zip: export GOARCH := 386

Expand Down
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -60,7 +60,7 @@ file and install telegraf:
cat <<EOF | sudo tee /etc/yum.repos.d/influxdb.repo
[influxdb]
name = InfluxDB Repository - RHEL $releasever
baseurl = https://repos.influxdata.com/rhel/$releasever/$basearch/stable
baseurl = https://repos.influxdata.com/rhel/\$releasever/\$basearch/stable
enabled = 1
gpgcheck = 1
gpgkey = https://repos.influxdata.com/influxdb.key
Expand Down
2 changes: 1 addition & 1 deletion accumulator.go
Expand Up @@ -41,7 +41,7 @@ type Accumulator interface {
// AddMetric adds an metric to the accumulator.
AddMetric(Metric)

// SetPrecision sets the timestamp rounding precision. All metrics addeds
// SetPrecision sets the timestamp rounding precision. All metrics
// added to the accumulator will have their timestamp rounded to the
// nearest multiple of precision.
SetPrecision(precision time.Duration)
Expand Down
25 changes: 19 additions & 6 deletions agent/agent.go
Expand Up @@ -192,32 +192,39 @@ func (a *Agent) initPlugins() error {
input.LogName(), err)
}
}
for _, parser := range a.Config.Parsers {
err := parser.Init()
if err != nil {
return fmt.Errorf("could not initialize parser %s::%s: %v",
parser.Config.DataFormat, parser.Config.Parent, err)
}
}
for _, processor := range a.Config.Processors {
err := processor.Init()
if err != nil {
return fmt.Errorf("could not initialize processor %s: %v",
processor.Config.Name, err)
processor.LogName(), err)
}
}
for _, aggregator := range a.Config.Aggregators {
err := aggregator.Init()
if err != nil {
return fmt.Errorf("could not initialize aggregator %s: %v",
aggregator.Config.Name, err)
aggregator.LogName(), err)
}
}
for _, processor := range a.Config.AggProcessors {
err := processor.Init()
if err != nil {
return fmt.Errorf("could not initialize processor %s: %v",
processor.Config.Name, err)
processor.LogName(), err)
}
}
for _, output := range a.Config.Outputs {
err := output.Init()
if err != nil {
return fmt.Errorf("could not initialize output %s: %v",
output.Config.Name, err)
output.LogName(), err)
}
}
return nil
Expand Down Expand Up @@ -291,11 +298,17 @@ func (a *Agent) runInputs(
jitter = input.Config.CollectionJitter
}

// Overwrite agent collection_offset if this plugin has its own.
offset := time.Duration(a.Config.Agent.CollectionOffset)
if input.Config.CollectionOffset != 0 {
offset = input.Config.CollectionOffset
}

var ticker Ticker
if a.Config.Agent.RoundInterval {
ticker = NewAlignedTicker(startTime, interval, jitter)
ticker = NewAlignedTicker(startTime, interval, jitter, offset)
} else {
ticker = NewUnalignedTicker(interval, jitter)
ticker = NewUnalignedTicker(interval, jitter, offset)
}
defer ticker.Stop()

Expand Down

0 comments on commit e87744d

Please sign in to comment.