Package io.quarkus.agroal.runtime
Class OpenTelemetryAgroalDataSource
java.lang.Object
io.quarkus.agroal.runtime.OpenTelemetryAgroalDataSource
- All Implemented Interfaces:
io.agroal.api.AgroalDataSource,Serializable,AutoCloseable,Wrapper,CommonDataSource,DataSource
The
AgroalDataSource wrapper that activates OpenTelemetry JDBC instrumentation.
Uses composition to wrap an OpenTelemetryDataSource (for instrumented connections)
while delegating AgroalDataSource-specific operations to the original data source.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.agroal.api.AgroalDataSource
io.agroal.api.AgroalDataSource.FlushMode -
Constructor Summary
ConstructorsConstructorDescriptionOpenTelemetryAgroalDataSource(io.agroal.api.AgroalDataSource delegate, io.opentelemetry.instrumentation.jdbc.datasource.OpenTelemetryDataSource otelDataSource) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()voidflush(io.agroal.api.AgroalDataSource.FlushMode mode) io.agroal.api.configuration.AgroalDataSourceConfigurationgetConnection(String username, String password) intio.agroal.api.AgroalDataSourceMetricsList<io.agroal.api.AgroalPoolInterceptor> booleanisHealthy(boolean newConnection) booleanisWrapperFor(Class<?> iface) voidsetLoginTimeout(int seconds) voidsetLogWriter(PrintWriter out) voidsetPoolInterceptors(Collection<? extends io.agroal.api.AgroalPoolInterceptor> interceptors) <T> TMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface javax.sql.DataSource
createConnectionBuilder
-
Constructor Details
-
OpenTelemetryAgroalDataSource
public OpenTelemetryAgroalDataSource(io.agroal.api.AgroalDataSource delegate, io.opentelemetry.instrumentation.jdbc.datasource.OpenTelemetryDataSource otelDataSource)
-
-
Method Details
-
getConnection
- Specified by:
getConnectionin interfaceDataSource- Throws:
SQLException
-
getConnection
- Specified by:
getConnectionin interfaceDataSource- Throws:
SQLException
-
getLogWriter
- Specified by:
getLogWriterin interfaceCommonDataSource- Specified by:
getLogWriterin interfaceDataSource- Throws:
SQLException
-
setLogWriter
- Specified by:
setLogWriterin interfaceCommonDataSource- Specified by:
setLogWriterin interfaceDataSource- Throws:
SQLException
-
getLoginTimeout
- Specified by:
getLoginTimeoutin interfaceCommonDataSource- Specified by:
getLoginTimeoutin interfaceDataSource- Throws:
SQLException
-
setLoginTimeout
- Specified by:
setLoginTimeoutin interfaceCommonDataSource- Specified by:
setLoginTimeoutin interfaceDataSource- Throws:
SQLException
-
getParentLogger
- Specified by:
getParentLoggerin interfaceCommonDataSource- Throws:
SQLFeatureNotSupportedException
-
unwrap
- Specified by:
unwrapin interfaceWrapper- Throws:
SQLException
-
isWrapperFor
- Specified by:
isWrapperForin interfaceWrapper- Throws:
SQLException
-
isHealthy
- Specified by:
isHealthyin interfaceio.agroal.api.AgroalDataSource- Throws:
SQLException
-
getReadOnlyConnection
- Specified by:
getReadOnlyConnectionin interfaceio.agroal.api.AgroalDataSource- Throws:
SQLException
-
getConfiguration
public io.agroal.api.configuration.AgroalDataSourceConfiguration getConfiguration()- Specified by:
getConfigurationin interfaceio.agroal.api.AgroalDataSource
-
getMetrics
public io.agroal.api.AgroalDataSourceMetrics getMetrics()- Specified by:
getMetricsin interfaceio.agroal.api.AgroalDataSource
-
flush
public void flush(io.agroal.api.AgroalDataSource.FlushMode mode) - Specified by:
flushin interfaceio.agroal.api.AgroalDataSource
-
setPoolInterceptors
public void setPoolInterceptors(Collection<? extends io.agroal.api.AgroalPoolInterceptor> interceptors) - Specified by:
setPoolInterceptorsin interfaceio.agroal.api.AgroalDataSource
-
getPoolInterceptors
- Specified by:
getPoolInterceptorsin interfaceio.agroal.api.AgroalDataSource
-
createShardingKeyBuilder
- Specified by:
createShardingKeyBuilderin interfaceCommonDataSource- Throws:
SQLException
-
close
public void close()- Specified by:
closein interfaceio.agroal.api.AgroalDataSource- Specified by:
closein interfaceAutoCloseable
-