From 9a5acdeb224ea09678042fd017a022d7fe55cc4a Mon Sep 17 00:00:00 2001 From: Alex Bouma Date: Mon, 10 Oct 2022 23:06:17 +0200 Subject: [PATCH] Add combined meta method --- src/Sentry/Laravel/Integration.php | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/src/Sentry/Laravel/Integration.php b/src/Sentry/Laravel/Integration.php index 49cd62e8..6254d84b 100644 --- a/src/Sentry/Laravel/Integration.php +++ b/src/Sentry/Laravel/Integration.php @@ -216,6 +216,17 @@ private static function extractNameForActionRoute(string $action): string /** * Retrieve the meta tags with tracing information to link this request to front-end requests. + * This propagates the Dynamic Sampling Context. + * + * @return string + */ + public static function sentryMeta(): string + { + return self::sentryTracingMeta() . self::sentryBaggageMeta(); + } + + /** + * Retrieve the `sentry-trace` meta tag with tracing information to link this request to front-end requests. * * @return string */ @@ -227,13 +238,11 @@ public static function sentryTracingMeta(): string return ''; } - $content = sprintf('', $span->toTraceparent()); - - return $content; + return sprintf('', $span->toTraceparent()); } /** - * Retrieve the meta tags with baggage information to link this request to front-end requests. + * Retrieve the `baggage` meta tag with information to link this request to front-end requests. * This propagates the Dynamic Sampling Context. * * @return string @@ -246,9 +255,7 @@ public static function sentryBaggageMeta(): string return ''; } - $content = sprintf('', $span->toBaggage()); - - return $content; + return sprintf('', $span->toBaggage()); } /**