You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When a resource attribute is listed in default_resource_attributes_as_index_labels and also listed in otlp_config as structured_metadata, the default_resource_attributes_as_index_labels behaviour of setting it as an index_label is respected vs the otlp_config overriding this behaviour.
Expected behavior
Not sure as it's not documented, but I was wondering if this should be the case. Example: k8s.pod.name set in default_resource_attributes_as_index_labels, however this is a high cardinality attribute for a tenant so it would be easier to drop rather than set ignore_defaults to true and then have to re-list all the default_resource_attributes_as_index_labels minus k8s.pod.name. I think there probably should be better documentation on what the priority is between default_resource_attributes_as_index_labels and otlp_config, and what happens if the same attribute name is listed multiple times.
it loops through the resource attributes in the OTLP payload, and for each resource attribute it loops through each item in attributes_config checking if the resource attribute is listed under attributes here
So it's based on the order of the items in attributes_config. And because of this https://github.com/grafana/loki/blob/main/pkg/loghttp/push/otlp_config.go#L78-L87 it seems like the default_resource_attributes_as_index_labels is listed first, meaning it will always have priority as that will be the first attributes_config item in the list to be searched. Personally I think the behaviour should be for overrides to have precedence over the defaults.
Environment:
Infrastructure: Kubernetes
Deployment tool: helm
The text was updated successfully, but these errors were encountered:
Describe the bug
When a resource attribute is listed in
default_resource_attributes_as_index_labels
and also listed inotlp_config
asstructured_metadata
, thedefault_resource_attributes_as_index_labels
behaviour of setting it as anindex_label
is respected vs theotlp_config
overriding this behaviour.To Reproduce
Set
Expected behavior
Not sure as it's not documented, but I was wondering if this should be the case. Example:
k8s.pod.name
set indefault_resource_attributes_as_index_labels
, however this is a high cardinality attribute for a tenant so it would be easier to drop rather than setignore_defaults
to true and then have to re-list all thedefault_resource_attributes_as_index_labels
minusk8s.pod.name
. I think there probably should be better documentation on what the priority is betweendefault_resource_attributes_as_index_labels
andotlp_config
, and what happens if the same attribute name is listed multiple times.From my (limited) understanding - based on this
loki/pkg/loghttp/push/otlp.go
Lines 129 to 158 in a56eabe
attributes_config
checking if the resource attribute is listed underattributes
hereloki/pkg/loghttp/push/otlp_config.go
Lines 89 to 101 in a56eabe
So it's based on the order of the items in
attributes_config
. And because of this https://github.com/grafana/loki/blob/main/pkg/loghttp/push/otlp_config.go#L78-L87 it seems like thedefault_resource_attributes_as_index_labels
is listed first, meaning it will always have priority as that will be the first attributes_config item in the list to be searched. Personally I think the behaviour should be for overrides to have precedence over the defaults.Environment:
The text was updated successfully, but these errors were encountered: