@@ -120,7 +120,9 @@ public void operationFailed(Throwable error) {
120120 if (operationFinished .getAndSet (true )) {
121121 throw new IllegalStateException (OPERATION_FINISHED_STATUS_MESSAGE );
122122 }
123- attributes .put (STATUS_ATTRIBUTE , ObservabilityUtils .extractStatus (error ));
123+ attributes .put (
124+ STATUS_ATTRIBUTE ,
125+ (String ) ObservabilityUtils .extractStatus (error , ApiTracerContext .Transport .GRPC ));
124126 metricsRecorder .recordOperationLatency (
125127 operationTimer .elapsed (TimeUnit .MILLISECONDS ), attributes );
126128 metricsRecorder .recordOperationCount (1 , attributes );
@@ -172,7 +174,9 @@ public void attemptCancelled() {
172174 */
173175 @ Override
174176 public void attemptFailedDuration (Throwable error , java .time .Duration delay ) {
175- attributes .put (STATUS_ATTRIBUTE , ObservabilityUtils .extractStatus (error ));
177+ attributes .put (
178+ STATUS_ATTRIBUTE ,
179+ (String ) ObservabilityUtils .extractStatus (error , ApiTracerContext .Transport .GRPC ));
176180 metricsRecorder .recordAttemptLatency (attemptTimer .elapsed (TimeUnit .MILLISECONDS ), attributes );
177181 metricsRecorder .recordAttemptCount (1 , attributes );
178182 }
@@ -196,7 +200,9 @@ public void attemptFailed(Throwable error, org.threeten.bp.Duration delay) {
196200 */
197201 @ Override
198202 public void attemptFailedRetriesExhausted (Throwable error ) {
199- attributes .put (STATUS_ATTRIBUTE , ObservabilityUtils .extractStatus (error ));
203+ attributes .put (
204+ STATUS_ATTRIBUTE ,
205+ (String ) ObservabilityUtils .extractStatus (error , ApiTracerContext .Transport .GRPC ));
200206 metricsRecorder .recordAttemptLatency (attemptTimer .elapsed (TimeUnit .MILLISECONDS ), attributes );
201207 metricsRecorder .recordAttemptCount (1 , attributes );
202208 }
@@ -210,7 +216,9 @@ public void attemptFailedRetriesExhausted(Throwable error) {
210216 */
211217 @ Override
212218 public void attemptPermanentFailure (Throwable error ) {
213- attributes .put (STATUS_ATTRIBUTE , ObservabilityUtils .extractStatus (error ));
219+ attributes .put (
220+ STATUS_ATTRIBUTE ,
221+ (String ) ObservabilityUtils .extractStatus (error , ApiTracerContext .Transport .GRPC ));
214222 metricsRecorder .recordAttemptLatency (attemptTimer .elapsed (TimeUnit .MILLISECONDS ), attributes );
215223 metricsRecorder .recordAttemptCount (1 , attributes );
216224 }
0 commit comments