Repository navigation
feat(effect)!: Rename exports and add layers for tracing and logs - #26731
Conversation
size-limit report 📦Compared: 1f33983 (PR test merge using develop at a0df3cb) Against: a0df3cb (develop) · base run #67668 ✅ Baseline matches: this diff contains only this PR's changes.
|
Optional E2E testsSome optional checks were not successful. They do not block the merge. 2 not successful, 67 successful. See the run.
Successful checks
|
0a02c8c to
e876c60
Compare
872247d to
f66aad6
Compare
f4391a2 to
e3803af
Compare
|
One or more gzipped bundles increased by more than 500 bytes. If this increase is intentional, add the Accept Bundlesize Increase label to this PR to rerun and accept the check. |
Rename `effectLayer` to `layer`, `SentryEffectTracer` to `Tracer`, `SentryEffectLogger` to `Logger`, `SentryEffectMetricsLayer` to `metricsLayer` and `SentryEffectExternalSpanLayer` to `externalSpanLayer`, so the exports read like an Effect module under `import * as Sentry`. Layer values are camelCase, as in Effect's own API (`Metric.enableRuntimeMetricsLayer`). The old names are removed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
e3803af to
7c0c56b
Compare
andreiborza
left a comment
There was a problem hiding this comment.
Ok, but why break this mid-major? We should add deprecation warnings to the old ones and re-export both.
|
@andreiborza the effect sdk is still in alpha so should be fine? |
andreiborza
left a comment
There was a problem hiding this comment.
@nicohrubec right, just talked to @JPeer264 too about this. Makes sense to me.
This renames the
@sentry/effectexports to Effect's naming style and turns the tracer and the logger into layers, so the setup is the same for Effect v3 and v4. The old names are removed.Sentry.effectLayerSentry.layerLayer.setTracer(Sentry.SentryEffectTracer)(v3),Layer.succeed(Tracer.Tracer, Sentry.SentryEffectTracer)(v4)Sentry.layerTracerLogger.replace(Logger.defaultLogger, Sentry.SentryEffectLogger)(v3),Logger.layer([Sentry.SentryEffectLogger])(v4)Sentry.layerLoggerSentry.SentryEffectMetricsLayerSentry.layerMetricsSentry.SentryEffectExternalSpanLayerSentry.layerExternalSpanWhy
The Effect team recommended these names:
layeris how Effect modules name their main layer, and Effect names its other layerslayer…(for exampleOtlpSerialization.layerJson). A rawSentry.Loggerexport would differ fromSentry.logger(the Sentry logs API) only in the case of the first letter.Logger decisions
Sentry.layerLoggeradds the Sentry logger to the loggers in place, so Effect still logs to the console. The alternative is to replace the console logger, as the old docs did.Known issues
Layer.mergeAllkeeps only one of two layers that add a logger, for exampleSentry.layerLoggerandOtlpLogger.layer. Stack them withLayer.provideMergeinstead. Effect's own logger layers behave the same.