Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sumo exporter should not send empty log body attributes #1169

Closed
rupeshnemade opened this issue Jun 19, 2023 · 8 comments · Fixed by #1174
Closed

Sumo exporter should not send empty log body attributes #1169

rupeshnemade opened this issue Jun 19, 2023 · 8 comments · Fixed by #1174
Milestone

Comments

@rupeshnemade
Copy link

When we removes body from the logs with filelog receiver and tries to forward it with Sumo exporter then Sumo renders the key value as Nil.
It's expected that if the value is Nil then key should not appear at all.

image

This code logic needs to be updated to not send blank values.

@swiatekm
Copy link

Yeah, that looks like a bug. You can work around it by setting the Body to the empty string instead of deleting it.

@rupeshnemade
Copy link
Author

rupeshnemade commented Jun 22, 2023

@swiatekm-sumo Is it possible that because of Nil we are seeing tons of below errors?
2023-06-21T14:41:29.458Z warn [email protected]/parser.go:198 failed to execute statement {"kind": "processor", "name": "transform/flatten", "pipeline": "logs/otlp/containers", "error": "expected pcommon.Map but got string", "statement": "merge_maps(attributes, body, \"insert\")"}

Shouldn't 'transform/flatten' set the body to empty? or do we need to set it explicitly? If yes, how to do it?
Right now we are removing body as below from filelog processor
filelog/auditlog: - field: body type: remove

@swiatekm
Copy link

That sounds like an issue in https://github.com/SumoLogic/sumologic-kubernetes-collection. Can you file it there with the configuration you're using?

@rupeshnemade
Copy link
Author

@swiatekm-sumo I still faces the same issue-
I have used public.ecr.aws/sumologic/sumologic-otel-collector:0.80.0-sumo-0-fips image with following rule in 'filelog' receiver-
- field: body type: remove

@swiatekm swiatekm reopened this Jul 6, 2023
@swiatekm
Copy link

swiatekm commented Jul 6, 2023

@rupeshnemade can you add a logging processor to your configuration with verbosity: detailed and post the otel logs showing your data?

@rupeshnemade
Copy link
Author

@swiatekm-sumo Attaching the log file
otel_nil.log

@swiatekm
Copy link

swiatekm commented Jul 6, 2023

This is actually a bug in filelog receiver. The body in your record is actually a nonempty string with the value "<nil>", and this is what the exporter sends to Sumo. The offending logic is here: https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/edad71083ed070e89b46bd569bb9d8d3abdc4ebd/pkg/stanza/adapter/converter.go#L305C13-L305C13, where the receiver should return a pdata Empty value instead of the string.

Can you file this bug upstream?

@rupeshnemade
Copy link
Author

I have opened a bug open-telemetry/opentelemetry-collector-contrib#24017

@swiatekm swiatekm added this to the v0.82.0 milestone Jul 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants