[APM] Return operationName as part of _inspect response (#103616)
Closes #103448.
This commit is contained in:
parent
39b6597219
commit
4b54ccecd3
|
@ -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,
|
||||
|
|
|
@ -120,6 +120,7 @@ export function createApmEventClient({
|
|||
debug,
|
||||
request,
|
||||
requestType,
|
||||
operationName,
|
||||
requestParams: searchParams,
|
||||
});
|
||||
},
|
||||
|
|
|
@ -54,6 +54,7 @@ export function createInternalESClient({
|
|||
request,
|
||||
requestType,
|
||||
requestParams: params,
|
||||
operationName,
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -29,6 +29,7 @@ export type InspectResponse = Array<{
|
|||
requestType: string;
|
||||
requestParams: Record<string, unknown>;
|
||||
esError: Error;
|
||||
operationName: string;
|
||||
}>;
|
||||
|
||||
export interface APMRouteCreateOptions {
|
||||
|
|
|
@ -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',
|
||||
|
|
Loading…
Reference in a new issue