Skip to content

Commit

Permalink
[8.x] [APM][Otel] Fix an error with mobile services coming from synth…
Browse files Browse the repository at this point in the history
…trace (#196313) (#196357)

# Backport

This will backport the following commits from `main` to `8.x`:
- [[APM][Otel] Fix an error with mobile services coming from synthtrace
(#196313)](#196313)

<!--- Backport version: 9.4.3 -->

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

<!--BACKPORT
[{"author":{"name":"jennypavlova","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-10-15T15:53:12Z","message":"[APM][Otel]
Fix an error with mobile services coming from synthtrace
(#196313)\n\nCloses #196161 \r\n## Summary\r\n\r\nThis PR fixes an issue
with the mobile data using synthtrace. After some\r\ninvestigation I saw
that the the `httpSpan` was creating the spans
with\r\n`transaction.type` set which resulted in `processor.event` being
set to\r\n`transaction` instead of `span` - then with [the new
required\r\ntransaction\r\nfields](https://github.com/elastic/kibana/blob/adb558a86bafbe3567915c3fae252ff414147930/x-pack/plugins/observability_solution/apm/server/routes/traces/get_trace_items.ts#L277)\r\nin
get_trace_docs for transactions ([checking based on
the\r\nprocessor.event](https://github.com/elastic/kibana/blob/adb558a86bafbe3567915c3fae252ff414147930/x-pack/plugins/observability_solution/apm/server/routes/traces/get_trace_items.ts#L352))\r\nwe
were throwing an error because the transaction fields were
not\r\ndefined (which is expected because it's a span and not a
transaction)\r\n\r\n## Testing \r\n\r\nGenerate mobile data
using:\r\n`node scripts/synthtrace mobile.ts --clean`\r\n\r\nOpen all
the mobile traces (ios/Android) - there should not be an
error","sha":"c218e7cc29c00864d744d886c6e712b99ba97ed5","branchLabelMapping":{"^v9.0.0$":"main","^v8.16.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","v9.0.0","ci:project-deploy-observability","Team:obs-ux-infra_services","v8.16.0","backport:version"],"title":"[APM][Otel]
Fix an error with mobile services coming from
synthtrace","number":196313,"url":"https://github.com/elastic/kibana/pull/196313","mergeCommit":{"message":"[APM][Otel]
Fix an error with mobile services coming from synthtrace
(#196313)\n\nCloses #196161 \r\n## Summary\r\n\r\nThis PR fixes an issue
with the mobile data using synthtrace. After some\r\ninvestigation I saw
that the the `httpSpan` was creating the spans
with\r\n`transaction.type` set which resulted in `processor.event` being
set to\r\n`transaction` instead of `span` - then with [the new
required\r\ntransaction\r\nfields](https://github.com/elastic/kibana/blob/adb558a86bafbe3567915c3fae252ff414147930/x-pack/plugins/observability_solution/apm/server/routes/traces/get_trace_items.ts#L277)\r\nin
get_trace_docs for transactions ([checking based on
the\r\nprocessor.event](https://github.com/elastic/kibana/blob/adb558a86bafbe3567915c3fae252ff414147930/x-pack/plugins/observability_solution/apm/server/routes/traces/get_trace_items.ts#L352))\r\nwe
were throwing an error because the transaction fields were
not\r\ndefined (which is expected because it's a span and not a
transaction)\r\n\r\n## Testing \r\n\r\nGenerate mobile data
using:\r\n`node scripts/synthtrace mobile.ts --clean`\r\n\r\nOpen all
the mobile traces (ios/Android) - there should not be an
error","sha":"c218e7cc29c00864d744d886c6e712b99ba97ed5"}},"sourceBranch":"main","suggestedTargetBranches":["8.x"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/196313","number":196313,"mergeCommit":{"message":"[APM][Otel]
Fix an error with mobile services coming from synthtrace
(#196313)\n\nCloses #196161 \r\n## Summary\r\n\r\nThis PR fixes an issue
with the mobile data using synthtrace. After some\r\ninvestigation I saw
that the the `httpSpan` was creating the spans
with\r\n`transaction.type` set which resulted in `processor.event` being
set to\r\n`transaction` instead of `span` - then with [the new
required\r\ntransaction\r\nfields](https://github.com/elastic/kibana/blob/adb558a86bafbe3567915c3fae252ff414147930/x-pack/plugins/observability_solution/apm/server/routes/traces/get_trace_items.ts#L277)\r\nin
get_trace_docs for transactions ([checking based on
the\r\nprocessor.event](https://github.com/elastic/kibana/blob/adb558a86bafbe3567915c3fae252ff414147930/x-pack/plugins/observability_solution/apm/server/routes/traces/get_trace_items.ts#L352))\r\nwe
were throwing an error because the transaction fields were
not\r\ndefined (which is expected because it's a span and not a
transaction)\r\n\r\n## Testing \r\n\r\nGenerate mobile data
using:\r\n`node scripts/synthtrace mobile.ts --clean`\r\n\r\nOpen all
the mobile traces (ios/Android) - there should not be an
error","sha":"c218e7cc29c00864d744d886c6e712b99ba97ed5"}},{"branch":"8.x","label":"v8.16.0","branchLabelMappingKey":"^v8.16.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: jennypavlova <[email protected]>
  • Loading branch information
kibanamachine and jennypavlova authored Oct 15, 2024
1 parent a3cead9 commit e07f0d9
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 e07f0d9

Please sign in to comment.