influxdata / influxdata/telegraf
outputs.prometheus_client overwrites input go_ metrics
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 17.8k
- Forks
- 5.8k
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 161
Description
### Relevant telegraf.conf
```toml
#
# OUTPUTS:
#
[[outputs.prometheus_client]]
listen = ":9273"
#
# INPUTS:
#
[[inputs.cpu]]
percpu = true
totalcpu = true
[[inputs.prometheus]]
urls = ["http://localhost:9090/metrics"]
```
### Logs from Telegraf
```text
/usr/bin/telegraf -config /etc/telegraf/telegraf.conf -config-directory /etc/telegraf/telegraf.d --debug
2025-06-04T11:49:39Z I! Loading config: /etc/telegraf/telegraf.conf
2025-06-04T11:49:39Z I! Loading config: /etc/telegraf/telegraf.d/some-input-config.conf
```
### System info
Telegraf 1.34.4 (git: HEAD@e7ce1e1e)
### Docker
_No response_
### Steps to reproduce
steps
1. have another application provide `go_*` metrics
2. have telegraf scrape and output them
```bash
curl -s "localhost:9273/metrics" | grep goro
# HELP go_goroutines Number of goroutines that currently exist.
# TYPE go_goroutines gauge
go_goroutines 31
```
and from the scrape target at `:9090`
```bash
curl -s http://localhost:9090/metrics | grep goro
# HELP go_goroutines Number of goroutines that currently exist.
# TYPE go_goroutines gauge
go_goroutines 4273
```
### Expected behavior
metrics from the input section get properly labled
### Actual behavior
`go_` metrics provided by application at `localhost:9090/metrics` get ignored and overwritten
### Additional info
_No response_
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the collision using the shown outputs.prometheus_client and inputs.prometheus configuration, then compare the metrics returned by localhost:9273/metrics with the scrape target at :9090/metrics. Done means application-provided go_ metrics are preserved rather than overwritten, while input metrics remain properly labeled.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- observability-sre
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100