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

# Backport

This will backport the following commits from `main` to `8.9`:
- [[APM] check if the doc is missing `span.name`
(#162899)](https://github.com/elastic/kibana/pull/162899)

<!--- Backport version: 8.9.7 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT
[{"author":{"name":"Katerina","email":"aikaterini.patticha@elastic.co"},"sourceCommit":{"committedDate":"2023-08-04T13:12:38Z","message":"[APM]
check if the doc is missing `span.name` (#162899)\n\n##
Summary\r\nfixes:
https://github.com/elastic/kibana/issues/154998\r\neven though name is
required in span spec it seems to be missed in some\r\ndocuments causing
the runtime
error.\r\n\r\n\r\n35854feb-2df0-4b59-af2e-b79a6f997497","sha":"b7a38984bd8e16e804f19b6e2ed9dcbe8887fe71","branchLabelMapping":{"^v8.10.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","Team:APM","backport:prev-minor","v8.10.0"],"number":162899,"url":"https://github.com/elastic/kibana/pull/162899","mergeCommit":{"message":"[APM]
check if the doc is missing `span.name` (#162899)\n\n##
Summary\r\nfixes:
https://github.com/elastic/kibana/issues/154998\r\neven though name is
required in span spec it seems to be missed in some\r\ndocuments causing
the runtime
error.\r\n\r\n\r\n35854feb-2df0-4b59-af2e-b79a6f997497","sha":"b7a38984bd8e16e804f19b6e2ed9dcbe8887fe71"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v8.10.0","labelRegex":"^v8.10.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/162899","number":162899,"mergeCommit":{"message":"[APM]
check if the doc is missing `span.name` (#162899)\n\n##
Summary\r\nfixes:
https://github.com/elastic/kibana/issues/154998\r\neven though name is
required in span spec it seems to be missed in some\r\ndocuments causing
the runtime
error.\r\n\r\n\r\n35854feb-2df0-4b59-af2e-b79a6f997497","sha":"b7a38984bd8e16e804f19b6e2ed9dcbe8887fe71"}}]}]
BACKPORT-->

Co-authored-by: Katerina <aikaterini.patticha@elastic.co>
This commit is contained in:
Kibana Machine 2023-08-04 10:21:33 -04:00 committed by GitHub
parent 60a41625bf
commit df6b25ed8b
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;