Skip to content

Commit

Permalink
[APM][Otel] Fix an error with mobile services coming from synthtrace (e…
Browse files Browse the repository at this point in the history
…lastic#196313)

Closes elastic#196161
## Summary

This PR fixes an issue with the mobile data using synthtrace. After some
investigation I saw that the the `httpSpan` was creating the spans with
`transaction.type` set which resulted in `processor.event` being set to
`transaction` instead of `span` - then with [the new required
transaction
fields](https://github.com/elastic/kibana/blob/adb558a86bafbe3567915c3fae252ff414147930/x-pack/plugins/observability_solution/apm/server/routes/traces/get_trace_items.ts#L277)
in get_trace_docs for transactions ([checking based on the
processor.event](https://github.com/elastic/kibana/blob/adb558a86bafbe3567915c3fae252ff414147930/x-pack/plugins/observability_solution/apm/server/routes/traces/get_trace_items.ts#L352))
we were throwing an error because the transaction fields were not
defined (which is expected because it's a span and not a transaction)

## Testing

Generate mobile data using:
`node scripts/synthtrace mobile.ts --clean`

Open all the mobile traces (ios/Android) - there should not be an error

(cherry picked from commit c218e7c)
  • Loading branch information
jennypavlova committed Oct 15, 2024
1 parent b57c9a6 commit 10a8f25
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ export class MobileDevice extends Entity<ApmFields> {
spanSubtype: 'http',
'http.request.method': httpMethod,
'url.original': httpUrl,
'transaction.type': 'mobile',
'processor.event': 'span',
};

if (this.networkConnection) {
Expand Down

0 comments on commit 10a8f25

Please sign in to comment.