use of marquez.tracing.TracingSQLLogger in project marquez by MarquezProject.
the class MarquezApp method registerResources.
public void registerResources(@NonNull MarquezConfig config, @NonNull Environment env, @NonNull DataSource source) {
final JdbiFactory factory = new JdbiFactory();
final Jdbi jdbi = factory.build(env, config.getDataSourceFactory(), (ManagedDataSource) source, DB_POSTGRES).installPlugin(new SqlObjectPlugin()).installPlugin(new PostgresPlugin());
SqlLogger sqlLogger = new InstrumentedSqlLogger(env.metrics());
if (isSentryEnabled(config)) {
sqlLogger = new TracingSQLLogger(sqlLogger);
}
jdbi.setSqlLogger(sqlLogger);
final MarquezContext context = MarquezContext.builder().jdbi(jdbi).tags(config.getTags()).build();
if (config.getGraphql().isEnabled()) {
env.servlets().addServlet("api/v1-beta/graphql", context.getGraphqlServlet()).addMapping("/api/v1-beta/graphql", "/api/v1/schema.json");
}
log.debug("Registering resources...");
for (final Object resource : context.getResources()) {
env.jersey().register(resource);
}
}
Aggregations