added capturing of request body in Elasticsearch queries#1222
added capturing of request body in Elasticsearch queries#1222felixbarny merged 5 commits intoelastic:masterfrom
Conversation
0104ca1 to
7083340
Compare
| private static final Logger logger = LoggerFactory.getLogger(ElasticsearchRestClientInstrumentationHelperImpl.class); | ||
|
|
||
| public static final String SEARCH_QUERY_PATH_SUFFIX = "_search"; | ||
| public static final String QUERY_REGEXP = ".*_((search|msearch)(\\/template)?|count)$"; |
There was a problem hiding this comment.
Regex is rather expensive. Better use WildcardMatchers instead. Arrays.asList(WildcardMatcher.valueOf("*_search", ...).
To match all, use WildcardMatcher::isAnyMatch
|
|
||
| // Now update and re-search | ||
| reporter.reset(); | ||
| // Do CountRequest |
There was a problem hiding this comment.
Please test the different endpoints in different test methods.
There was a problem hiding this comment.
What I meant was to create multiple @Test annotated methods for each type of query. Better to have multiple simple test cases than one big complex one so that the tests can be executed individually.
0104022 to
9d29fc4
Compare
9d29fc4 to
4b78b82
Compare
Codecov Report
@@ Coverage Diff @@
## master #1222 +/- ##
============================================
- Coverage 59.37% 59.36% -0.02%
Complexity 87 87
============================================
Files 354 354
Lines 16270 16276 +6
Branches 2269 2269
============================================
+ Hits 9661 9662 +1
- Misses 5952 5959 +7
+ Partials 657 655 -2
Continue to review full report at Codecov.
|
…_count, _rollup_search, _msearch/tempalte, _search/template
4b78b82 to
9b44485
Compare
closes #519
added capturing of request body in Elasticsearch queries: _msesarch, _count, _rollup_search, _msearch/template, _search/template