Skip to content

Releases: photon-hq/otel

photon-otel v3.8.1

Choose a tag to compare

@photon-action-bot photon-action-bot released this 11 Sep 09:55

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.json so the npm package links back to the source repo correctly.

Version: 3.8.1

photon-otel v3.8.0

Choose a tag to compare

@photon-action-bot photon-action-bot released this 11 Sep 00:20

New Features

  • Added opt-in structured fetch request and response recording. You can choose bounded, full, or custom presets 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.method when the input is already a Request, 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

Choose a tag to compare

@photon-action-bot photon-action-bot released this 20 Aug 20:14

New Features

  • createIsolatedOtel() can now carry standard OTel Baggage through a private header with the new baggageHeader option. This lets isolated runtimes pass tenant/request context without touching the app’s normal baggage, traceparent, or tracestate headers. 🎒

  • 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 as ERROR and rethrows the original value, but it no longer automatically records exception details. Call runtime.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

Choose a tag to compare

@photon-action-bot photon-action-bot released this 12 Aug 21:22

Breaking Changes

  • setupOptionOtel() was replaced by createIsolatedOtel(). Update the related types from SetupOptionOtelOptions / OptionOtelHandle to IsolatedOtelOptions / IsolatedOtelHandle.
  • Isolated runtimes no longer reuse the main setupOtel() Resource or fixed photon-developer-traceparent header. You now pass serviceName, optional serviceVersion / resourceAttributes, and a private traceparentHeader explicitly.

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 traceparent header alone.

Bug Fixes

  • PHOTON_OTEL_VERSION now reads from package.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

Choose a tag to compare

@photon-action-bot photon-action-bot released this 11 Aug 20:07

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.id attributes.

Version: 3.5.0

photon-otel v3.4.0

Choose a tag to compare

@photon-action-bot photon-action-bot released this 08 Aug 20:36
f837922

New Features

  • Added setupOptionOtel() for creating an isolated trace and log runtime after setupOtel() 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, and run. These use the fixed photon-developer-traceparent header, so developer telemetry can cross async and service boundaries without touching the normal traceparent.

  • 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_VERSION so it now reports 3.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

Choose a tag to compare

@photon-action-bot photon-action-bot released this 21 Jul 22:39

Breaking Changes

  • setupOtel({ logLevel }) and setLogLevel() now win over LOG_LEVEL. If your deploys used LOG_LEVEL to override a value set in code, update the code-level setting instead.
  • The default log level is now always info; DEPLOYMENT_ENV=development no longer turns on debug logs 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_ENV only sets the deployment.environment resource attribute.
  • LOG_LEVEL is easier to use: values are trimmed, case-insensitive, empty values are treated as unset, and invalid values warn once before falling back to info.
  • Invalid programmatic log levels now throw a TypeError before changing logger state, which makes mistakes easier to catch in plain JavaScript.

Version: 3.3.0

photon-otel v3.2.0

Choose a tag to compare

@photon-action-bot photon-action-bot released this 17 Jul 02:03

New Features

  • setupOtel() now supports metrics alongside traces and logs. Use otel.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, and OTEL_METRIC_EXPORT_TIMEOUT.
  • Scoped mode now includes metrics too, so register: false keeps the app’s global meter provider untouched while still letting this setup emit metrics.

Bug Fixes

  • An empty OTEL_EXPORTER_OTLP_ENDPOINT no longer blocks the code-supplied endpoint; 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

Choose a tag to compare

@photon-action-bot photon-action-bot released this 30 Jun 21:45

New Features

  • Added redactUrl for fetch instrumentation, so you can keep fetch spans while removing secrets from the recorded url.full value. The actual request still uses the original URL. 🔒

  • Added sanitizeUrl(), a helper that redacts sensitive query values and user:pass@ credentials using the OpenTelemetry REDACTED convention. You can also pass your own query parameter names, like token or api_key.

Improvement

  • Updated the docs and examples to show when to use redactUrl instead of dropping spans with ignore, including the Node behavior where URL redaction uses the globalThis.fetch wrapper instead of native undici instrumentation.

Version: 3.1.0

photon-otel v3.0.0

Choose a tag to compare

@photon-action-bot photon-action-bot released this 30 Jun 20:09

Breaking Changes

  • OTEL_INSTRUMENT_FETCH has been removed. Use setupOtel({ instrumentFetch: false }) to turn fetch tracing off, or setupOtel({ 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 returns tracerProvider and loggerProvider on 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 by setupOtel(), which makes scoped mode work consistently across traces, logs, and fetch spans.

  • Automatic fetch instrumentation now defaults off in scoped mode, since wrapping global fetch affects the whole process. Use createInstrumentedFetch() for per-client tracing instead. ✨


Version: 3.0.0