Skip to content

Event processor migration: RequestData integration #20380

@Lms24

Description

@Lms24

This integration populates event.request, including headers, IP, cookies, etc. We need to set all this data as attributes on the segment span. Two strategies:

  • add the logic to applyScopeToSegmentSpan in captureSpan. This is preferrable from bundle-size perspective because captureSpan can be tree-shaken out for non-streaming users. But means request attribute creation isn't co-located with the integration. Might be a fine tradeoff though 🙂
    • I started a version of this for contexts in my experimental PoC branch:
      function applyScopeToSegmentSpan(segmentSpanJSON: SpanV2JSON, scopeData: ScopeData): void {
      // TODO: Apply all scope and request data from auto instrumentation (contexts, request) to segment span
      const { contexts } = scopeData;
      safeSetSpanJSONAttributes(segmentSpanJSON, contextsToAttributes(contexts));
      }
    • This also applies to other contexts kept on the scope.
  • Alternatively add a processSegmentSpan implementation to the integration

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions