Skip to content

Instantly share code, notes, and snippets.

@dalexandrov
Created February 23, 2021 14:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dalexandrov/1c2c15fd22a5c2dbf54ad0d8489303a4 to your computer and use it in GitHub Desktop.
Save dalexandrov/1c2c15fd22a5c2dbf54ad0d8489303a4 to your computer and use it in GitHub Desktop.
public class Neo4jMetricsCdiExtension implements Extension {
private void addMetrics(@Observes @Priority(PLATFORM_AFTER + 101) @Initialized(ApplicationScoped.class) Object event) {
Instance<Driver> driver = CDI.current().select(Driver.class);
Neo4jMetricsSupport.builder()
.driver(driver.get())
.build()
.initialize();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment