Skip to content

Commit 5c5f89a

Browse files
committed
instrument app initialization
1 parent efd76c7 commit 5c5f89a

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

src/main/java/scorekeep/RdsWebConfig.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ public void schemaExport() {
8080
MetadataImplementor metadataImplementor = (MetadataImplementor) metadataSources.buildMetadata(standardServiceRegistry);
8181
SchemaExport schemaExport = new SchemaExport(standardServiceRegistry, metadataImplementor);
8282

83-
AWSXRay.beginSegment("Scorekeep");
83+
AWSXRay.beginSegment("Scorekeep-init");
8484
schemaExport.create(true, true);
8585
AWSXRay.endSegment();
8686
}
@@ -90,5 +90,13 @@ public void schemaExport() {
9090
URL ruleFile = WebConfig.class.getResource("/sampling-rules.json");
9191
builder.withSamplingStrategy(new LocalizedSamplingStrategy(ruleFile));
9292
AWSXRay.setGlobalRecorder(builder.build());
93+
AWSXRay.beginSegment("Scorekeep-init");
94+
if ( System.getenv("NOTIFICATION_EMAIL") != null ){
95+
try { Sns.createSubscription(); }
96+
catch (Exception e ) {
97+
logger.warn("Failed to create subscription for email "+ System.getenv("NOTIFICATION_EMAIL"));
98+
}
99+
}
100+
AWSXRay.endSegment();
93101
}
94102
}

src/main/java/scorekeep/WebConfig.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public Filter SimpleCORSFilter() {
4646

4747
AWSXRay.setGlobalRecorder(builder.build());
4848

49-
AWSXRay.beginSegment("Scorekeep");
49+
AWSXRay.beginSegment("Scorekeep-init");
5050
if ( System.getenv("NOTIFICATION_EMAIL") != null ){
5151
try { Sns.createSubscription(); }
5252
catch (Exception e ) {

0 commit comments

Comments
 (0)