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

Only enable OpenTelemetry when explicitly requested #333

Conversation

tom-binary
Copy link
Contributor

Avoid loading or calling OpenTelemetry unless explicitly enabled, e.g. via

USE_OPENTELEMETRY=1 myriad.pl ...

This is due to stability problems relating to dynamically and cancellation/exception handling: especially on recent versions of Perl, we're seeing various memory corruption issues. Since this is supposed to be an opt-in feature, due to performance hit and that it's not useful without the OpenTelemetry endpoint and infrastructure available, disabling by default was the intended direction anyway.

Symptoms include:

Attempt to free unreferenced scalar: SV 0x5603c40210f8 at /opt/perl-5.40.0/lib/site_perl/5.40.0/OpenTelemetry/Context.pm line 9.

and segmentation faults.

This change attempts to bypass OpenTelemetry (including module load) unless the USE_OPENTELEMETRY environment variable is set. Previously, we'd be creating contexts and spans in some places regardless of whether it was enabled.

@tom-binary tom-binary merged commit 213e18a into deriv-com:master Jul 22, 2024
1 check passed
@tom-binary tom-binary deleted the bugfix/disable_opentelemetry_by_default branch July 22, 2024 06:15
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.

1 participant