Releases: photon-hq/otel
Release list
photon-otel v3.8.1
Improvement
- Publishing is now set up to use npm trusted publishing with OIDC, which makes releases more secure and less dependent on long-lived npm tokens. 🔐
- Added the repository metadata to
package.jsonso the npm package links back to the source repo correctly.
Version: 3.8.1
photon-otel v3.8.0
New Features
- Added opt-in structured fetch request and response recording. You can choose
bounded,full, orcustompresets to capture Fetch-visible headers, bodies, metadata, and parser-shaped payloads as OTLP logs linked to the fetch span. ✨ - Added
flushFetchRecords()so standalone fetch instrumentation can drain pending request/response records before shutting down exporters. - Custom recording parsers can now transform request or response records before export, with timeout handling and configurable raw-or-omit fallback on parser errors.
Bug Fixes
- Fetch spans now respect
init.methodwhen the input is already aRequest, so overridden methods are reported correctly. - Fetch recording avoids recursive instrumentation when tracing is suppressed, including fetches started inside custom parsers.
Improvement
setupOtel().shutdown()now drains pending fetch recordings before shutting down providers.- Fetch recording is documented in the README and fetch instrumentation guide, including presets, limits, parser behavior, flushing, and privacy tradeoffs.
Version: 3.8.0
photon-otel v3.7.0
New Features
-
createIsolatedOtel()can now carry standard OTel Baggage through a private header with the newbaggageHeaderoption. This lets isolated runtimes pass tenant/request context without touching the app’s normalbaggage,traceparent, ortracestateheaders. 🎒 -
Isolated runtimes now expose
recordError(error)for explicitly exporting exception type, message, and stack on the active isolated span.
Breaking Changes
- Isolated
withSpan()still marks thrown errors asERRORand rethrows the original value, but it no longer automatically records exception details. Callruntime.recordError(error)inside the span when you want those details exported.
Improvement
-
Private propagation header validation is stricter: isolated trace and baggage carriers cannot use standard OTel header names, and the baggage header must be different from the trace header.
-
README examples now show private baggage propagation and the new explicit error-recording flow.
Version: 3.7.0
photon-otel v3.6.0
Breaking Changes
setupOptionOtel()was replaced bycreateIsolatedOtel(). Update the related types fromSetupOptionOtelOptions/OptionOtelHandletoIsolatedOtelOptions/IsolatedOtelHandle.- Isolated runtimes no longer reuse the main
setupOtel()Resource or fixedphoton-developer-traceparentheader. You now passserviceName, optionalserviceVersion/resourceAttributes, and a privatetraceparentHeaderexplicitly.
New Features
- Added
createIsolatedOtel()for fully independent trace + log runtimes. Each call creates its own providers, exporters, Resource, and async context without touching global OTel state. ✨ - Isolated propagation now supports a caller-defined private trace header, while leaving the standard
traceparentheader alone.
Bug Fixes
PHOTON_OTEL_VERSIONnow reads frompackage.json, so it stays aligned with the published package version instead of drifting behind releases.
Improvement
- Docs and API references now describe the isolated runtime model more clearly, including shutdown, propagation, Resource behavior, and migration from the old option runtime.
Version: 3.6.0
photon-otel v3.5.0
New Features
- Added
withActiveSpan()for lower-level instrumentation. It supports full OpenTelemetry span options, explicit parent contexts, and gives the callback access to the active span.
Bug Fixes
- Fixed suppressed tracing so it no longer creates, activates, exports, or injects spans when tracing is intentionally disabled. The wrapped callback still runs as expected. ✨
Improvement
- Updated option runtime docs and examples to use Photon Project naming and
photon.project.idattributes.
Version: 3.5.0
photon-otel v3.4.0
New Features
-
Added
setupOptionOtel()for creating an isolated trace and log runtime aftersetupOtel()is active. It sends to its own OTLP endpoint, reuses the main service resource, and does not replace globals, patch fetch, or mix with the main active span. ✨ -
Added option-runtime propagation helpers:
capture,inject,extract, andrun. These use the fixedphoton-developer-traceparentheader, so developer telemetry can cross async and service boundaries without touching the normaltraceparent. -
Added explicit option-runtime logging and
withSpan()APIs for developer logs/spans. Errors are recorded on spans and rethrown unchanged, while telemetry emission failures stay fail-open for business code.
Bug Fixes
- Fixed
PHOTON_OTEL_VERSIONso it now reports3.4.0, matching the package version.
Improvement
- Added docs and tests for the isolated option runtime, covering setup requirements, shutdown behavior, trace isolation, log correlation, propagation, invalid headers, and failure handling.
Version: 3.4.0
photon-otel v3.3.0
Breaking Changes
setupOtel({ logLevel })andsetLogLevel()now win overLOG_LEVEL. If your deploys usedLOG_LEVELto override a value set in code, update the code-level setting instead.- The default log level is now always
info;DEPLOYMENT_ENV=developmentno longer turns ondebuglogs by default.
Bug Fixes
- Fixed the release workflow permissions so GitHub can validate the reusable release job and publish reliably. 🚀
Improvement
- Logger configuration is now separate from deployment metadata, so
DEPLOYMENT_ENVonly sets thedeployment.environmentresource attribute. LOG_LEVELis easier to use: values are trimmed, case-insensitive, empty values are treated as unset, and invalid values warn once before falling back toinfo.- Invalid programmatic log levels now throw a
TypeErrorbefore changing logger state, which makes mistakes easier to catch in plain JavaScript.
Version: 3.3.0
photon-otel v3.2.0
New Features
setupOtel()now supports metrics alongside traces and logs. Useotel.getMeter(name)from the returned handle to create counters and other OpenTelemetry instruments.- Metrics can export over OTLP/HTTP with
/v1/metrics,OTEL_EXPORTER_OTLP_METRICS_ENDPOINT,OTEL_EXPORTER_OTLP_METRICS_HEADERS,OTEL_METRIC_EXPORT_INTERVAL, andOTEL_METRIC_EXPORT_TIMEOUT. - Scoped mode now includes metrics too, so
register: falsekeeps the app’s global meter provider untouched while still letting this setup emit metrics.
Bug Fixes
- An empty
OTEL_EXPORTER_OTLP_ENDPOINTno longer blocks the code-suppliedendpoint; it now falls back correctly. - Fetch auto-instrumentation now ignores the metrics exporter endpoint too, so OTLP metric export requests do not get traced by accident.
Improvement
- OTLP endpoint and header handling is now shared across traces, logs, and metrics, with signal-specific headers supported for each signal.
- Added a metrics guide, updated API/environment docs, and expanded Collector integration tests to verify real metric delivery. 📈
Version: 3.2.0
photon-otel v3.1.0
New Features
-
Added
redactUrlfor fetch instrumentation, so you can keep fetch spans while removing secrets from the recordedurl.fullvalue. The actual request still uses the original URL. 🔒 -
Added
sanitizeUrl(), a helper that redacts sensitive query values anduser:pass@credentials using the OpenTelemetryREDACTEDconvention. You can also pass your own query parameter names, liketokenorapi_key.
Improvement
- Updated the docs and examples to show when to use
redactUrlinstead of dropping spans withignore, including the Node behavior where URL redaction uses theglobalThis.fetchwrapper instead of native undici instrumentation.
Version: 3.1.0
photon-otel v3.0.0
Breaking Changes
OTEL_INSTRUMENT_FETCHhas been removed. UsesetupOtel({ instrumentFetch: false })to turn fetch tracing off, orsetupOtel({ register: false })when embedding telemetry inside another library.
New Features
-
Added scoped mode with
setupOtel({ register: false }), so libraries can emit their own spans and logs without taking over the host app’s global OpenTelemetry setup. -
setupOtel()now returnstracerProviderandloggerProvideron the handle, making it easier to build extra tracers or attach processors when needed.
Improvement
-
withSpan,createLogger, and instrumented fetch now route through the active providers created bysetupOtel(), which makes scoped mode work consistently across traces, logs, and fetch spans. -
Automatic fetch instrumentation now defaults off in scoped mode, since wrapping global
fetchaffects the whole process. UsecreateInstrumentedFetch()for per-client tracing instead. ✨
Version: 3.0.0