Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(node): Move tracing options to Http integration #6191

Merged
merged 5 commits into from Nov 15, 2022

Conversation

timfish
Copy link
Collaborator

@timfish timfish commented Nov 11, 2022

Ref #5285 (comment)

Since both tracing and shouldCreateSpanForRequest effectively control whether tracing is enabled and have opposing defaults (tracing: false and shouldCreateSpanForRequest: _ => true), I have made tracing: TracingOptions | boolean so its not a breaking change and the options don't end up conflicting.

interface TracingOptions {
  tracePropagationTargets?: TracePropagationTargets;
  shouldCreateSpanForRequest?: (url: string) => boolean;
}

interface HttpOptions {
  breadcrumbs?: boolean;
  tracing?: TracingOptions | boolean;
}

The tests diff looks scary but all I did was duplicate the tracePropagationTargets and shouldCreateSpanForRequest tests to ensure they can be set via the constructor options.

@timfish timfish force-pushed the feat/tracing-options-http-integration branch from 3f3c08e to 0513657 Compare November 11, 2022 13:41
@timfish timfish changed the title feat(node): Add tracing options to Http integration feat(node): Move tracing options to Http integration Nov 12, 2022
@timfish timfish marked this pull request as ready for review November 12, 2022 09:52
@timfish timfish self-assigned this Nov 13, 2022
Copy link
Member

@Lms24 Lms24 left a comment

Choose a reason for hiding this comment

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

I like the change and to me it makes sense that we nest these two properties under the tracing options.

packages/node/test/integrations/http.test.ts Outdated Show resolved Hide resolved
Co-authored-by: Lukas Stracke <lukas.stracke@sentry.io>
@Lms24 Lms24 merged commit 23c19bf into getsentry:master Nov 15, 2022
@timfish timfish deleted the feat/tracing-options-http-integration branch November 29, 2022 09:36
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.

None yet

2 participants