Skip to content

Commit 944d05c

Browse files
committed
fix: fix typo
1 parent a062871 commit 944d05c

File tree

4 files changed

+17
-17
lines changed

4 files changed

+17
-17
lines changed

sdk-platform-java/gax-java/gax/src/main/java/com/google/api/gax/tracing/GoldenSignalsMetricsTracer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ public void operationFailed(Throwable error) {
9090

9191
private void recordError(Throwable error) {
9292
Map<String, Object> errorAttributes =
93-
ObservabilityUtils.gettErrorAttributes(error, transport);
93+
ObservabilityUtils.getErrorAttributes(error, transport);
9494
attributes.putAll(errorAttributes);
9595
metricsRecorder.recordOperationLatency(
9696
clientRequestTimer.elapsed(TimeUnit.NANOSECONDS) / 1_000_000_000.0, attributes);

sdk-platform-java/gax-java/gax/src/main/java/com/google/api/gax/tracing/ObservabilityUtils.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ private static String redactSensitiveQueryValues(final String rawQuery) {
171171
return Joiner.on('&').join(redactedParams);
172172
}
173173

174-
static Map<String, Object> gettErrorAttributes(
174+
static Map<String, Object> getErrorAttributes(
175175
@Nullable Throwable error, ApiTracerContext.Transport transport) {
176176
Map<String, Object> attributes = new HashMap<>();
177177
StatusCode.Code code = extractStatus(error);

sdk-platform-java/gax-java/gax/src/main/java/com/google/api/gax/tracing/SpanTracer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ private void recordErrorAndEndAttempt(Throwable error) {
218218
return;
219219
}
220220
Map<String, Object> errorAttributes =
221-
ObservabilityUtils.gettErrorAttributes(error, this.apiTracerContext.transport());
221+
ObservabilityUtils.getErrorAttributes(error, this.apiTracerContext.transport());
222222
if (!errorAttributes.isEmpty()) {
223223
attemptSpan.setAllAttributes(ObservabilityUtils.toOtelAttributes(errorAttributes));
224224
}

sdk-platform-java/gax-java/gax/src/test/java/com/google/api/gax/tracing/ObservabilityUtilsTest.java

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -115,44 +115,44 @@ void testToOtelAttributes_shouldMapIntAttributes() {
115115
}
116116

117117
@Test
118-
void testGettErrorAttributes_grpc_success() {
118+
void testGetErrorAttributes_grpc_success() {
119119
Map<String, Object> attributes =
120-
ObservabilityUtils.gettErrorAttributes(null, ApiTracerContext.Transport.GRPC);
120+
ObservabilityUtils.getErrorAttributes(null, ApiTracerContext.Transport.GRPC);
121121
assertThat(attributes)
122122
.containsEntry(ObservabilityAttributes.RPC_RESPONSE_STATUS_ATTRIBUTE, "OK");
123123
}
124124

125125
@Test
126-
void testGettErrorAttributes_grpc_apiException() {
126+
void testGetErrorAttributes_grpc_apiException() {
127127
ApiException error =
128128
new ApiException("fake_error", null, new FakeStatusCode(StatusCode.Code.NOT_FOUND), false);
129129
Map<String, Object> attributes =
130-
ObservabilityUtils.gettErrorAttributes(error, ApiTracerContext.Transport.GRPC);
130+
ObservabilityUtils.getErrorAttributes(error, ApiTracerContext.Transport.GRPC);
131131
assertThat(attributes)
132132
.containsEntry(ObservabilityAttributes.RPC_RESPONSE_STATUS_ATTRIBUTE, "NOT_FOUND");
133133
}
134134

135135
@Test
136-
void testGettErrorAttributes_grpc_cancellationException() {
136+
void testGetErrorAttributes_grpc_cancellationException() {
137137
Throwable error = new java.util.concurrent.CancellationException();
138138
Map<String, Object> attributes =
139-
ObservabilityUtils.gettErrorAttributes(error, ApiTracerContext.Transport.GRPC);
139+
ObservabilityUtils.getErrorAttributes(error, ApiTracerContext.Transport.GRPC);
140140
assertThat(attributes)
141141
.containsEntry(ObservabilityAttributes.RPC_RESPONSE_STATUS_ATTRIBUTE, "CANCELLED");
142142
}
143143

144144
@Test
145-
void testGettErrorAttributes_http_success() {
145+
void testGetErrorAttributes_http_success() {
146146
Map<String, Object> attributes =
147-
ObservabilityUtils.gettErrorAttributes(null, ApiTracerContext.Transport.HTTP);
147+
ObservabilityUtils.getErrorAttributes(null, ApiTracerContext.Transport.HTTP);
148148
assertThat(attributes)
149149
.containsEntry(
150150
ObservabilityAttributes.HTTP_RESPONSE_STATUS_ATTRIBUTE,
151151
(long) StatusCode.Code.OK.getHttpStatusCode());
152152
}
153153

154154
@Test
155-
void testGettErrorAttributes_http_apiExceptionWithIntegerTransportCode() {
155+
void testGetErrorAttributes_http_apiExceptionWithIntegerTransportCode() {
156156
ApiException error =
157157
new ApiException(
158158
"fake_error",
@@ -170,15 +170,15 @@ public Object getTransportCode() {
170170
},
171171
false);
172172
Map<String, Object> attributes =
173-
ObservabilityUtils.gettErrorAttributes(error, ApiTracerContext.Transport.HTTP);
173+
ObservabilityUtils.getErrorAttributes(error, ApiTracerContext.Transport.HTTP);
174174
assertThat(attributes)
175175
.containsEntry(
176176
ObservabilityAttributes.HTTP_RESPONSE_STATUS_ATTRIBUTE,
177177
(long) StatusCode.Code.NOT_FOUND.getHttpStatusCode());
178178
}
179179

180180
@Test
181-
void testGettErrorAttributes_http_apiExceptionWithNonIntegerTransportCode() {
181+
void testGetErrorAttributes_http_apiExceptionWithNonIntegerTransportCode() {
182182
ApiException error =
183183
new ApiException(
184184
"fake_error",
@@ -196,18 +196,18 @@ public Object getTransportCode() {
196196
},
197197
false);
198198
Map<String, Object> attributes =
199-
ObservabilityUtils.gettErrorAttributes(error, ApiTracerContext.Transport.HTTP);
199+
ObservabilityUtils.getErrorAttributes(error, ApiTracerContext.Transport.HTTP);
200200
assertThat(attributes)
201201
.containsEntry(
202202
ObservabilityAttributes.HTTP_RESPONSE_STATUS_ATTRIBUTE,
203203
(long) StatusCode.Code.NOT_FOUND.getHttpStatusCode());
204204
}
205205

206206
@Test
207-
void testGettErrorAttributes_http_cancellationException() {
207+
void testGetErrorAttributes_http_cancellationException() {
208208
Throwable error = new java.util.concurrent.CancellationException();
209209
Map<String, Object> attributes =
210-
ObservabilityUtils.gettErrorAttributes(error, ApiTracerContext.Transport.HTTP);
210+
ObservabilityUtils.getErrorAttributes(error, ApiTracerContext.Transport.HTTP);
211211
assertThat(attributes)
212212
.containsEntry(
213213
ObservabilityAttributes.HTTP_RESPONSE_STATUS_ATTRIBUTE,

0 commit comments

Comments
 (0)