Skip to content

ref!: remove hub API - #1407

Open
giortzisg wants to merge 1 commit into
scopes/examples-scopesfrom
scopes/remove-hub-final
Open

ref!: remove hub API#1407
giortzisg wants to merge 1 commit into
scopes/examples-scopesfrom
scopes/remove-hub-final

Conversation

@giortzisg

Copy link
Copy Markdown
Contributor

Description

This removes the hub API.

Issues

Changelog Entry Instructions

To add a custom changelog entry, uncomment the section above. Supports:

  • Single entry: just write text
  • Multiple entries: use bullet points
  • Nested bullets: indent 4+ spaces

For more details: custom changelog entries

Reminders

Stack created with GitHub Stacks CLIGive Feedback 💬

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 3 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 1aeedf5. Configure here.

Comment thread sentry.go
func LastEventID() EventID {
hub := CurrentHub()
return hub.LastEventID()
return GlobalScope().LastEventID()

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

LastEventID misses typical captures

Medium Severity

LastEventID() now reads GlobalScope(), but captures only record an ID when ScopeFromContext is non-nil. CaptureException(context.Background(), err) after Init leaves the ID unset, so the package-level helper stays empty. Isolation-scope captures also never update GlobalScope.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 1aeedf5. Configure here.

Comment thread logrus/logrusentry.go
ctx = sentry.ContextWithScope(ctx, sentry.ScopeFromContext(h.defaultCtx))
}
if hub == nil {
hub = h.defaultHub

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Logrus provider drops traces

Medium Severity

SetContextProvider is documented to supply an operation-specific client, scope, or trace, but Fire only copies the provider scope onto the entry context. After scope.span was removed, spans live only on context, so the provider's active span is discarded and logs lose span correlation.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 1aeedf5. Configure here.

Comment thread slog/sentryslog.go
// When logging without context, slog passes context.Background. Preserve the
// handler context so its client and scope defaults remain effective.
if sentry.ScopeFromContext(ctx) == nil {
ctx = sentry.ContextWithScope(ctx, sentry.ScopeFromContext(h.logger.GetCtx()))

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Slog drops handler trace context

Medium Severity

When slog logs without a scope (including logger.Info, which passes context.Background()), the handler only copies the logger's scope onto the incoming context. The previous code used h.logger.GetCtx() wholesale, so an active span on the handler context is no longer applied and those logs lose trace linking.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 1aeedf5. Configure here.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant