We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When the micrometer ObservationPredicate is configured, supplied QueryContext does not contain the list of queries.
Related discussion: #17
For example, the following test will not pass at the moment:
@Test void queryPredicateGetsExpectedData() throws Exception{ ObservationPredicate testQueryObservationPredicate = (s, observationContext) -> { if (observationContext instanceof QueryContext) { QueryContext queryContext = (QueryContext) observationContext; List<String> queries = queryContext.getQueries(); assertThat(queries).isNotEmpty(); assertThat(queries.get(0)).isEqualTo("SELECT 1"); return true; } return true; }; this.registry.observationConfig().observationHandler(new DefaultTracingObservationHandler(this.tracer)); this.registry.observationConfig().observationPredicate(testQueryObservationPredicate); DataSourceObservationListener listener = new DataSourceObservationListener(this.registry); Method execute = Statement.class.getMethod("execute", String.class); QueryInfo queryInfo = new QueryInfo(); queryInfo.setQuery("SELECT 1"); ExecutionInfo executionInfo = new ExecutionInfo(); executionInfo.setConnectionId("id-1"); executionInfo.setDataSourceName("myDS"); executionInfo.setMethod(execute); List<QueryInfo> queryInfos = Collections.singletonList(queryInfo); listener.beforeQuery(executionInfo, queryInfos); }
I will try to create appropriate PR.
The text was updated successfully, but these errors were encountered:
PR is here: #19
Sorry, something went wrong.
8ec5378
Hi,
Is it possible to get the 1.0.3 release published? I would very much like to have a fix for this bug. Tnx.
@dmurat oh, sorry to kept you so long for getting this change in a release. I just released 1.0.3 which includes this fix.
1.0.3
No problem, and thank you. You are very kind.
No branches or pull requests
When the micrometer ObservationPredicate is configured, supplied QueryContext does not contain the list of queries.
Related discussion: #17
For example, the following test will not pass at the moment:
I will try to create appropriate PR.
The text was updated successfully, but these errors were encountered: