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

Otel event reporting in Laravel Cache listener: Performance issue with long Queue::work, consider alternative (Span?) #1411

Open
flc1125 opened this issue Oct 18, 2024 · 3 comments
Assignees

Comments

@flc1125
Copy link
Member

flc1125 commented Oct 18, 2024

A discussion. Regarding the Cache event listener of Laravel, it is currently reported based on Otel’s Event. But when a single Queue::work execution takes a very long time, the number of Events of a single Span will be very large, which will affect performance and the size of the reported data.

The minimum reporting unit of OTEL is a single Span, and the Event will be reported together as part of the data of the Span. If a single Span is very large, it is a burden in terms of network occupation, data size, etc.

Even before the reporting, the data stays in the memory, which is also a very big risk for the application.

Do we need to consider changing a way for reporting, for example: Span, etc.

A sample data:

image

@ChrisLightfootWild ChrisLightfootWild self-assigned this Oct 23, 2024
@ChrisLightfootWild
Copy link
Contributor

Hey @flc1125 . Nice find - I'm going to test this locally and see if I can gain a better understanding of how we might overcome this.

@LauJosefsen
Copy link

LauJosefsen commented Dec 13, 2024

@ChrisLightfootWild
I had a shower thought the other day. Could we not allow custom commands to specify if they are long running, and have a whitelist of built-in commands that should not be spanned? Such as queue:work and octane:start etc?

Maybe it could even be an attribute?

Maybe also an env to merge into the whitelisted commands, for vendor commands etc.

#[LongRunningCommand]
class KafkaConsumer extends Command

I'll be happy to contribute the needed changes :)

@flc1125
Copy link
Member Author

flc1125 commented Dec 13, 2024

Information as a supplement is provided for reference: https://opentelemetry.io/docs/specs/otel/configuration/sdk-environment-variables/#span-limits

It should be because of the OTEL_SPAN_EVENT_COUNT_LIMIT configuration, so the event with the largest single span only supports 128. So, my dashboard sees 128.


Hope that helps.

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

3 participants