feat(tracing): Move common tracing code to core#7339
Conversation
…try-javascript into feat/tracing-in-core
size-limit report 📦
|
| import { DEFAULT_ENVIRONMENT } from '../constants'; | ||
| import type { Hub } from '../hub'; |
There was a problem hiding this comment.
l: Do we want to point these to the actual definitions instead of to index?
There was a problem hiding this comment.
Changed the imports to use ../hub - does this still apply?
| import type { Hub } from '../hub'; | ||
| import { getCurrentHub } from '../hub'; |
| * Adds tracing extensions to the global hub. | ||
| */ | ||
| export function _addTracingExtensions(): void { | ||
| export function addTracingExtensions(): void { |
There was a problem hiding this comment.
l: Can we mark this as deprecated out of caution. I think we wanna move to dependency injection rather than functions with side-effects.
There was a problem hiding this comment.
Will do this in a follow up PR since we should make the deprecations the final step after we've moved everything over.
Lms24
left a comment
There was a problem hiding this comment.
Nice work, LGTM! (Just saw that Luca also already gave great feedback). Agree on leaving the tests in the tracing package for the time being.
| @@ -0,0 +1,72 @@ | |||
| import { addTracingExtensions, getMainCarrier } from '@sentry/core'; | |||
There was a problem hiding this comment.
the content of this file will be moved entirely to Node in the future, right?
There was a problem hiding this comment.
Yes it will! For now it should be completely tree-shaken out.
Supercedes #7166
Closes #7091
This PR:
core/src/tracing@sentry/corenow exports the same common types plus:addTracingExtensions- Required so that@sentry/tracingcan still add the extensions viaaddExtensionMethodsTRACING_DEFAULTS- This contains the timing defaults that are used across tracingaddExtensionMethodsin@sentry/tracingdue to_autoloadDatabaseIntegrations@sentry/tracingto ensure there are no breaking changes to public APIidletransaction.test.tsimports code from core soIdleTransactionSpanRecorderdoesn't need to be made publicThis PR does not:
Span,Transaction, etc from@sentry/corerather than@sentry/tracing