Class ObservationDataSourceConfig
java.lang.Object
io.micronaut.micrometer.observation.datasource.ObservationDataSourceConfig
- All Implemented Interfaces:
io.micronaut.core.util.Toggleable
@Requires(property="micrometer.observation.datasource.enabled",value="true") @Requires(beans=io.micrometer.observation.ObservationRegistry.class)
@ConfigurationProperties("micrometer.observation.datasource")
public class ObservationDataSourceConfig
extends Object
implements io.micronaut.core.util.Toggleable
Configuration properties for the observation data source.
This configuration allows you to control the behavior of the observation data source,
including enabling/disabling it and tracing connections, queries, and result sets.
- Since:
- 5.10
- Author:
- radovanradic
-
Method Summary
Modifier and TypeMethodDescriptionnet.ttddyy.observation.tracing.DataSourceObservationListener
Returns theDataSourceObservationListener
instance associated with this configuration.boolean
boolean
Indicates whether generated keys should be proxied for observation purposes.boolean
Indicates whether result sets should be proxied for observation purposes.void
setEnabled
(boolean enabled) Sets whether the observation data source is enabled or disabled.void
setProxyGeneratedKeys
(boolean proxyGeneratedKeys) Enables or disables proxying of generated keys for observation purposes.void
setProxyResultSet
(boolean proxyResultSet) Enables or disables proxying of result sets for observation purposes.
-
Method Details
-
isEnabled
public boolean isEnabled()- Specified by:
isEnabled
in interfaceio.micronaut.core.util.Toggleable
-
setEnabled
public void setEnabled(boolean enabled) Sets whether the observation data source is enabled or disabled.- Parameters:
enabled
- true to enable the observation data source, false otherwise
-
isProxyResultSet
public boolean isProxyResultSet()Indicates whether result sets should be proxied for observation purposes. When enabled, the observation data source will create proxies around result sets to track and record relevant events.- Returns:
- true if result sets are being proxied, false otherwise
-
setProxyResultSet
public void setProxyResultSet(boolean proxyResultSet) Enables or disables proxying of result sets for observation purposes. When enabled, the observation data source will create proxies around result sets to track and record relevant events. Disabling this feature can improve performance but may limit the accuracy of observations.- Parameters:
proxyResultSet
- true to enable proxying of result sets, false to disable
-
isProxyGeneratedKeys
public boolean isProxyGeneratedKeys()Indicates whether generated keys should be proxied for observation purposes. When enabled, the observation data source will create proxies around generated keys to track and record relevant events.- Returns:
- true if generated keys are being proxied, false otherwise
-
setProxyGeneratedKeys
public void setProxyGeneratedKeys(boolean proxyGeneratedKeys) Enables or disables proxying of generated keys for observation purposes. When enabled, the observation data source will create proxies around generated keys to track and record relevant events. Disabling this feature can improve performance but may limit the accuracy of observations.- Parameters:
proxyGeneratedKeys
- true to enable proxying of generated keys, false to disable
-
getListener
public net.ttddyy.observation.tracing.DataSourceObservationListener getListener()Returns theDataSourceObservationListener
instance associated with this configuration. This listener is used to observe and record events related to the data source.- Returns:
- the data source observation listener
-