Closed quaff closed 1 year ago
We could use ObservationPredicate
if https://github.com/micrometer-metrics/micrometer/pull/3867 get merged, I'm going to close this.
@Bean
ObservationPredicate noParentlessDatabaseObservations() {
return (name, context) -> {
if (context instanceof DataSourceBaseContext) {
return context.getParentObservation() != null;
}
return true;
};
}
If set
jdbc.datasource-proxy.with-parent-only
totrue
, then JDBC instrumentation should be ignored without parentObservation
, I think it will mitigate https://github.com/jdbc-observations/datasource-micrometer/issues/17see https://github.com/micrometer-metrics/micrometer/pull/3843#issuecomment-1552272400