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

Move bpfTraceCache and umTraceCache from tracehandler to reporter #273

Open
mchataigner opened this issue Dec 10, 2024 · 1 comment
Open

Comments

@mchataigner
Copy link
Contributor

Currently, the tracehandler is caching already seen traces and already converted traces in 2 LRU.
If the value is already in one or the other, it will not call reporter.ReportFramesForTrace but only reporter.ReportCountForTrace.

I feel that the cache responsibility should be moved to the reporter as only it knows if it has seen enough (or kept in cache enough) data to handle a trace or if it needs the frames again.

I saw the new trace_event protocol, but it’s always converting the trace and sending all frames to the reporter. I feel that it costs more in terms of performances but I did not measure this extensively.

On a side note, if the reporter is supporting trace_events, then you may skip adding the trace hash to bpfTraceCache as it’s not used in this case.

@florianl
Copy link
Contributor

repoter.ReportFramesForTrace() will always be called if reporter.SupportsReportTraceEvent() returns true. Only if reporter.SupportsReportTraceEvent() returns false, then reporter.ReportCountForTrace() will be called.
So with returning true or false independent implementations of package reporter can change this behaviour. With OTel the focus is on a more stateless protocol, while it is possible to implement a more statefull protocol - e.g. by using reporter.ReportCountForTrace() and just reporting counts for traces and not all frames for a trace every time.

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

No branches or pull requests

2 participants