influxdata / influxdata/telegraf

outputs.prometheus_client overwrites input go_ metrics

Open
#17,108 0 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
#
# 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

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

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.