[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,
|
request,
|
||||||
requestType,
|
requestType,
|
||||||
requestParams,
|
requestParams,
|
||||||
|
operationName,
|
||||||
isCalledWithInternalUser,
|
isCalledWithInternalUser,
|
||||||
}: {
|
}: {
|
||||||
cb: () => Promise<T>;
|
cb: () => Promise<T>;
|
||||||
|
@ -31,6 +32,7 @@ export async function callAsyncWithDebug<T>({
|
||||||
request: KibanaRequest;
|
request: KibanaRequest;
|
||||||
requestType: string;
|
requestType: string;
|
||||||
requestParams: Record<string, any>;
|
requestParams: Record<string, any>;
|
||||||
|
operationName: string;
|
||||||
isCalledWithInternalUser: boolean; // only allow inspection of queries that were retrieved with credentials of the end user
|
isCalledWithInternalUser: boolean; // only allow inspection of queries that were retrieved with credentials of the end user
|
||||||
}) {
|
}) {
|
||||||
if (!debug) {
|
if (!debug) {
|
||||||
|
@ -65,6 +67,7 @@ export async function callAsyncWithDebug<T>({
|
||||||
const inspectableEsQueries = inspectableEsQueriesMap.get(request);
|
const inspectableEsQueries = inspectableEsQueriesMap.get(request);
|
||||||
if (!isCalledWithInternalUser && inspectableEsQueries) {
|
if (!isCalledWithInternalUser && inspectableEsQueries) {
|
||||||
inspectableEsQueries.push({
|
inspectableEsQueries.push({
|
||||||
|
operationName,
|
||||||
response: res,
|
response: res,
|
||||||
duration,
|
duration,
|
||||||
requestType,
|
requestType,
|
||||||
|
|
|
@ -120,6 +120,7 @@ export function createApmEventClient({
|
||||||
debug,
|
debug,
|
||||||
request,
|
request,
|
||||||
requestType,
|
requestType,
|
||||||
|
operationName,
|
||||||
requestParams: searchParams,
|
requestParams: searchParams,
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
|
@ -54,6 +54,7 @@ export function createInternalESClient({
|
||||||
request,
|
request,
|
||||||
requestType,
|
requestType,
|
||||||
requestParams: params,
|
requestParams: params,
|
||||||
|
operationName,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -29,6 +29,7 @@ export type InspectResponse = Array<{
|
||||||
requestType: string;
|
requestType: string;
|
||||||
requestParams: Record<string, unknown>;
|
requestParams: Record<string, unknown>;
|
||||||
esError: Error;
|
esError: Error;
|
||||||
|
operationName: string;
|
||||||
}>;
|
}>;
|
||||||
|
|
||||||
export interface APMRouteCreateOptions {
|
export interface APMRouteCreateOptions {
|
||||||
|
|
|
@ -53,6 +53,7 @@ export default function customLinksTests({ getService }: FtrProviderContext) {
|
||||||
|
|
||||||
// @ts-expect-error
|
// @ts-expect-error
|
||||||
expect(Object.keys(body._inspect[0])).to.eql([
|
expect(Object.keys(body._inspect[0])).to.eql([
|
||||||
|
'operationName',
|
||||||
'response',
|
'response',
|
||||||
'duration',
|
'duration',
|
||||||
'requestType',
|
'requestType',
|
||||||
|
|
Loading…
Reference in a new issue