Skip to content

Commit 2bee3f3

Browse files
committed
Fix naming of local config
1 parent 92f0a5a commit 2bee3f3

File tree

4 files changed

+21
-21
lines changed

4 files changed

+21
-21
lines changed

.github/patches/opentelemetry-java-contrib.patch

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ index 00000000..41f22f90
8080
+}
8181
diff --git a/aws-xray/src/main/java/io/opentelemetry/contrib/awsxray/AwsXrayAdaptiveSamplingConfig.java b/aws-xray/src/main/java/io/opentelemetry/contrib/awsxray/AwsXrayAdaptiveSamplingConfig.java
8282
new file mode 100644
83-
index 00000000..836ebf98
83+
index 00000000..b2146f13
8484
--- /dev/null
8585
+++ b/aws-xray/src/main/java/io/opentelemetry/contrib/awsxray/AwsXrayAdaptiveSamplingConfig.java
8686
@@ -0,0 +1,139 @@
@@ -207,17 +207,17 @@ index 00000000..836ebf98
207207
+ @JsonDeserialize(
208208
+ builder = AutoValue_AwsXrayAdaptiveSamplingConfig_ErrorCaptureLimit.Builder.class)
209209
+ public abstract static class ErrorCaptureLimit {
210-
+ @JsonProperty("errorSpansPerSecond")
211-
+ public abstract int getErrorSpansPerSecond();
210+
+ @JsonProperty("errorTracesPerSecond")
211+
+ public abstract int getErrorTracesPerSecond();
212212
+
213213
+ public static Builder builder() {
214214
+ return new AutoValue_AwsXrayAdaptiveSamplingConfig_ErrorCaptureLimit.Builder();
215215
+ }
216216
+
217217
+ @AutoValue.Builder
218218
+ public abstract static class Builder {
219-
+ @JsonProperty("errorSpansPerSecond")
220-
+ public abstract Builder setErrorSpansPerSecond(int value);
219+
+ @JsonProperty("errorTracesPerSecond")
220+
+ public abstract Builder setErrorTracesPerSecond(int value);
221221
+
222222
+ public abstract ErrorCaptureLimit build();
223223
+ }
@@ -902,7 +902,7 @@ index 1ef8abf5..328e63dd 100644
902902
}
903903
}
904904
diff --git a/aws-xray/src/main/java/io/opentelemetry/contrib/awsxray/XrayRulesSampler.java b/aws-xray/src/main/java/io/opentelemetry/contrib/awsxray/XrayRulesSampler.java
905-
index 75977dc0..7cd9bcc5 100644
905+
index 75977dc0..23d3d490 100644
906906
--- a/aws-xray/src/main/java/io/opentelemetry/contrib/awsxray/XrayRulesSampler.java
907907
+++ b/aws-xray/src/main/java/io/opentelemetry/contrib/awsxray/XrayRulesSampler.java
908908
@@ -5,42 +5,81 @@
@@ -1044,10 +1044,10 @@ index 75977dc0..7cd9bcc5 100644
10441044
+
10451045
+ // Initialize anomaly capture rate limiter if error capture limit is configured
10461046
+ if (adaptiveSamplingConfig != null && adaptiveSamplingConfig.getErrorCaptureLimit() != null) {
1047-
+ int errorSpansPerSecond =
1048-
+ adaptiveSamplingConfig.getErrorCaptureLimit().getErrorSpansPerSecond();
1047+
+ int errorTracesPerSecond =
1048+
+ adaptiveSamplingConfig.getErrorCaptureLimit().getErrorTracesPerSecond();
10491049
+ this.anomalyCaptureRateLimiter =
1050-
+ new RateLimiter(errorSpansPerSecond, errorSpansPerSecond, clock);
1050+
+ new RateLimiter(errorTracesPerSecond, errorTracesPerSecond, clock);
10511051
+ }
10521052
}
10531053

@@ -1104,9 +1104,9 @@ index 75977dc0..7cd9bcc5 100644
11041104
+
11051105
+ // Initialize anomaly capture rate limiter if error capture limit is configured
11061106
+ if (config.getErrorCaptureLimit() != null) {
1107-
+ int errorSpansPerSecond = config.getErrorCaptureLimit().getErrorSpansPerSecond();
1107+
+ int errorTracesPerSecond = config.getErrorCaptureLimit().getErrorTracesPerSecond();
11081108
+ this.anomalyCaptureRateLimiter =
1109-
+ new RateLimiter(errorSpansPerSecond, errorSpansPerSecond, clock);
1109+
+ new RateLimiter(errorTracesPerSecond, errorTracesPerSecond, clock);
11101110
+ }
11111111
+ }
11121112
+ }
@@ -2005,7 +2005,7 @@ index 6bb6e82a..6d71711b 100644
20052005
return applier.shouldSample(
20062006
Context.current(),
20072007
diff --git a/aws-xray/src/test/java/io/opentelemetry/contrib/awsxray/XrayRulesSamplerTest.java b/aws-xray/src/test/java/io/opentelemetry/contrib/awsxray/XrayRulesSamplerTest.java
2008-
index 1ca8df34..f6a24af8 100644
2008+
index 1ca8df34..2f25c8af 100644
20092009
--- a/aws-xray/src/test/java/io/opentelemetry/contrib/awsxray/XrayRulesSamplerTest.java
20102010
+++ b/aws-xray/src/test/java/io/opentelemetry/contrib/awsxray/XrayRulesSamplerTest.java
20112011
@@ -5,17 +5,28 @@
@@ -2300,7 +2300,7 @@ index 1ca8df34..f6a24af8 100644
23002300
+ .setVersion(1.0)
23012301
+ .setErrorCaptureLimit(
23022302
+ AwsXrayAdaptiveSamplingConfig.ErrorCaptureLimit.builder()
2303-
+ .setErrorSpansPerSecond(2)
2303+
+ .setErrorTracesPerSecond(2)
23042304
+ .build())
23052305
+ .build();
23062306
+
@@ -2540,7 +2540,7 @@ index 1ca8df34..f6a24af8 100644
25402540
+ .setVersion(1.0)
25412541
+ .setErrorCaptureLimit(
25422542
+ AwsXrayAdaptiveSamplingConfig.ErrorCaptureLimit.builder()
2543-
+ .setErrorSpansPerSecond(2)
2543+
+ .setErrorTracesPerSecond(2)
25442544
+ .build())
25452545
+ .setAnomalyConditions(
25462546
+ Arrays.asList(
@@ -2684,7 +2684,7 @@ index 1ca8df34..f6a24af8 100644
26842684
+ .setVersion(1.0)
26852685
+ .setErrorCaptureLimit(
26862686
+ AwsXrayAdaptiveSamplingConfig.ErrorCaptureLimit.builder()
2687-
+ .setErrorSpansPerSecond(2)
2687+
+ .setErrorTracesPerSecond(2)
26882688
+ .build())
26892689
+ .setAnomalyConditions(
26902690
+ Arrays.asList(
@@ -2752,7 +2752,7 @@ index 1ca8df34..f6a24af8 100644
27522752
+ .setVersion(1.0)
27532753
+ .setErrorCaptureLimit(
27542754
+ AwsXrayAdaptiveSamplingConfig.ErrorCaptureLimit.builder()
2755-
+ .setErrorSpansPerSecond(2)
2755+
+ .setErrorTracesPerSecond(2)
27562756
+ .build())
27572757
+ .setAnomalyConditions(
27582758
+ Arrays.asList(
@@ -2820,7 +2820,7 @@ index 1ca8df34..f6a24af8 100644
28202820
+ .setVersion(1.0)
28212821
+ .setErrorCaptureLimit(
28222822
+ AwsXrayAdaptiveSamplingConfig.ErrorCaptureLimit.builder()
2823-
+ .setErrorSpansPerSecond(2)
2823+
+ .setErrorTracesPerSecond(2)
28242824
+ .build())
28252825
+ .setAnomalyConditions(
28262826
+ Arrays.asList(
@@ -2902,7 +2902,7 @@ index 1ca8df34..f6a24af8 100644
29022902
+ .setVersion(1.0)
29032903
+ .setErrorCaptureLimit(
29042904
+ AwsXrayAdaptiveSamplingConfig.ErrorCaptureLimit.builder()
2905-
+ .setErrorSpansPerSecond(10)
2905+
+ .setErrorTracesPerSecond(10)
29062906
+ .build())
29072907
+ .setAnomalyConditions(
29082908
+ Arrays.asList(

awsagentprovider/src/test/java/software/amazon/opentelemetry/javaagent/providers/AwsApplicationSignalsCustomizerProviderTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ void setAdaptiveSamplingConfigFromFile_validYaml()
8181
// Assert the configuration was parsed correctly
8282
assertThat(config).isNotNull();
8383
assertThat(config.getVersion()).isEqualTo(1);
84-
assertThat(config.getErrorCaptureLimit().getErrorSpansPerSecond()).isEqualTo(10);
84+
assertThat(config.getErrorCaptureLimit().getErrorTracesPerSecond()).isEqualTo(10);
8585
}
8686

8787
@Test

awsagentprovider/src/test/resources/adaptive-sampling-config-invalid.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ anomalyConditions:
1010
operations: invalid part of config
1111
usage: both
1212
errorCaptureLimit:
13-
errorSpansPerSecond: 10
13+
errorTracesPerSecond: 10

awsagentprovider/src/test/resources/adaptive-sampling-config-valid.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ anomalyConditions:
99
- errorCodeRegex: "^2\\d\\d$"
1010
usage: both
1111
errorCaptureLimit:
12-
errorSpansPerSecond: 10
12+
errorTracesPerSecond: 10

0 commit comments

Comments
 (0)