-
Notifications
You must be signed in to change notification settings - Fork 310
Description
Is your feature request related to a problem? Please describe.
The filter order logic in fluentd ever since #1106 can be seen here.
Specifically in:
func (a PluginStoreByNameById) Less(i, j int) bool {
if a[i].Name == a[j].Name {
if a[i].GetTag() == "**" && a[j].GetTag() != "**" {
return false
}
if a[i].GetTag() != "**" && a[j].GetTag() == "**" {
return true
}
return a[i].GetId() < a[j].GetId()
} else {
return a[i].Name < a[j].Name
}
}
From reading the code, it seems filters with tag ** will be order last no matter the id (which matches my experience).
My argument is that the current ordering is problematic and unintuitive.
Describe the solution you'd like
The more initiative ordering, is to consider the filter k8s name, and then if a ClusterFilter / Filter contains a list of several filters, it should add them in order.
This seems to already happen inside return a[i].GetId() < a[j].GetId(), so the only thing left is to remove the GetTag section.
I understand that this is a breaking change, but the current ordering prevent having ** in as a middle filter, which is useful.
I think this should either be a breaking change in version v4, or add a parameter for the deployment to disable tag ordering.
Workaround
Using customPlugin with some placeholder tag, and then setting the filter to ** in the config section.
Additional context
No response