From a78f61691f6de231b76083a52bdcb3db602df1a0 Mon Sep 17 00:00:00 2001 From: Carlos Crespo Date: Mon, 30 Dec 2024 16:48:38 +0100 Subject: [PATCH] [APM] Fix stack trace syntax highlight (#205187) fixes: [#204957](https://github.com/elastic/kibana/issues/204957) ## Summary This PR fixes the stack trace syntax highlight image --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> --- .../errors/get_error_groups/get_error_sample_details.ts | 2 ++ .../apis/observability/apm/mobile/errors/generate_data.ts | 3 +++ .../observability/apm/mobile/errors/group_id_samples.spec.ts | 4 ++++ 3 files changed, 9 insertions(+) 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 2ea8605789acc..074a4115d875b 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 @@ -28,6 +28,7 @@ import { TRANSACTION_ID, ERROR_STACK_TRACE, SPAN_ID, + SERVICE_LANGUAGE_NAME, } from '../../../../common/es_fields/apm'; import { environmentQuery } from '../../../../common/utils/environment_query'; import { ApmDocumentType } from '../../../../common/document_type'; @@ -83,6 +84,7 @@ export async function getErrorSampleDetails({ SPAN_ID, AGENT_VERSION, PROCESSOR_NAME, + SERVICE_LANGUAGE_NAME, ERROR_CULPRIT, ERROR_STACK_TRACE, ERROR_EXC_MESSAGE, 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 1db1e4388a197..8f31c9d1e3f5a 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 @@ -33,6 +33,9 @@ export async function generateData({ }) { const serviceGoProdInstance = apm .service({ name: serviceName, environment: 'production', agentName: 'swift' }) + .defaults({ + 'service.language.name': 'swift', + }) .instance('instance-a'); const interval = '1m'; 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 f50f762c5c075..d569b3380a8c5 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 @@ -138,6 +138,10 @@ export default function ApiTest({ getService }: DeploymentAgnosticFtrProviderCon it('displays correct error culprit info', () => { expect(errorSampleDetailsResponse.error.error.culprit).to.equal('Error culprit 1'); }); + + it('displays correct language name', () => { + expect(errorSampleDetailsResponse.error.service.language?.name).to.equal('swift'); + }); }); });