Skip to content

feat(tracing): Move registerErrorInstrumentation to @sentry/core#7494

Merged
AbhiPrasad merged 2 commits intogetsentry:developfrom
timfish:fix/error-instrumentation
Mar 17, 2023
Merged

feat(tracing): Move registerErrorInstrumentation to @sentry/core#7494
AbhiPrasad merged 2 commits intogetsentry:developfrom
timfish:fix/error-instrumentation

Conversation

@timfish
Copy link
Copy Markdown
Collaborator

@timfish timfish commented Mar 16, 2023

addTracingExtensions in @sentry/core feels like our better named replacement for addExtensionMethods however it didn't end up with the same functionality.

While working on other tracing PRs I realised that we'd not moved registerErrorInstrumentation to core and it makes more sense for it to be there.

This PR moves registerErrorInstrumentation to @sentry/core and calls it from addTracingExtensions since they are called together in addExtensionMethods. It also adds a flag so errors are only instrumented once. This means we can safely call addTracingExtensions as many times as we like (ie. from integration constructors, etc).

@timfish timfish changed the title feat(tracing): Move registerErrorInstrumentation to core and call it from addTracingExtensions feat(tracing): Move registerErrorInstrumentation to @sentry/core Mar 17, 2023
@timfish timfish marked this pull request as ready for review March 17, 2023 10:09
@AbhiPrasad AbhiPrasad merged commit 128f7bc into getsentry:develop Mar 17, 2023
@jensbodal
Copy link
Copy Markdown

I can't find this information elsewhere, does this mean addExtensionMethods is deprecated in favor of addTracingExtensions? The packages only tells me that addExtensionMethods is deprecated but I don't see it exported anywhere else.

@timfish
Copy link
Copy Markdown
Collaborator Author

timfish commented May 11, 2023

The @sentry/tracing package has been deprecated and will be removed in v8.

addTracingExtensions should be exported from every SDK package and should be used as a replacement for addExtensionMethods.

@timfish
Copy link
Copy Markdown
Collaborator Author

timfish commented May 11, 2023

Sorry about that. It looks like this was missed from the migration guide.

I've opened a PR to rectify this!

@timfish timfish deleted the fix/error-instrumentation branch May 11, 2023 09:57
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.

3 participants