[8.16] [APM][Otel]Fix get_error_group_main_statistics making trace.id optional field (#196822) (#196966)

# Backport

This will backport the following commits from `main` to `8.16`:
- [[APM][Otel]Fix get_error_group_main_statistics making trace.id
optional field (#196822)](https://github.com/elastic/kibana/pull/196822)

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

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

<!--BACKPORT [{"author":{"name":"Carlos
Crespo","email":"crespocarlos@users.noreply.github.com"},"sourceCommit":{"committedDate":"2024-10-18T23:16:36Z","message":"[APM][Otel]Fix
get_error_group_main_statistics making trace.id optional field
(#196822)\n\nfixes
[196821](https://github.com/elastic/kibana/issues/196821)\r\n\r\n##
Summary\r\n\r\n`trace.id` should've been sent as an optional field to
the\r\n`get_error_group_main_statistics` query. This PR fixes
that\r\n\r\n<img width=\"700\"
alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/20b63361-9645-418f-a611-2c0e29b385c7\">\r\n\r\n\r\n##
How to test \r\n\r\n- Run the opentelemetry
demo:\r\nhttps://github.com/elastic/opentelemetry-demo/tree/rca_ingress_obs\r\n-
Navigate to Application > Services\r\n- Open the service details for
loadgenerator","sha":"a36fa1151b4af7ecd1565bf2b67fad20835b8209","branchLabelMapping":{"^v9.0.0$":"main","^v8.17.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","v9.0.0","backport:prev-major","ci:project-deploy-observability","Team:obs-ux-infra_services"],"title":"[APM][Otel]Fix
get_error_group_main_statistics making trace.id optional
field","number":196822,"url":"https://github.com/elastic/kibana/pull/196822","mergeCommit":{"message":"[APM][Otel]Fix
get_error_group_main_statistics making trace.id optional field
(#196822)\n\nfixes
[196821](https://github.com/elastic/kibana/issues/196821)\r\n\r\n##
Summary\r\n\r\n`trace.id` should've been sent as an optional field to
the\r\n`get_error_group_main_statistics` query. This PR fixes
that\r\n\r\n<img width=\"700\"
alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/20b63361-9645-418f-a611-2c0e29b385c7\">\r\n\r\n\r\n##
How to test \r\n\r\n- Run the opentelemetry
demo:\r\nhttps://github.com/elastic/opentelemetry-demo/tree/rca_ingress_obs\r\n-
Navigate to Application > Services\r\n- Open the service details for
loadgenerator","sha":"a36fa1151b4af7ecd1565bf2b67fad20835b8209"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/196822","number":196822,"mergeCommit":{"message":"[APM][Otel]Fix
get_error_group_main_statistics making trace.id optional field
(#196822)\n\nfixes
[196821](https://github.com/elastic/kibana/issues/196821)\r\n\r\n##
Summary\r\n\r\n`trace.id` should've been sent as an optional field to
the\r\n`get_error_group_main_statistics` query. This PR fixes
that\r\n\r\n<img width=\"700\"
alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/20b63361-9645-418f-a611-2c0e29b385c7\">\r\n\r\n\r\n##
How to test \r\n\r\n- Run the opentelemetry
demo:\r\nhttps://github.com/elastic/opentelemetry-demo/tree/rca_ingress_obs\r\n-
Navigate to Application > Services\r\n- Open the service details for
loadgenerator","sha":"a36fa1151b4af7ecd1565bf2b67fad20835b8209"}}]}]
BACKPORT-->

Co-authored-by: Carlos Crespo <crespocarlos@users.noreply.github.com>
This commit is contained in:
Kibana Machine 2024-10-19 12:17:21 +11:00 committed by GitHub
parent 6899cd1544
commit f8f9a672c6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -97,14 +97,10 @@ export async function getErrorGroupMainStatistics({
]
: [];
const requiredFields = asMutableArray([
TRACE_ID,
AT_TIMESTAMP,
ERROR_GROUP_ID,
ERROR_ID,
] as const);
const requiredFields = asMutableArray([AT_TIMESTAMP, ERROR_GROUP_ID, ERROR_ID] as const);
const optionalFields = asMutableArray([
TRACE_ID,
ERROR_CULPRIT,
ERROR_LOG_MESSAGE,
ERROR_EXC_MESSAGE,