[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

<img width="1452" alt="image"
src="https://github.com/user-attachments/assets/ee076fc6-c901-4e8f-a760-8c85a5470a26"
/>

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
This commit is contained in:
Carlos Crespo 2024-12-30 16:48:38 +01:00 committed by GitHub
parent 5cfbc75de5
commit a78f61691f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 9 additions and 0 deletions

View file

@ -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,

View file

@ -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';

View file

@ -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');
});
});
});