feat: add StrictTraceContinuation option#1210
Conversation
Semver Impact of This PR🟡 Minor (new features) 📋 Changelog PreviewThis is how your changes will appear in the changelog. New Features ✨
Bug Fixes 🐛
Internal Changes 🔧Ai
Deps
Other
🤖 This preview updates automatically when you update the PR. |
sl0thentr0py
left a comment
There was a problem hiding this comment.
just one comment, feel free to ignore
|
maybe add test cases for having a custom orgID supplied along with a DSN to ensure custom one gets priority |
| func TestClient_ParseOrgID(t *testing.T) { | ||
| c, err := NewClient(ClientOptions{ | ||
| Dsn: "https://[email protected]/1337", | ||
| }) | ||
| if err != nil { | ||
| t.Fatal(err) | ||
| } | ||
| assert.Equal(t, uint64(1), c.dsn.GetOrgID(), "Custom org id should override the DSN parsed one") | ||
| } | ||
|
|
||
| func TestClientOptions_OrgIDShouldOverrideParsed(t *testing.T) { | ||
| c, err := NewClient(ClientOptions{ | ||
| Dsn: "https://[email protected]/1337", | ||
| OrgID: 2, | ||
| }) | ||
| if err != nil { | ||
| t.Fatal(err) | ||
| } | ||
| assert.Equal(t, uint64(2), c.dsn.GetOrgID(), "Custom org id should override the DSN parsed one") | ||
| } |
There was a problem hiding this comment.
Can we add another test for self-hosted DSN?
An example would be: https://[email protected]/1337
There was a problem hiding this comment.
You would need to use the OrgID option anyways, since we can't parse an id from the DSN, so TestClientOptions_OrgIDShouldOverrideParsed should verify both, but I can add a small one just to be sure.
There was a problem hiding this comment.
Yep. But since it's self-hosted, the default OrgId will be 0 though. It should be considered as non-empty value.
There was a problem hiding this comment.
we consider 0 as empty, since we can't really distinguish, self hosted orgs should just use the OrgID clientoption. The tracing tests cover that case.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Description
add
StrictTraceContinuationoption according to https://develop.sentry.dev/sdk/telemetry/traces/#stricttracecontinuation.Issues
Changelog Entry Instructions
To add a custom changelog entry, uncomment the section above. Supports:
For more details: custom changelog entries
Reminders
feat:,fix:,ref:,meta:)Changelog Entry