You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -41,13 +38,12 @@ static public function getLogger()
41
38
protectedstaticfunctionconfigureInstance()
42
39
{
43
40
44
-
if (class_exists("\DDTrace\GlobalTracer")) {
45
-
self::$hasGlobalTracer = true;
46
-
} else {
41
+
// Check if DDTrace functions are available and warn if not
42
+
if (!function_exists("\DDTrace\logs_correlation_trace_id")) {
47
43
// local envs don't need tracing
48
44
if (getenv("ENVIRONMENT") !== "local") {
49
45
echojson_encode([
50
-
"message" => "Can't find \DDTrace\GlobalTracer class. Did you install the Datadog APM tracer extension? It will allow you to have logs enriched with traces making troubleshooting easier. If you run a cli mode service (such as a worker), did you set the DD_TRACE_CLI_ENABLED env variable?",
46
+
"message" => "Can't find DDTrace functions. Did you install the Datadog APM tracer extension? It will allow you to have logs enriched with traces making troubleshooting easier. If you run a cli mode service (such as a worker), did you set the DD_TRACE_CLI_ENABLED env variable?",
51
47
"level" => 300,
52
48
"level_name" => "WARNING",
53
49
"context" => ["bufflog_error" => "no_tracer"]
@@ -87,15 +83,13 @@ protected static function configureInstance()
87
83
// 'profileID' => $user->getProfileID()
88
84
// );
89
85
90
-
if (self::$hasGlobalTracer) {
86
+
// Add traces information to correlate logs with APM
87
+
if (function_exists('\DDTrace\logs_correlation_trace_id') && function_exists('\dd_trace_peek_span_id')) {
91
88
try {
92
-
// Add traces information to be able to correlate logs with APM
0 commit comments