mirror of
https://github.com/elastic/kibana.git
synced 2025-04-25 10:23:14 -04:00
[APM] Get rid of pre
middleware (#26256)
Rename apmIndexPattern to apmIndexPatternTitle and narrow down search query Fix tests Remove unused aggregation Revert "Rename apmIndexPattern to apmIndexPatternTitle and narrow down search query" This reverts commit 5aa86744a0b360ceb75a59ebc8a0a084b24fbe50.
This commit is contained in:
parent
a0675468be
commit
76122665b9
8 changed files with 39 additions and 70 deletions
|
@ -48,14 +48,11 @@ interface APMRequestQuery {
|
|||
esFilterQuery: string;
|
||||
}
|
||||
|
||||
export function setupRequest(req: Request) {
|
||||
export function setupRequest(req: Request): Setup {
|
||||
const query = (req.query as unknown) as APMRequestQuery;
|
||||
const cluster = req.server.plugins.elasticsearch.getCluster('data');
|
||||
|
||||
function client<T, U>(
|
||||
type: string,
|
||||
params: SearchParams
|
||||
): AggregationSearchResponse<T, U> {
|
||||
const client: ESClient = (type, params) => {
|
||||
if (query._debug) {
|
||||
console.log(`DEBUG ES QUERY:`);
|
||||
console.log(
|
||||
|
@ -67,7 +64,7 @@ export function setupRequest(req: Request) {
|
|||
console.log(JSON.stringify(params.body, null, 4));
|
||||
}
|
||||
return cluster.callWithRequest(req, type, params);
|
||||
}
|
||||
};
|
||||
|
||||
return {
|
||||
start: moment.utc(query.start).valueOf(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue