Skip to content

feat(cloud_resource_context): Support span streaming#6550

Closed
alexander-alderman-webb wants to merge 1 commit into
masterfrom
webb/cloud-resource-context/span-first
Closed

feat(cloud_resource_context): Support span streaming#6550
alexander-alderman-webb wants to merge 1 commit into
masterfrom
webb/cloud-resource-context/span-first

Conversation

@alexander-alderman-webb

@alexander-alderman-webb alexander-alderman-webb commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Description

Set data currently set on context as attributes on the isolation scope.

All attributes are in sentry-conventions, except for host.id and host.type.
Conventions PRs for these are approved:

Tests only check integration internals, so no tests are required to maintain the same test coverage as before.

Issues

Closes #6012

Reminders

@alexander-alderman-webb alexander-alderman-webb marked this pull request as ready for review June 10, 2026 08:19
@alexander-alderman-webb alexander-alderman-webb requested a review from a team as a code owner June 10, 2026 08:19
@github-actions

Copy link
Copy Markdown
Contributor

Codecov Results 📊

88950 passed | ⏭️ 6013 skipped | Total: 94963 | Pass Rate: 93.67% | Execution Time: 301m 12s

📊 Comparison with Base Branch

Metric Change
Total Tests 📈 +783
Passed Tests 📈 +678
Failed Tests
Skipped Tests 📈 +105

All tests are passing successfully.

✅ Patch coverage is 100.00%. Project has 2374 uncovered lines.
✅ Project coverage is 89.87%. Comparing base (base) to head (head).

Coverage diff
@@            Coverage Diff             @@
##          main       #PR       +/-##
==========================================
+ Coverage    89.84%    89.87%    +0.03%
==========================================
  Files          192       192         —
  Lines        23430     23433        +3
  Branches      8050      8052        +2
==========================================
+ Hits         21049     21059       +10
- Misses        2381      2374        -7
- Partials      1333      1329        -4

Generated by Codecov Action

if context != {}:
set_context(CONTEXT_TYPE, context)
for k, v in context.items():
sentry_sdk.get_isolation_scope().set_attribute(k, v)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This will set the attributes on all spans. Given that they're not in the common attrs list, they should probably be set on the segment of the current span instead?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes, the attributes should be on the segment span.
Now I look at this, I'm not sure how that would work because the context is set in setup_once().
I guess we would need some mechanism to set attributes on a scope that are then only applied on the segment span.
Alternatively, we consider not migrating the integration to span first.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Right, missed that we're in setup_once here.

I would leave this integration out for now. I believe it'd make sense for this to live in the aws/gcp integrations eventually, but as is, I'd not migrate. Errors will still get the context and that's probably where it's most useful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Migrate cloud_resource_context to span first

2 participants