mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 09:19:04 -04:00
parent
6ef0f514f4
commit
96a6bdd550
3 changed files with 18 additions and 2 deletions
|
@ -20,7 +20,10 @@ async function callApi(fetchOptions, kibanaOptions) {
|
|||
|
||||
const combinedFetchOptions = {
|
||||
...fetchOptions,
|
||||
query: fetchOptions.query
|
||||
query: {
|
||||
...fetchOptions.query,
|
||||
_debug: sessionStorage.getItem('apm_debug') || false
|
||||
}
|
||||
};
|
||||
|
||||
const res = await kfetch(combinedFetchOptions, combinedKibanaOptions);
|
||||
|
|
|
@ -11,6 +11,7 @@ export const dateValidation = Joi.alternatives()
|
|||
|
||||
export const withDefaultValidators = (validators = {}) => {
|
||||
return Joi.object().keys({
|
||||
_debug: Joi.bool(),
|
||||
start: dateValidation,
|
||||
end: dateValidation,
|
||||
esFilterQuery: Joi.string().allow(''),
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
* you may not use this file except in compliance with the Elastic License.
|
||||
*/
|
||||
|
||||
/* eslint-disable no-console */
|
||||
import moment from 'moment';
|
||||
|
||||
function decodeEsQuery(esQuery) {
|
||||
|
@ -17,7 +18,18 @@ export function setupRequest(req, reply) {
|
|||
start: moment.utc(req.query.start).valueOf(),
|
||||
end: moment.utc(req.query.end).valueOf(),
|
||||
esFilterQuery: decodeEsQuery(req.query.esFilterQuery),
|
||||
client: cluster.callWithRequest.bind(null, req),
|
||||
client: (type, params) => {
|
||||
if (req.query._debug) {
|
||||
console.log(`DEBUG ES QUERY:`);
|
||||
console.log(
|
||||
`${req.method.toUpperCase()} ${req.url.pathname} ${JSON.stringify(
|
||||
req.query
|
||||
)}`
|
||||
);
|
||||
console.log(JSON.stringify(params.body, null, 4));
|
||||
}
|
||||
return cluster.callWithRequest(req, type, params);
|
||||
},
|
||||
config: req.server.config()
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue