File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change 88use AnzuSystems \Contracts \Exception \AppReadOnlyModeException ;
99use DateTimeImmutable ;
1010use RuntimeException ;
11+ use Sentry \SentrySdk ;
12+ use Sentry \State \Scope ;
1113
1214class AnzuApp
1315{
@@ -89,7 +91,7 @@ public static function getUserIdConsole(): int
8991 public static function getContextId (): string
9092 {
9193 if ('' === self ::$ contextId ) {
92- self ::$ contextId = ( string ) uuid_create ();
94+ self ::setContextId (( string ) uuid_create () );
9395 }
9496
9597 return self ::$ contextId ;
@@ -98,6 +100,12 @@ public static function getContextId(): string
98100 public static function setContextId (string $ contextId ): void
99101 {
100102 self ::$ contextId = $ contextId ;
103+
104+ if (class_exists (SentrySdk::class)) {
105+ SentrySdk::getCurrentHub ()->configureScope (function (Scope $ scope ) {
106+ $ scope ->setTag ('contextId ' , self ::$ contextId );
107+ });
108+ }
101109 }
102110
103111 public static function getAppEnv (): string
You can’t perform that action at this time.
0 commit comments