[APM] WIP: Send inspected queries to client#85052
[APM] WIP: Send inspected queries to client#85052sorenlouv wants to merge 1 commit intoelastic:masterfrom
Conversation
|
Pinging @elastic/apm-ui (Team:apm) |
💔 Build Failed
Failed CI Steps
Test FailuresChrome X-Pack UI Functional Tests.x-pack/test/functional/apps/apm/feature_controls/apm_security·ts.APM specs feature controls security global apm all privileges can navigate to APM appStandard OutStack TraceChrome X-Pack UI Functional Tests.x-pack/test/functional/apps/apm/feature_controls/apm_security·ts.APM specs feature controls security global apm all privileges can navigate to APM appStandard OutStack TraceX-Pack APM API integration tests (basic).x-pack/test/apm_api_integration/basic/tests/settings/agent_configuration·ts.APM specs (basic) Settings agent configuration when data is loaded returns all servicesStandard OutStack TraceMetrics [docs]
To update your PR or re-run it, just comment with: |
| params: Record<string, any>; | ||
| debug: boolean; | ||
| request: KibanaRequest; | ||
| request: KibanaRequest & { _debugQueries?: Array<Record<string, any>> }; |
There was a problem hiding this comment.
Rather than adding a _debugQueries property (which are awkward/impossible with array/string/boolean etc response types), what do you think about wrapping the response if _debugQueries set? Something like { queries: [], response: ... }. We can then opaquely unwrap in useFetcher().
There was a problem hiding this comment.
Hmm.. not following
There was a problem hiding this comment.
Okay, I get it now - but still not sure where you want to store _debugQueries to go from an es request is made until the response happens.
|
|
||
| console.log(chalk.bold('ES query:')); | ||
| console.log(formatObj(params)); | ||
| request._debugQueries.push({ |
There was a problem hiding this comment.
Maybe setupRequest can return a respond method, and we wrap responses as: respond({ hasData: true }). Then we don't have to modify the request object, we'd need to pass some kind of tracking function to create_apm_event_client and call_client_with_debug.
There was a problem hiding this comment.
I'm not following. How would I access the response object from within callClientWithDebug?
response would have to be supplied to each route, which in turn would have to pass it on to setupRequest like:
const setup = await setupRequest(context, request, response);|
This looks like an enhancement, we're past FF on 7.11.0. It doesn't look like this has had recent activity. Probably bump it to 7.12.0. |
Good point. Taking out of 7.11 |
|
Replaced by #95146 |
Currently it's possible to output ES queries to the log output on the server side. This is fine for local development but on a remote Kibana instance it's difficult to access.
This PR appends the inspected queries to the response to allow the browser to see them.