influxdata / influxdata/telegraf

[agent] buffer_strategy problem with relation to output

Open
#17,414 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Go
Stars
17.8k
Forks
5.8k
Avg merge
1d 20h
Merged PRs (30d)
161

Description

### Relevant telegraf.conf

```toml
[agent]
buffer_strategy = "disk"
buffer_directory = "C:/Program Files/telegraf/buffer"
[[outputs.influxdb_v2]]
alias = "test influx"

urls = ["http://localhost:8086"]
token = "xxx"
organization = "Development"
bucket_tag = "bucket"
exclude_bucket_tag = true
content_encoding = "gzip"
```

### Logs from Telegraf

```text
Not relevant
```

### System info

Telegraf 1.35.3 WinServer2022

### Docker

_No response_

### Steps to reproduce

1. Create an influxdb config that points to a wrong url
2. Inject some metrics
3. Watch the diskbuffer fill
4. Correct the "wrong" url
5. Restart telegraf
6. Observe the log saying the buffer is empty...
7. Change the url back to the wrong address
8. Restart telegraf
9. Watch the buffer be as it reports the correct fullness.

### Expected behavior

I expect the buffer to be linked to an output by name or alias (or configurable buffer name).
This way you can redirect the buffer to a url that accepts your data.
Or make other changes to the configuration of the metric.

### Actual behavior

The buffer seems to be linked to the output based on a hash of the output configuration.
After some changes to the config, the buffer does not seem to get picked up by the output.
Resulting in a new buffer being created and the old one left behind.
Leaving the buffer folder cluttered with old buffers.

*edit: even changing the log_level to debug messes up the connection and somewhat confirms my suspicion of the config hash.

### Additional info

Continuing on this issue: [16981](https://github.com/influxdata/telegraf/issues/16981)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing Telegraf's agent buffer_strategy and output configuration handling, then reproduce the disk-buffer behavior using the listed Windows steps. Compare the buffer identity before and after changing the output URL or log level; done means configuration changes do not strand the existing buffer or leave unexplained stale buffers.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
observability-sre
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.