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

chore(profiling): improve SSI behavior and error messages for profiling #10807

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion ddtrace/profiling/profiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,10 @@ def _build_default_exporters(self):

return []
except Exception as e:
LOG.error("Failed to initialize libdd collector (%s), falling back to the legacy collector", e)
try:
LOG.error("Failed to load libdd (%s) (%s), falling back to legacy mode", e, ddup.failure_msg)
except Exception as ee:
LOG.error("Failed to load libdd (%s) (%s), falling back to legacy mode", e, ee)
self._export_libdd_enabled = False
profiling_config.export.libdd_enabled = False

Expand All @@ -258,6 +261,12 @@ def _build_default_exporters(self):
self._stack_v2_enabled = False
profiling_config.stack.v2_enabled = False

# If this instance of ddtrace was injected, then do not enable profiling, since that will load
# protobuf, breaking some environments.
if profiling_config._injected:
LOG.error("Profiling failures occurred in an injected instance of ddtrace, disabling profiling")
return []

# DEV: Import this only if needed to avoid importing protobuf
# unnecessarily
from ddtrace.profiling.exporter import http
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
fixes:
- |
profiling: Improves the error message when the native exporter fails to load and stops profiling from starting
if ddtrace is also being injected.
Loading