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

feat[opentelemetry-collector]: add support for multiline recombine from container parser #1364

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

paulojmdias
Copy link

The current container operator cannot handle multiline messages like Java stack traces.

This PR adds the needed recombine operator to make it work. Probably in the future, this makes sense to be moved into the container operator itself.

2024-10-02 13:23:27.062 ERROR a.b.c.SolrConnection.dummyFunction ZURL:zookeeper:2181   Exception deleting users for team[123456789] org.apache.solr.common.SolrException: Could not find a healthy node to handle the request.
	at org.apache.solr.client.solrj.impl.CloudSolrClient.sendRequest(CloudSolrClient.java:1085)
	at org.apache.solr.client.solrj.impl.CloudSolrClient.requestWithRetryOnStaleState(CloudSolrClient.java:871)
	at org.apache.solr.client.solrj.impl.CloudSolrClient.requestWithRetryOnStaleState(CloudSolrClient.java:954)
	at org.apache.solr.client.solrj.impl.CloudSolrClient.requestWithRetryOnStaleState(CloudSolrClient.java:954)
	at org.apache.solr.client.solrj.impl.CloudSolrClient.requestWithRetryOnStaleState(CloudSolrClient.java:954)
	at org.apache.solr.client.solrj.impl.CloudSolrClient.requestWithRetryOnStaleState(CloudSolrClient.java:954)
	at org.apache.solr.client.solrj.impl.CloudSolrClient.requestWithRetryOnStaleState(CloudSolrClient.java:954)
	at org.apache.solr.client.solrj.impl.CloudSolrClient.request(CloudSolrClient.java:807)
	at org.apache.solr.client.solrj.SolrRequest.process(SolrRequest.java:150)
	at org.apache.solr.client.solrj.SolrRequest.process(SolrRequest.java:167)
...

Copy link

linux-foundation-easycla bot commented Oct 2, 2024

CLA Signed


The committers listed above are authorized under a signed CLA.

Comment on lines +182 to +188
# combine multiline logs (e.g. stack traces)
- id: recombine-multiline
type: recombine
combine_field: body
is_first_entry: body matches "^[^\\s]"
source_identifier: attributes["log.file.path"]
max_log_size: {{ $.Values.presets.logsCollection.maxRecombineLogSize }}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happens to logs that don't need recombined? Does this add performance overhead?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Regarding resources usage, we don't see any performance penalty. Below you can see the average CPU and memory usage before and after this add.

Before:
image

image

After:

image image

Is there any other metric that we can take an eye?

Does it make sense to add this using a feature toggle on values.yaml instead of force use it?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this is a preset config, I'm trying to understand if recombine is universally helpful and wont impact any users who don't need it.

If it negatively affects users who don't need to recombine logs, then it would be better for you to configure the filelog's operators manually instead of including it automatically in the preset's config.

Copy link
Author

@paulojmdias paulojmdias Oct 2, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Technically isn't seems so, but I understand your point.

I still see value on this recombine or dynamically support custom operator additions to the Kubernetes filelog receiver without copying paste everything and lose future updates.

Let me also give you some possibilities to think about it:

  • Add a feature toggle on values to add this block on this preset config
  • Add a new hash on values with this new value as default to be used and anyone can make it empty if they want to disable
  • Add a new hash on values to support custom operators for this Kubernetes filelog receiver with an empty value as default

Let me know what do you think about it

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 this pull request may close these issues.

2 participants