Class JdbiOpenTelemetryPlugin
java.lang.Object
org.jdbi.v3.core.spi.JdbiPlugin.Singleton
org.jdbi.v3.opentelemetry.JdbiOpenTelemetryPlugin
- All Implemented Interfaces:
JdbiPlugin
Enable OpenTelemetry support.
Emits a trace span for every statement executed by Jdbi.
-
Nested Class Summary
Nested classes/interfaces inherited from interface JdbiPlugin
JdbiPlugin.SingletonModifier and TypeInterfaceDescriptionstatic classAbstract base class for single-install JdbiPlugins. -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionEnable OpenTelemetry support with the global OpenTelemetry instance.JdbiOpenTelemetryPlugin(io.opentelemetry.api.OpenTelemetry telemetry) Enable OpenTelemetry support with the supplied OpenTelemetry instance. -
Method Summary
Modifier and TypeMethodDescriptionvoidcustomizeJdbi(Jdbi jdbi) Configure customizations global to any object managed by this Jdbi.Methods inherited from class JdbiPlugin.Singleton
equals, hashCodeMethods inherited from interface JdbiPlugin
customizeConnection, customizeHandleModifier and TypeMethodDescriptiondefault ConnectionConfigure customizations for a newly acquired Connection.default HandlecustomizeHandle(Handle handle) Configure customizations for a new Handle instance.
-
Field Details
-
SQL
-
BINDING
-
NUM_ROWS
-
-
Constructor Details
-
JdbiOpenTelemetryPlugin
public JdbiOpenTelemetryPlugin()Enable OpenTelemetry support with the global OpenTelemetry instance. -
JdbiOpenTelemetryPlugin
public JdbiOpenTelemetryPlugin(io.opentelemetry.api.OpenTelemetry telemetry) Enable OpenTelemetry support with the supplied OpenTelemetry instance.- Parameters:
telemetry- the OpenTelemetry to emit spans to
-
-
Method Details
-
customizeJdbi
Description copied from interface:JdbiPluginConfigure customizations global to any object managed by this Jdbi. This method is invoked immediately when the plugin is installed.- Parameters:
jdbi- the jdbi to customize- Throws:
SQLException- something went wrong with the database
-