fluent / fluent-bit

Fast and Lightweight Logs and Metrics processor for Linux, BSD, OSX and Windows
https://fluentbit.io
Apache License 2.0
5.73k stars 1.56k forks source link

plugins with same alias, reports metrics only for last matching plugin #6076

Open nicolasparada opened 1 year ago

nicolasparada commented 1 year ago

Bug Report

Describe the bug

When using the same alias for the same plugin instance, only metrics for the last matching instance are produced.

To Reproduce

Given this config:

[INPUT]
    Name dummy
    Alias same
    rate 20
[INPUT]
    Name dummy
    Alias same
    rate 10

I see metrics /api/v1/metrics with only one same plugin with 10 records per second. Then if I change the order:

[INPUT]
    Name dummy
    Alias same
    rate 10
[INPUT]
    Name dummy
    Alias same
    rate 20

Now I see metrics with only one same plugin again, but with 20 records per second.

Expected behavior

Maybe it should not allow giving the same alias. Or it should use the internal instance ID to report metrics when there are more than one instance with the same alias.

Your Environment

patrick-stephens commented 1 year ago

I'd be inclined to say it should fail with a config error here: you may be relying on that alias for alerting or other monitoring so silently altering it (e.g. to another ID) is not a good idea as now you will be watching the wrong metrics.

github-actions[bot] commented 1 year ago

This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 5 days. Maintainers can add the exempt-stale label.

github-actions[bot] commented 1 year ago

This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 5 days. Maintainers can add the exempt-stale label.

nicolasparada commented 1 year ago

This still happens even on v2.0.10.

agup006 commented 1 year ago

alias + instance id simliar to other plugins is my vote

patrick-stephens commented 1 year ago

I'm not a fan of instance ID as it is not consistent though, particularly when you use @include with wildcards which deliberately does not enforce any ordering. It means you can run the same config twice (particularly from configmaps in K8S) and get two different orders for instance IDs.

Using the same alias should be a failure I think.