File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed
src/Sentry/Laravel/Tracing Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -170,9 +170,7 @@ protected function queryExecutedHandler(DatabaseEvents\QueryExecuted $query): vo
170170 $ queryOrigin = $ this ->resolveQueryOriginFromBacktrace ();
171171
172172 if ($ queryOrigin !== null ) {
173- $ context ->setData (array_merge ($ context ->getData (), [
174- 'db.sql.origin ' => $ queryOrigin
175- ]));
173+ $ context ->setData (array_merge ($ context ->getData (), $ queryOrigin ));
176174 }
177175 }
178176
@@ -184,7 +182,7 @@ protected function queryExecutedHandler(DatabaseEvents\QueryExecuted $query): vo
184182 *
185183 * @return string|null
186184 */
187- private function resolveQueryOriginFromBacktrace (): ?string
185+ private function resolveQueryOriginFromBacktrace (): ?array
188186 {
189187 $ backtraceHelper = $ this ->makeBacktraceHelper ();
190188
@@ -196,7 +194,11 @@ private function resolveQueryOriginFromBacktrace(): ?string
196194
197195 $ filePath = $ backtraceHelper ->getOriginalViewPathForFrameOfCompiledViewPath ($ firstAppFrame ) ?? $ firstAppFrame ->getFile ();
198196
199- return "{$ filePath }: {$ firstAppFrame ->getLine ()}" ;
197+ return [
198+ 'code.filepath ' => $ filePath ,
199+ 'code.function ' => $ firstAppFrame ->getFunctionName (),
200+ 'code.lineno ' => $ firstAppFrame ->getLine (),
201+ ];
200202 }
201203
202204 protected function responsePreparedHandler (RoutingEvents \ResponsePrepared $ event ): void
You can’t perform that action at this time.
0 commit comments