[APM] check if the doc is missing span.name (#162899)

## Summary
fixes: https://github.com/elastic/kibana/issues/154998
even though name is required in span spec it seems to be missed in some
documents causing the runtime error.


https://github.com/elastic/apm-data/blob/main/input/elasticapm/docs/spec/v2/span.json


35854feb-2df0-4b59-af2e-b79a6f997497
This commit is contained in:
Katerina 2023-08-04 15:12:38 +02:00 committed by GitHub
parent f90c800c5f
commit b7a38984bd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -128,7 +128,7 @@ export async function getAggregatedCriticalPath({
"agent.name": doc['agent.name'].value
];
def isSpan = !doc['span.id'].empty;
def isSpan = !doc['span.id'].empty && !doc['span.name'].empty;
if (isSpan) {
id = doc['span.id'].value;