[APM] Return operationName as part of _inspect response (#103616)

Closes #103448.
This commit is contained in:
Dario Gieselaar 2021-06-30 15:49:50 +02:00 committed by GitHub
parent 39b6597219
commit 4b54ccecd3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 7 additions and 0 deletions

View file

@ -23,6 +23,7 @@ export async function callAsyncWithDebug<T>({
request,
requestType,
requestParams,
operationName,
isCalledWithInternalUser,
}: {
cb: () => Promise<T>;
@ -31,6 +32,7 @@ export async function callAsyncWithDebug<T>({
request: KibanaRequest;
requestType: string;
requestParams: Record<string, any>;
operationName: string;
isCalledWithInternalUser: boolean; // only allow inspection of queries that were retrieved with credentials of the end user
}) {
if (!debug) {
@ -65,6 +67,7 @@ export async function callAsyncWithDebug<T>({
const inspectableEsQueries = inspectableEsQueriesMap.get(request);
if (!isCalledWithInternalUser && inspectableEsQueries) {
inspectableEsQueries.push({
operationName,
response: res,
duration,
requestType,

View file

@ -120,6 +120,7 @@ export function createApmEventClient({
debug,
request,
requestType,
operationName,
requestParams: searchParams,
});
},

View file

@ -54,6 +54,7 @@ export function createInternalESClient({
request,
requestType,
requestParams: params,
operationName,
});
}

View file

@ -29,6 +29,7 @@ export type InspectResponse = Array<{
requestType: string;
requestParams: Record<string, unknown>;
esError: Error;
operationName: string;
}>;
export interface APMRouteCreateOptions {

View file

@ -53,6 +53,7 @@ export default function customLinksTests({ getService }: FtrProviderContext) {
// @ts-expect-error
expect(Object.keys(body._inspect[0])).to.eql([
'operationName',
'response',
'duration',
'requestType',