From 576c4ab0d3dda7d83e7bf98f7459f724869d5b09 Mon Sep 17 00:00:00 2001 From: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Date: Tue, 31 Dec 2024 01:34:44 +1100 Subject: [PATCH] [8.x] [APM Fix missing error.culprit (#205242) (#205255) # Backport This will backport the following commits from `main` to `8.x`: - [[APM Fix missing error.culprit (#205242)](https://github.com/elastic/kibana/pull/205242) ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) Co-authored-by: Carlos Crespo --- .../errors/get_error_groups/get_error_sample_details.ts | 2 ++ .../apis/observability/apm/mobile/errors/generate_data.ts | 6 +++++- .../apm/mobile/errors/group_id_samples.spec.ts | 4 ++++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/x-pack/solutions/observability/plugins/apm/server/routes/errors/get_error_groups/get_error_sample_details.ts b/x-pack/solutions/observability/plugins/apm/server/routes/errors/get_error_groups/get_error_sample_details.ts index 954086ee53084..2ea8605789acc 100644 --- a/x-pack/solutions/observability/plugins/apm/server/routes/errors/get_error_groups/get_error_sample_details.ts +++ b/x-pack/solutions/observability/plugins/apm/server/routes/errors/get_error_groups/get_error_sample_details.ts @@ -13,6 +13,7 @@ import { AGENT_NAME, AGENT_VERSION, AT_TIMESTAMP, + ERROR_CULPRIT, ERROR_EXCEPTION, ERROR_GROUP_ID, ERROR_ID, @@ -82,6 +83,7 @@ export async function getErrorSampleDetails({ SPAN_ID, AGENT_VERSION, PROCESSOR_NAME, + ERROR_CULPRIT, ERROR_STACK_TRACE, ERROR_EXC_MESSAGE, ERROR_EXC_HANDLED, diff --git a/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/mobile/errors/generate_data.ts b/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/mobile/errors/generate_data.ts index c1ae372335824..1db1e4388a197 100644 --- a/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/mobile/errors/generate_data.ts +++ b/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/mobile/errors/generate_data.ts @@ -59,7 +59,11 @@ export async function generateData({ .transaction({ transactionName: transaction.name }) .errors( serviceGoProdInstance - .error({ message: `Error ${index}`, type: transaction.name }) + .error({ + message: `Error ${index}`, + type: transaction.name, + culprit: `Error culprit ${index}`, + }) .timestamp(timestamp) ) .duration(1000) diff --git a/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/mobile/errors/group_id_samples.spec.ts b/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/mobile/errors/group_id_samples.spec.ts index 6e5a19327c24f..f50f762c5c075 100644 --- a/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/mobile/errors/group_id_samples.spec.ts +++ b/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/mobile/errors/group_id_samples.spec.ts @@ -134,6 +134,10 @@ export default function ApiTest({ getService }: DeploymentAgnosticFtrProviderCon 'Error 1' ); }); + + it('displays correct error culprit info', () => { + expect(errorSampleDetailsResponse.error.error.culprit).to.equal('Error culprit 1'); + }); }); });