Skip to content

Commit

Permalink
Update OTELMetrics.java
Browse files Browse the repository at this point in the history
  • Loading branch information
matt-richardson committed Nov 29, 2024
1 parent 3f97168 commit 0782d4f
Showing 1 changed file with 1 addition and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,9 @@ public static SdkMeterProvider getOTELMeterProvider(@Nullable MetricExporter met
.setInterval(Duration.ofSeconds(10))
.build();

var sdkMeterProvider = SdkMeterProvider.builder()
return SdkMeterProvider.builder()
.setResource(Resource.getDefault().merge(serviceNameResource))
.registerMetricReader(providedMetricExporter)
.build();

// Shutdown hooks to close resources properly
Runtime.getRuntime().addShutdownHook(new Thread(sdkMeterProvider::close));
return sdkMeterProvider;
}
}

0 comments on commit 0782d4f

Please sign in to comment.