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

[receiver/splunkhec] Avoid a memory leak #35989

Closed
wants to merge 1 commit into from

Conversation

atoulme
Copy link
Contributor

@atoulme atoulme commented Oct 25, 2024

Description

Avoid a memory leak by not recording obsreports if the receiver is used for both logs and metrics.

Link to tracking issue

Fixes #35294

…if the receiver is used for both logs and metrics.
@dmitryax
Copy link
Member

I don’t think this should be fixed this way. It's going to be very confusing why it only works if enabled on one type of pipeline. It’s currently a mishmash of logs/metrics reporting if both are enabled. This is likely what is causing all the problems. Instead of spreading around obsrecv.EndLogsOp and obsrecv.EndMetricsOp, I think we need to wrap only metricsConsumer.ConsumeMetrics and logsConsumer.ConsumeLogs, same as done in otlp receiver

	ctx = r.obsreport.StartMetricsOp(ctx)
	err := r.metricsConsumer.ConsumeMetrics(ctx, md)
	r.obsreport.EndMetricsOp(ctx, dataFormat, dataPointCount, err)

And, instrumentation of the HTTP server should be done separately if it's not currently enabled

@atoulme
Copy link
Contributor Author

atoulme commented Nov 2, 2024

Closing in favor of #36146

@atoulme atoulme closed this Nov 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Splunk Hec Receiver - Memory Leak (Cont of #34886)
3 participants