diff --git a/x-pack/plugins/observability_solution/apm/server/routes/errors/get_error_groups/get_error_sample_details.ts b/x-pack/plugins/observability_solution/apm/server/routes/errors/get_error_groups/get_error_sample_details.ts index 954086ee53084..a3edca6d30740 100644 --- a/x-pack/plugins/observability_solution/apm/server/routes/errors/get_error_groups/get_error_sample_details.ts +++ b/x-pack/plugins/observability_solution/apm/server/routes/errors/get_error_groups/get_error_sample_details.ts @@ -27,6 +27,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'; @@ -82,6 +83,7 @@ export async function getErrorSampleDetails({ SPAN_ID, AGENT_VERSION, PROCESSOR_NAME, + SERVICE_LANGUAGE_NAME, 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..cf7623fc15257 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 6e5a19327c24f..f82a8b1a3139f 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 language name', () => { + expect(errorSampleDetailsResponse.error.service.language?.name).to.equal('swift'); + }); }); });