File tree Expand file tree Collapse file tree
src/DDTrace/Integrations/Symfony Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -60,6 +60,7 @@ public function boot()
6060 $ appName = $ this ->getAppName ();
6161 $ symfonyRequestSpan = $ scope ->getSpan ();
6262 $ symfonyRequestSpan ->setTag (Tags \SERVICE_NAME , $ appName );
63+ $ symfonyRequestSpan ->setTag (Tags \ENV , $ this ->getAppEnv ());
6364 $ symfonyRequestSpan ->setTag (Tags \SPAN_TYPE , Types \WEB_SERVLET );
6465 $ request = null ;
6566
@@ -223,4 +224,13 @@ private function getAppName()
223224 return 'symfony ' ;
224225 }
225226 }
227+
228+ private function getAppEnv ()
229+ {
230+ if ($ appName = getenv ('ddtrace_app_env ' )) {
231+ return $ appName ;
232+ } else {
233+ return 'none ' ;
234+ }
235+ }
226236}
Original file line number Diff line number Diff line change @@ -57,6 +57,7 @@ public function boot()
5757 $ scope = $ tracer ->startActiveSpan ('symfony.request ' );
5858 $ symfonyRequestSpan = $ scope ->getSpan ();
5959 $ symfonyRequestSpan ->setTag (Tags \SERVICE_NAME , $ this ->getAppName ());
60+ $ symfonyRequestSpan ->setTag (Tags \ENV , $ this ->getAppEnv ());
6061 $ symfonyRequestSpan ->setTag (Tags \SPAN_TYPE , Types \WEB_SERVLET );
6162
6263 // public function handle(Request $request, $type = HttpKernelInterface::MASTER_REQUEST, $catch = true)
@@ -141,4 +142,13 @@ private function getAppName()
141142 return 'symfony ' ;
142143 }
143144 }
145+
146+ private function getAppEnv ()
147+ {
148+ if ($ appName = getenv ('ddtrace_app_env ' )) {
149+ return $ appName ;
150+ } else {
151+ return 'none ' ;
152+ }
153+ }
144154}
You can’t perform that action at this time.
0 commit comments