Skip to content

✨[RUM-14826] Add source code context to feature operations #4297

Merged
amortemousque merged 2 commits intomainfrom
aymeric/context-enrichement-for-operation
Mar 12, 2026
Merged

✨[RUM-14826] Add source code context to feature operations #4297
amortemousque merged 2 commits intomainfrom
aymeric/context-enrichement-for-operation

Conversation

@amortemousque
Copy link
Collaborator

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

  • Tested locally
  • Tested on staging
  • Added unit tests for this change.
  • Added e2e/integration tests for this change.
  • Updated documentation and/or relevant AGENTS.md file

@amortemousque amortemousque requested a review from a team as a code owner March 9, 2026 13:06
@amortemousque amortemousque changed the title ✨[RUM-14826] Source code context event enrichment ✨[RUM-14826] Add source code context to feature operations Mar 9, 2026
name: string,
stepType: 'start' | 'end',
options?: FeatureOperationOptions,
options?: FeatureOperationOptions & { handlingStack?: string },
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn’t add handlingStack to FeatureOperationOptions because FeatureOperationOptions is publicly exposed.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I'll make a followup pr

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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 })

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@amortemousque amortemousque merged commit b87d41d into main Mar 12, 2026
22 checks passed
@amortemousque amortemousque deleted the aymeric/context-enrichement-for-operation branch March 12, 2026 10:19
@github-actions github-actions bot locked and limited conversation to collaborators Mar 12, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants