sumologic.logs.container.perContainerAnnotationsEnabled
configuration does not work
#3430
Labels
bug
Something isn't working
Describe the bug
Setting
sumologic.logs.container.perContainerAnnotationsEnabled
totrue
does not work in v4.2.0, but worked in v2.9.1 when on fluentd/fluentbit.The cause of this is the
source/containers
processor relies onk8s.container.name
attribute whensumologic.logs.container.perContainerAnnotationsEnabled
is true, but this attribute is not present, as it has been stripped off by the previous processor,sumologic_schema
.Logs
See Anything else do we need to know section below.
Command used to install/upgrade Collection
Using Terraform
helm_release
resource. Not relevant to the bug.Configuration
(probably can set it up to setup the sources and still reproduce this)
To Reproduce
a
andb
, with the annotations:**
"sumologic.com/a.sourceCategory": "foo/a"
**
"sumologic.com/b.sourceCategory": "foo/b"
Expected behavior
Querying Sumo Logic for
_sourceCategory=foo/a
shows logs from containera
and querying for_sourceCategory=foo/b
shows logs from containerb
Actual behavior
Logs are not present when querying for _sourceCategory=foo/a
or _sourceCategory=foo/b
, and are in fact in _sourceCategory=foo/bar`Environment (please complete the following information):
helm ls -n sumologic
): 4.2.0Anything else do we need to know
When debug logging is enabled by adding the following to the Helm values:
and we watch the logs of the log forwarder:
we can see that this is printed a bunch:
This log originates from the source processor.
To check the attributes available to the source processor, do the following:
kubectl -n $NAMESPACE edit configmap/sumologic-sumologic-otelcol-logs
source/containers
kubectl -n $NAMESPACE delete po -l app=sumologic-sumologic-otelcol-logs
kubectl -n $NAMESPACE logs -f -l app=sumologic-sumologic-otelcol-logs --max-log-requests 10 | grep "$POD_ID_OF_LOG_SOURCE" -B 20 -A 20
k8s.container.name
is not present. Repeat the above steps, except additionally remove thesumologic_schema
processork8s.container.name
is presentWorkaround
We can workaround this by setting the config
container_annotations.container_name_key
config on thesource/containers
processor to be the attribute key thatsumologic_schema
creates. Add the following to the Helm chart values:Potential fixes
sumologic_schema
processor should keep thek8s.container.name
attribute around for subsequent processingsource
processor should default tocontainer
instead ofk8s.container.name
source
processorshould set
container_annotations.container_name_key: containeras it is aware that the
sumologic_schemaprocessor executes before
source/containers`.The text was updated successfully, but these errors were encountered: