Skip to content

Commit c8a926f

Browse files
committed
spotless
1 parent d968d3a commit c8a926f

File tree

2 files changed

+10
-14
lines changed

2 files changed

+10
-14
lines changed

internal-api/src/main/java/datadog/trace/api/gateway/InferredProxySpan.java

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,8 @@ public AgentSpanContext start(AgentSpanContext extracted) {
144144
// Prefer x-dd-proxy-resource-path (route) over x-dd-proxy-path (path)
145145
// Use MANUAL_INSTRUMENTATION priority to prevent TagInterceptor from overriding
146146
String routeOrPath = resourcePath != null ? resourcePath : path;
147-
String resourceName = httpMethod != null && routeOrPath != null ? httpMethod + " " + routeOrPath : null;
147+
String resourceName =
148+
httpMethod != null && routeOrPath != null ? httpMethod + " " + routeOrPath : null;
148149
if (resourceName != null) {
149150
span.setResourceName(resourceName, MANUAL_INSTRUMENTATION);
150151
}
@@ -162,9 +163,9 @@ private String header(String name) {
162163
}
163164

164165
/**
165-
* Compute ARN for the API Gateway resource.
166-
* Format for v1 REST: arn:aws:apigateway:{region}::/restapis/{api-id}
167-
* Format for v2 HTTP: arn:aws:apigateway:{region}::/apis/{api-id}
166+
* Compute ARN for the API Gateway resource. Format for v1 REST:
167+
* arn:aws:apigateway:{region}::/restapis/{api-id} Format for v2 HTTP:
168+
* arn:aws:apigateway:{region}::/apis/{api-id}
168169
*/
169170
private String computeArn(String proxySystem, String region, String apiId) {
170171
if (proxySystem == null || region == null || apiId == null) {
@@ -198,10 +199,10 @@ public void finish() {
198199
}
199200

200201
/**
201-
* Copy AppSec tags from the root span to this inferred proxy span.
202-
* This is needed when distributed tracing is active, because AppSec sets tags
203-
* on the absolute root span (via setTagTop), but we need them on the inferred
204-
* proxy span which may be a child of the upstream root span.
202+
* Copy AppSec tags from the root span to this inferred proxy span. This is needed when
203+
* distributed tracing is active, because AppSec sets tags on the absolute root span (via
204+
* setTagTop), but we need them on the inferred proxy span which may be a child of the upstream
205+
* root span.
205206
*/
206207
private void copyAppSecTagsFromRoot() {
207208
AgentSpan rootSpan = this.span.getLocalRootSpan();

internal-api/src/test/java/datadog/trace/api/gateway/InferredProxySpanTests.java

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,13 @@
66
import static datadog.trace.api.gateway.InferredProxySpan.fromContext;
77
import static datadog.trace.api.gateway.InferredProxySpan.fromHeaders;
88
import static java.util.Collections.emptyMap;
9-
import static org.junit.jupiter.api.Assertions.assertEquals;
109
import static org.junit.jupiter.api.Assertions.assertFalse;
1110
import static org.junit.jupiter.api.Assertions.assertNotNull;
1211
import static org.junit.jupiter.api.Assertions.assertNull;
1312
import static org.junit.jupiter.api.Assertions.assertTrue;
1413
import static org.junit.jupiter.params.provider.Arguments.of;
1514

1615
import datadog.context.Context;
17-
import datadog.trace.bootstrap.instrumentation.api.AgentSpan;
18-
import datadog.trace.bootstrap.instrumentation.api.Tags;
1916
import java.util.HashMap;
2017
import java.util.Map;
2118
import java.util.stream.Stream;
@@ -232,9 +229,7 @@ void testSupportedProxySystems(String proxySystem, String expectedSpanName) {
232229
}
233230

234231
static Stream<Arguments> supportedProxySystems() {
235-
return Stream.of(
236-
of("aws-apigateway", "aws.apigateway"),
237-
of("aws-httpapi", "aws.httpapi"));
232+
return Stream.of(of("aws-apigateway", "aws.apigateway"), of("aws-httpapi", "aws.httpapi"));
238233
}
239234

240235
@Test

0 commit comments

Comments
 (0)