@@ -65,7 +65,7 @@ public function process(ProceedingJoinPoint $proceedingJoinPoint): mixed
6565
6666 if ($ this ->isTracingEnabled ) {
6767 $ scope = $ this ->instrumentation ->startSpan (
68- name: $ method . ' ' . Uri::sanitize ($ request ->getUri ()->getPath ()),
68+ name: $ method . ' ' . Uri::sanitize ($ request ->getUri ()->getPath (), $ this -> config -> get ( ' open-telemetry.traces.uri_mask ' , []) ),
6969 spanKind: SpanKind::KIND_CLIENT ,
7070 attributes: [
7171 HttpAttributes::HTTP_REQUEST_METHOD => $ method ,
@@ -128,9 +128,12 @@ private function onFullFilled(?SpanScope $scope, RequestInterface $request, floa
128128 ->createHistogram ('http.client.request.duration ' , 'ms ' )
129129 ->record ($ duration , [
130130 ServerAttributes::SERVER_ADDRESS => $ request ->getUri ()->getHost (),
131- UrlIncubatingAttributes::URL_TEMPLATE => Uri::sanitize ($ request ->getUri ()->getPath ()),
132131 HttpAttributes::HTTP_REQUEST_METHOD => $ request ->getMethod (),
133132 HttpAttributes::HTTP_RESPONSE_STATUS_CODE => $ response ->getStatusCode (),
133+ UrlIncubatingAttributes::URL_TEMPLATE => Uri::sanitize (
134+ $ request ->getUri ()->getPath (),
135+ $ this ->config ->get ('open-telemetry.metrics.uri_mask ' , []),
136+ ),
134137 ]);
135138 }
136139
@@ -156,8 +159,11 @@ private function onRejected(?SpanScope $scope, RequestInterface $request, float
156159 ServerAttributes::SERVER_ADDRESS => $ request ->getUri ()->getHost (),
157160 HttpAttributes::HTTP_REQUEST_METHOD => $ request ->getMethod (),
158161 HttpAttributes::HTTP_RESPONSE_STATUS_CODE => 0 ,
159- UrlIncubatingAttributes::URL_TEMPLATE => Uri::sanitize ($ request ->getUri ()->getPath ()),
160162 ErrorAttributes::ERROR_TYPE => get_class ($ throwable ),
163+ UrlIncubatingAttributes::URL_TEMPLATE => Uri::sanitize (
164+ $ request ->getUri ()->getPath (),
165+ $ this ->config ->get ('open-telemetry.traces.uri_mask ' , []),
166+ ),
161167 ]
162168 );
163169 }
0 commit comments