telegraf icon indicating copy to clipboard operation
telegraf copied to clipboard

namedrop are not honored

Open jryberg opened this issue 8 months ago • 2 comments

Relevant telegraf.conf

[[inputs.docker]]
  namedrop = ["docker_container_cpu_container_id"]
  endpoint = "unix:///var/run/docker.sock"
  perdevice = false
  perdevice_include = ["cpu"]

Logs from Telegraf

2025-04-23T08:34:29Z E! [serializers.prometheusremotewrite::http] some series were dropped, 1280 series left to send; last recorded error: failed to parse "docker_container_cpu_container_id": bad sample value "d6a4fd0573cfd669aea5dda3ff15eb8069440e2b9a3c8f9b3e071b41c4d491fb"
2025-04-23T08:34:29Z E! [serializers.prometheusremotewrite::http] some series were dropped, 1280 series left to send; last recorded error: failed to parse "docker_container_cpu_container_id": bad sample value "d6a4fd0573cfd669aea5dda3ff15eb8069440e2b9a3c8f9b3e071b41c4d491fb"
2025-04-23T08:35:29Z E! [serializers.prometheusremotewrite::http] some series were dropped, 1378 series left to send; last recorded error: failed to parse "docker_container_cpu_container_id": bad sample value "34c106efcbc121cf551b108202a3d6dbca68ffabfa1a5724ccbf5869faa19427"
2025-04-23T08:35:29Z E! [serializers.prometheusremotewrite::http] some series were dropped, 1378 series left to send; last recorded error: failed to parse "docker_container_cpu_container_id": bad sample value "34c106efcbc121cf551b108202a3d6dbca68ffabfa1a5724ccbf5869faa19427"
2025-04-23T08:36:29Z E! [serializers.prometheusremotewrite::http] some series were dropped, 1378 series left to send; last recorded error: failed to parse "docker_container_cpu_container_id": bad sample value "573d548b231f4713bb68df543cc365375be76f33ed1dd683564e6c889763001b"
2025-04-23T08:36:29Z E! [serializers.prometheusremotewrite::http] some series were dropped, 1378 series left to send; last recorded error: failed to parse "docker_container_cpu_container_id": bad sample value "573d548b231f4713bb68df543cc365375be76f33ed1dd683564e6c889763001b"
2025-04-23T08:37:29Z E! [serializers.prometheusremotewrite::http] some series were dropped, 1378 series left to send; last recorded error: failed to parse "docker_container_cpu_container_id": bad sample value "df50386f5bd614dec7dd85e1843181d5876a6f320344d3f96b2b9641f2e8212c"
2025-04-23T08:37:29Z E! [serializers.prometheusremotewrite::http] some series were dropped, 1378 series left to send; last recorded error: failed to parse "docker_container_cpu_container_id": bad sample value "df50386f5bd614dec7dd85e1843181d5876a6f320344d3f96b2b9641f2e8212c"
2025-04-23T08:38:29Z E! [serializers.prometheusremotewrite::http] some series were dropped, 1378 series left to send; last recorded error: failed to parse "docker_container_cpu_container_id": bad sample value "a4148c7a257041d75c185eb4594e3cf249df0c9106275bf93d53a2a5f446aad2"
2025-04-23T08:38:29Z E! [serializers.prometheusremotewrite::http] some series were dropped, 1378 series left to send; last recorded error: failed to parse "docker_container_cpu_container_id": bad sample value "a4148c7a257041d75c185eb4594e3cf249df0c9106275bf93d53a2a5f446aad2"
2025-04-23T08:39:29Z E! [serializers.prometheusremotewrite::http] some series were dropped, 1378 series left to send; last recorded error: failed to parse "docker_container_cpu_container_id": bad sample value "d6a4fd0573cfd669aea5dda3ff15eb8069440e2b9a3c8f9b3e071b41c4d491fb"
2025-04-23T08:39:29Z E! [serializers.prometheusremotewrite::http] some series were dropped, 1378 series left to send; last recorded error: failed to parse "docker_container_cpu_container_id": bad sample value "d6a4fd0573cfd669aea5dda3ff15eb8069440e2b9a3c8f9b3e071b41c4d491fb"

System info

Docker 28.1.1, OS: Debian Bookworm, Telegraf 1.34.2 (git: HEAD@552f7e20)

Docker

No response

Steps to reproduce

Run any output.http with prometheusremotewrite enabled and try to drop metrics that are invalid

Expected behavior

Dropped metrics from the input should not be available for any outputs

Actual behavior

Dropped metrics are still processed by the outputs

Additional info

No response

jryberg avatar Apr 23 '25 08:04 jryberg

Please verify with --test, but docker_container_cpu_container_id is not the name of a metric. (docker_container_cpu is and container_id is a field of that metric)

Hipska avatar Apr 28 '25 14:04 Hipska

@Hipska , Sorry. I was just using what the log output told me was the metric name. I guess some logs are including fields as a compound name of sorts for the resulting metrics for the output.

I will try to change my filters

jryberg avatar May 15 '25 10:05 jryberg

@jryberg is this a real issue or can we close the issue? If so, can you please provide the "raw", unfiltered (and redacted) metrics for me to reproduce the issue?

srebhan avatar Nov 10 '25 07:11 srebhan

@srebhan , you can probably close it.

It was just hard to know the difference between the metric name and the field value since both might contain one or more underscore

I think it's not a bug, but the message is also not helpful.

It would be nice it the message was something like:

2025-04-23T08:36:29Z E! [serializers.prometheusremotewrite::http] some series were dropped, 1378 series left to send; last recorded error: failed to parse "docker_container_cpu", field "container_id": bad sample value "573d548b231f4713bb68df543cc365375be76f33ed1dd683564e6c889763001b"

But I have since then learned how do deal with it. It's just about user experience

jryberg avatar Nov 10 '25 08:11 jryberg

Thanks for reporting back @jryberg!

srebhan avatar Nov 11 '25 10:11 srebhan