Skip to content

Commit

Permalink
Add combined meta method (#586)
Browse files Browse the repository at this point in the history
  • Loading branch information
stayallive committed Oct 12, 2022
1 parent ca28be0 commit 3cfb462
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions src/Sentry/Laravel/Integration.php
Expand Up @@ -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
*/
Expand All @@ -227,13 +238,11 @@ public static function sentryTracingMeta(): string
return '';
}

$content = sprintf('<meta name="sentry-trace" content="%s"/>', $span->toTraceparent());

return $content;
return sprintf('<meta name="sentry-trace" content="%s"/>', $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
Expand All @@ -246,9 +255,7 @@ public static function sentryBaggageMeta(): string
return '';
}

$content = sprintf('<meta name="baggage" content="%s"/>', $span->toBaggage());

return $content;
return sprintf('<meta name="baggage" content="%s"/>', $span->toBaggage());
}

/**
Expand Down

0 comments on commit 3cfb462

Please sign in to comment.