Skip to content

Commit 425141a

Browse files
committed
update X-Ray SDK for Java to 1.0.5-beta
1 parent ba6d334 commit 425141a

File tree

3 files changed

+14
-17
lines changed

3 files changed

+14
-17
lines changed

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ dependencies {
4040
dependencyManagement {
4141
imports {
4242
mavenBom("com.amazonaws:aws-java-sdk-bom:1.11.67")
43-
mavenBom("com.amazonaws:aws-xray-recorder-sdk-bom:1.0.4-beta")
43+
mavenBom("com.amazonaws:aws-xray-recorder-sdk-bom:1.0.5-beta")
4444
}
4545
}
4646
task wrapper(type: Wrapper) {

src/main/java/scorekeep/WebConfig.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import com.amazonaws.xray.javax.servlet.AWSXRayServletFilter;
66
import com.amazonaws.xray.plugins.EC2Plugin;
77
import com.amazonaws.xray.plugins.ElasticBeanstalkPlugin;
8-
import com.amazonaws.xray.strategy.sampling.DefaultSamplingStrategy;
8+
import com.amazonaws.xray.strategy.sampling.LocalizedSamplingStrategy;
99
import org.springframework.context.annotation.Bean;
1010
import org.springframework.context.annotation.Configuration;
1111

@@ -30,7 +30,7 @@ public Filter SimpleCORSFilter() {
3030
AWSXRayRecorderBuilder builder = AWSXRayRecorderBuilder.standard().withPlugin(new EC2Plugin()).withPlugin(new ElasticBeanstalkPlugin());
3131

3232
URL ruleFile = WebConfig.class.getResource("/sampling-rules.json");
33-
builder.withSamplingStrategy(new DefaultSamplingStrategy(ruleFile));
33+
builder.withSamplingStrategy(new LocalizedSamplingStrategy(ruleFile));
3434

3535
AWSXRay.setGlobalRecorder(builder.build());
3636
}
Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,25 @@
11
{
2-
"rules": {
3-
"user": {
4-
"id": 1,
2+
"version": 1,
3+
"rules": [
4+
{
5+
"description": "User creation.",
56
"service_name": "*",
67
"http_method": "POST",
78
"url_path": "/api/user",
89
"fixed_target": 10,
910
"rate": 1.0
1011
},
11-
"move": {
12-
"id": 2,
12+
{
13+
"description": "Player moves.",
1314
"service_name": "*",
1415
"http_method": "*",
1516
"url_path": "/api/move/*",
1617
"fixed_target": 1,
1718
"rate": 0.05
18-
},
19-
"base": {
20-
"id": 3,
21-
"service_name": "*",
22-
"http_method": "*",
23-
"url_path": "*",
24-
"fixed_target": 10,
25-
"rate": 0.25
2619
}
20+
],
21+
"default": {
22+
"fixed_target": 1,
23+
"rate": 0.1
2724
}
28-
}
25+
}

0 commit comments

Comments
 (0)