-
Notifications
You must be signed in to change notification settings - Fork 8.5k
Open
Labels
Team:obs-presentationFocus: APM UI, Infra UI, Hosts UI, Universal Profiling, Obs Overview and left NavigationFocus: APM UI, Infra UI, Hosts UI, Universal Profiling, Obs Overview and left NavigationbugFixes for quality problems that affect the customer experienceFixes for quality problems that affect the customer experience
Description
Summary
When opening an error sample on the APM error group details page (e.g. kibana-frontend > Errors > error group), the request to load the error sample can fail with 500 and message "Missing required fields (transaction.sampled) in event". The UI then shows "Error while fetching resource" and an infinite loading spinner instead of the error details.
Environment
- Observed on error group details with
labels.error_type: "PageFatalReactError"(and likely other groups when the related transaction lacks the field). - URL pattern:
.../internal/apm/services/{serviceName}/errors/{groupId}/error/{errorId}?...
Root cause
- The error sample API fetches the error document, then loads the related transaction (when
transactionIdandtraceIdexist) via getTransaction. getTransactionuses requireFields with a list that includestransaction.sampled. If the transaction document in Elasticsearch does not containtransaction.sampled(e.g. RUM, OpenTelemetry, or unsampled transactions), ensureRequiredApmFields throwsError('Missing required fields (transaction.sampled) in event')→ 500.- The frontend then shows the error toast and never finishes loading the sample (infinite spinner).
Why the field can be missing
- Not all agents or ingestion paths set
transaction.sampled. - OpenTelemetry and RUM, or older agents, may not populate it.
- Requiring it for the error-details flow is stricter than necessary: we can still display the error and transaction context when the field is absent.
Suggested fix
- In get_transaction/index.ts: remove
TRANSACTION_SAMPLEDfromrequiredFieldsso that transaction documents without this field are still returned. - When building the response, treat
transaction.sampledas optional (e.g. omit or set toundefinedwhen missing) so the API contract remains valid. Downstream UI and types already handle optional sampled in other contexts (e.g. event_raw hassampled?: boolean).
This allows the error group details page to load without 500 when the related transaction does not have transaction.sampled, avoiding the infinite loading spinner.
AC:
- Error details page should load even if the
transaction.sampledis not present/undefined - The UI should not show an error if the
transaction.sampledis not present/undefined - The spinner should not show in case of an error
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Team:obs-presentationFocus: APM UI, Infra UI, Hosts UI, Universal Profiling, Obs Overview and left NavigationFocus: APM UI, Infra UI, Hosts UI, Universal Profiling, Obs Overview and left NavigationbugFixes for quality problems that affect the customer experienceFixes for quality problems that affect the customer experience