✨[RUM-14826] Add source code context to feature operations #4297
✨[RUM-14826] Add source code context to feature operations #4297amortemousque merged 2 commits intomainfrom
Conversation
| name: string, | ||
| stepType: 'start' | 'end', | ||
| options?: FeatureOperationOptions, | ||
| options?: FeatureOperationOptions & { handlingStack?: string }, |
There was a problem hiding this comment.
I didn’t add handlingStack to FeatureOperationOptions because FeatureOperationOptions is publicly exposed.
There was a problem hiding this comment.
Maybe not in the scope of this PR but we should probably remove it from other public options.
I saw it on ViewOptions, maybe there are others places.
There was a problem hiding this comment.
Yes, I'll make a followup pr
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a0b4cc9379
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const handlingStack = createHandlingStack('vital') | ||
| callMonitored(() => { | ||
| addTelemetryUsage({ feature: 'add-operation-step-vital', action_type: 'start' }) | ||
| strategy.addOperationStepVital(name, 'start', { ...options, handlingStack }) |
There was a problem hiding this comment.
Capture handling stack for end operation-step vitals
startFeatureOperation() now enriches only the start step with handlingStack, but succeedFeatureOperation() / failFeatureOperation() still call addOperationStepVital(..., 'end', options) without it. Because source-code context resolution reads domainContext.handlingStack to set per-event service/version (packages/rum-core/src/domain/contexts/sourceCodeContext.ts), end-step vital events from microfrontend code paths will not be enriched and will fall back to default attribution, producing inconsistent metadata within the same feature operation.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
The feature operation event is reduced in the backend with the start and end events. It keeps the start handlingStack event which is what we want.
Motivation
Extend the source code context to support feature operations.
Changes
1 - Add handlingStack to vital and view domain context
2 - Capture handling stack in
startFeatureOperation()3 - Add e2e test in microfrontend.scenario.ts
Test instructions
Checklist