Skip to content

ref(http): migrate fiber and fasthttp to context scope API - #1402

Open
giortzisg wants to merge 1 commit into
scopes/http-framework-integrationsfrom
scopes/fiber-fasthttp-integrations
Open

giortzisg wants to merge 1 commit into
scopes/http-framework-integrationsfrom
scopes/fiber-fasthttp-integrations

Conversation

@giortzisg

Copy link
Copy Markdown
Contributor

Description

This migrates fasthttp frameworks to the new scopes 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

@giortzisg
giortzisg force-pushed the scopes/fiber-fasthttp-integrations branch from c51544f to a2b75f9 Compare August 31, 2026 10:50
@giortzisg
giortzisg marked this pull request as ready for review August 31, 2026 10:52
Comment thread fiber/sentryfiber.go
@giortzisg
giortzisg force-pushed the scopes/fiber-fasthttp-integrations branch from a2b75f9 to 603e3a2 Compare September 1, 2026 09:13
@giortzisg
giortzisg force-pushed the scopes/fiber-fasthttp-integrations branch from 603e3a2 to 71174c7 Compare September 1, 2026 12:22

@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.

Stale Bugbot comment from a previous run.

Comment thread fiber/sentryfiber.go
@giortzisg
giortzisg force-pushed the scopes/fiber-fasthttp-integrations branch from 71174c7 to 630a26a Compare September 1, 2026 12:58
@giortzisg
giortzisg force-pushed the scopes/fiber-fasthttp-integrations branch from 630a26a to 7efce58 Compare September 2, 2026 07:59
@giortzisg
giortzisg force-pushed the scopes/fiber-fasthttp-integrations branch from 7efce58 to 204d3b1 Compare September 4, 2026 13:12
Comment thread fasthttp/sentryfasthttp.go
@giortzisg
giortzisg force-pushed the scopes/fiber-fasthttp-integrations branch from 204d3b1 to 545a30d Compare September 4, 2026 13:26
@giortzisg
giortzisg force-pushed the scopes/fiber-fasthttp-integrations branch from 545a30d to e6596b7 Compare September 7, 2026 11:40
@giortzisg
giortzisg force-pushed the scopes/fiber-fasthttp-integrations branch from e6596b7 to fe5ae57 Compare September 7, 2026 11:50

@szokeasaurusrex szokeasaurusrex left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Again some questions but seems reasonable

Comment thread fasthttp/sentryfasthttp.go Outdated
Comment on lines 67 to 70
if storedCtx, ok := ctx.UserValue(contextKey{}).(*storedContext); ok {
storedCtx.cancel()
parentCtx = context.Background()
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

[question] What is a storedContext and why is it needed for FastHTTP? I did not see anything similar in the other HTTP frameworks.

func TestSetHubOnContext(t *testing.T) {
hub := sentry.NewHub(sentry.CurrentHub().Client(), sentry.NewScope())
ctx := &fasthttp.RequestCtx{}
func TestRequestIsolation(t *testing.T) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

[question] I am just wondering why we added this test here, for fasthttp, and not for the other HTTP frameworks in the previous PRs?

The test does also seem quite complex, and it seems we implemented similar tests in fiber and fiberv3 also, so I wonder if we could extract the common logic somehow and/or simplify it a bit

@giortzisg
giortzisg force-pushed the scopes/fiber-fasthttp-integrations branch from fe5ae57 to 798d05b Compare September 16, 2026 09:14
Comment thread fiber/sentryfiber.go
@giortzisg
giortzisg force-pushed the scopes/fiber-fasthttp-integrations branch from 798d05b to 6259c50 Compare September 17, 2026 08:38
@giortzisg
giortzisg force-pushed the scopes/fiber-fasthttp-integrations branch from 6259c50 to 6107215 Compare September 17, 2026 09:09

@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 1 potential issue.

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 6107215. Configure here.

Comment thread fasthttp/sentryfasthttp.go
Carry isolated scopes through native Fiber contexts and an explicit FastHTTP context bridge, including the framework error-handler lifecycle. Preserve active caller traces and let only the transaction creator update or finish them.

Keep outer request cleanup registered across nested wrappers, distinguish active FastHTTP nesting from pooled request reuse, and read all incoming baggage values.

Fiber v2, Fiber v3, and FastHTTP GetHubFromContext, SetHubOnContext, and GetSpanFromContext helpers are removed. Use the integrations' GetContext helpers and the root sentry context accessors, plus FastHTTP SetContext when supplying a parent context.
@giortzisg
giortzisg removed this pull request from stack #1420 September 18, 2026 11:17
@giortzisg
giortzisg force-pushed the scopes/fiber-fasthttp-integrations branch from 6107215 to e91a65d Compare September 18, 2026 11:18
@giortzisg
giortzisg added this pull request to stack #1433 September 18, 2026 11:22
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.

2 participants