Skip to content

Commit e9f6582

Browse files
Copilottrask
andcommitted
Changes before error encountered
Co-authored-by: trask <[email protected]>
1 parent faa6e69 commit e9f6582

File tree

5 files changed

+10
-7
lines changed

5 files changed

+10
-7
lines changed

aws-xray/src/main/java/io/opentelemetry/contrib/awsxray/AwsAttributeKeys.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@
1212
/** Utility class holding attribute keys with special meaning to AWS components */
1313
final class AwsAttributeKeys {
1414

15-
private AwsAttributeKeys() {}
16-
1715
static final AttributeKey<String> AWS_SPAN_KIND = stringKey("aws.span.kind");
1816

1917
static final AttributeKey<String> AWS_LOCAL_SERVICE = stringKey("aws.local.service");
@@ -35,4 +33,6 @@ private AwsAttributeKeys() {}
3533
static final AttributeKey<String> AWS_QUEUE_NAME = stringKey("aws.queue.name");
3634
static final AttributeKey<String> AWS_STREAM_NAME = stringKey("aws.stream.name");
3735
static final AttributeKey<String> AWS_TABLE_NAME = stringKey("aws.table.name");
36+
37+
private AwsAttributeKeys() {}
3838
}

aws-xray/src/main/java/io/opentelemetry/contrib/awsxray/AwsXrayRemoteSampler.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
import static java.util.concurrent.TimeUnit.NANOSECONDS;
99
import static java.util.concurrent.TimeUnit.SECONDS;
10+
import static java.util.logging.FINE;
1011
import static java.util.stream.Collectors.toList;
1112
import static java.util.stream.Collectors.toMap;
1213
import static java.util.stream.Collectors.toSet;
@@ -149,7 +150,7 @@ private void getAndUpdateSampler() {
149150
executor.schedule(this::fetchTargets, DEFAULT_TARGET_INTERVAL_NANOS, NANOSECONDS);
150151
}
151152
} catch (Throwable t) {
152-
logger.log(Level.FINE, "Failed to update sampler", t);
153+
logger.log(FINE, "Failed to update sampler", t);
153154
}
154155
scheduleSamplerUpdate();
155156
}

aws-xray/src/main/java/io/opentelemetry/contrib/awsxray/XrayRulesSampler.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55

66
package io.opentelemetry.contrib.awsxray;
77

8+
import static java.util.logging.Level.FINE;
9+
810
import io.opentelemetry.api.common.Attributes;
911
import io.opentelemetry.api.trace.SpanKind;
1012
import io.opentelemetry.context.Context;
@@ -84,7 +86,7 @@ public SamplingResult shouldSample(
8486
// In practice, X-Ray always returns a Default rule that matches all requests so it is a bug in
8587
// our code or X-Ray to reach here, fallback just in case.
8688
logger.log(
87-
Level.FINE,
89+
FINE,
8890
"No sampling rule matched the request. "
8991
+ "This is a bug in either the OpenTelemetry SDK or X-Ray.");
9092
return fallbackSampler.shouldSample(

aws-xray/src/test/java/io/opentelemetry/contrib/awsxray/ResourceHolderTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
* Unit tests for {@link ResourceHolder}. Note that there isn't a great way to test the "default"
2222
* fallback logic, as when the test suite is run, the customize logic appears to be invoked.
2323
*/
24-
public class ResourceHolderTest {
24+
class ResourceHolderTest {
2525

2626
@Test
2727
@SuppressWarnings("unchecked")

aws-xray/src/test/java/io/opentelemetry/contrib/awsxray/XrayRulesSamplerTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55

66
package io.opentelemetry.contrib.awsxray;
77

8+
import static io.opentelemetry.api.common.AttributeKey.stringKey;
89
import static org.assertj.core.api.Assertions.assertThat;
910

10-
import io.opentelemetry.api.common.AttributeKey;
1111
import io.opentelemetry.api.common.Attributes;
1212
import io.opentelemetry.api.trace.SpanKind;
1313
import io.opentelemetry.api.trace.TraceId;
@@ -175,7 +175,7 @@ private static SamplingResult doSample(Sampler sampler, String name) {
175175
TraceId.fromLongs(1, 2),
176176
name,
177177
SpanKind.CLIENT,
178-
Attributes.of(AttributeKey.stringKey("test"), name),
178+
Attributes.of(stringKey("test"), name),
179179
Collections.emptyList());
180180
}
181181
}

0 commit comments

Comments
 (0)