# `@adobe/aio-lib-telemetry`

## 1.3.0

### Minor Changes

- [#132](https://github.com/adobe/aio-lib-telemetry/pull/132) [`5de8996`](https://github.com/adobe/aio-lib-telemetry/commit/5de89960e09a53190d17990a7b628ff2de0cc152) Thanks [@iivvaannxx](https://github.com/iivvaannxx)! - Expose stable resource attributes through `getAioRuntimeResourceAttributes` and current invocation attributes through `getAioRuntimeInvocationAttributes`. Deprecate `getAioRuntimeAttributes` while preserving its combined output for compatibility.

- [#132](https://github.com/adobe/aio-lib-telemetry/pull/132) [`5de8996`](https://github.com/adobe/aio-lib-telemetry/commit/5de89960e09a53190d17990a7b628ff2de0cc152) Thanks [@iivvaannxx](https://github.com/iivvaannxx)! - Expose the region selected at execution time as `action.region` through `getAioRuntimeInvocationAttributes`, on spans created through the library's instrumentation helpers, and on logs exported through `getLogger`. The value may differ between invocations because Runtime routes each invocation independently.

### Patch Changes

- [#132](https://github.com/adobe/aio-lib-telemetry/pull/132) [`5de8996`](https://github.com/adobe/aio-lib-telemetry/commit/5de89960e09a53190d17990a7b628ff2de0cc152) Thanks [@iivvaannxx](https://github.com/iivvaannxx)! - Correct runtime metadata across warm container invocations:

  - Keep only stable action and service attributes on the shared OpenTelemetry resource, avoiding high-cardinality metric dimensions.
  - Attach the current activation ID, transaction ID, and deadline to spans created through the library's instrumentation helpers and logs exported through `getLogger` for every invocation.
  - Ensure logs emitted through reused logger instances use the current invocation attributes.

## 1.2.0

### Minor Changes

- [#112](https://github.com/adobe/aio-lib-telemetry/pull/112) [`d6100ad`](https://github.com/adobe/aio-lib-telemetry/commit/d6100adc7398ac148cb50ef017650592fe0a27e6) Thanks [@iivvaannxx](https://github.com/iivvaannxx)! - Drop Node 20 support (EOL April 2026)

## 1.1.4

### Patch Changes

- [#109](https://github.com/adobe/aio-lib-telemetry/pull/109) [`473880a`](https://github.com/adobe/aio-lib-telemetry/commit/473880a09ecbcf2cc9fc1910bfa671a7f77ea4ac) Thanks [@iivvaannxx](https://github.com/iivvaannxx)! - Update the following dependencies:
  - `@opentelemetry/api` `^1.9.0` → `^1.9.1`
  - `@opentelemetry/api-logs` `^0.208.0` → `^0.218.0`
  - `@opentelemetry/auto-instrumentations-node` `^0.67.0` → `^0.76.0`
  - `@opentelemetry/exporter-logs-otlp-grpc` `^0.208.0` → `^0.218.0`
  - `@opentelemetry/exporter-logs-otlp-http` `^0.208.0` → `^0.218.0`
  - `@opentelemetry/exporter-logs-otlp-proto` `^0.208.0` → `^0.218.0`
  - `@opentelemetry/exporter-metrics-otlp-grpc` `^0.208.0` → `^0.218.0`
  - `@opentelemetry/exporter-metrics-otlp-http` `^0.208.0` → `^0.218.0`
  - `@opentelemetry/exporter-metrics-otlp-proto` `^0.208.0` → `^0.218.0`
  - `@opentelemetry/exporter-trace-otlp-grpc` `^0.208.0` → `^0.218.0`
  - `@opentelemetry/exporter-trace-otlp-http` `^0.208.0` → `^0.218.0`
  - `@opentelemetry/exporter-trace-otlp-proto` `^0.208.0` → `^0.218.0`
  - `@opentelemetry/instrumentation` `^0.208.0` → `^0.218.0`
  - `@opentelemetry/instrumentation-graphql` `^0.56.0` → `^0.66.0`
  - `@opentelemetry/instrumentation-http` `^0.208.0` → `^0.218.0`
  - `@opentelemetry/instrumentation-undici` `^0.19.0` → `^0.28.0`
  - `@opentelemetry/otlp-exporter-base` `^0.208.0` → `^0.218.0`
  - `@opentelemetry/otlp-grpc-exporter-base` `^0.208.0` → `^0.218.0`
  - `@opentelemetry/resources` `^2.0.1` → `^2.7.1`
  - `@opentelemetry/sdk-logs` `^0.208.0` → `^0.218.0`
  - `@opentelemetry/sdk-metrics` `^2.0.0` → `^2.7.1`
  - `@opentelemetry/sdk-node` `^0.208.0` → `^0.218.0`
  - `@opentelemetry/sdk-trace-node` `^2.0.0` → `^2.7.1`
  - `@opentelemetry/semantic-conventions` `^1.33.0` → `^1.41.1`
  - `@opentelemetry/winston-transport` `^0.19.0` → `^0.28.0`

## 1.1.3

### Patch Changes

- [#80](https://github.com/adobe/aio-lib-telemetry/pull/80) [`e8f2c96`](https://github.com/adobe/aio-lib-telemetry/commit/e8f2c96eb79e8425b9649bebd964bbc1020d8aa5) Thanks [@iivvaannxx](https://github.com/iivvaannxx)! - Fixes a misconfiguration in the `package.json` export paths that was preventing correct usage of the library.

## 1.1.2

### Patch Changes

- [#73](https://github.com/adobe/aio-lib-telemetry/pull/73) [`670dfc9`](https://github.com/adobe/aio-lib-telemetry/commit/670dfc9244b80f89271b08b4ce8df7e831a2a080) Thanks [@iivvaannxx](https://github.com/iivvaannxx)! - Fixes the `export` paths for ESM which were pointing to wrong files

## 1.1.1

### Patch Changes

- [`5542c99`](https://github.com/adobe/aio-lib-telemetry/commit/5542c993df9f8328e36fe67c0a16f0e17b9a9b1f) Thanks [@iivvaannxx](https://github.com/iivvaannxx)! - Add [versioning policy](https://github.com/adobe/aio-lib-telemetry/blob/main/README.md#versioning-policy) to the README.

- [`d9b3f27`](https://github.com/adobe/aio-lib-telemetry/commit/d9b3f273af3b1ea79aae1aa34d237a0804b84fcb) Thanks [@iivvaannxx](https://github.com/iivvaannxx)! - [[BREAKING]](https://github.com/adobe/aio-lib-telemetry/blob/main/README.md#versioning-policy) Update OpenTelemetry dependencies (see the [Renovate PR](https://github.com/adobe/aio-lib-telemetry/pull/62) for the full list). The `otel` entrypoint no longer re-exports the `NoopLogRecordProcessor` class, as it's no longer exported by the OpenTelemetry Logs SDK. If you were using it, removing it should be safe, as it basically does nothing and it's the same as not using the processor at all.

## 1.1.0

### Minor Changes

- [#53](https://github.com/adobe/aio-lib-telemetry/pull/53) [`da43624`](https://github.com/adobe/aio-lib-telemetry/commit/da43624af232c1ac9031ac88493037b9dede969e) Thanks [@iivvaannxx](https://github.com/iivvaannxx)! - Add support for an `integrations` feature to easily integrate with external systems that require a specific configuration. Introduces a `commerceEvents` and a `commerceWebhooks` integrations that are available from `@adobe/aio-lib-telemetry/integrations` which can be used to automatically configure context propagation for requests or events coming from [Adobe Commerce Webhooks](https://developer-stage.adobe.com/commerce/extensibility/webhooks/) or [Adobe Commerce Events](https://developer-stage.adobe.com/commerce/extensibility/events/).

- [#47](https://github.com/adobe/aio-lib-telemetry/pull/47) [`6fb3032`](https://github.com/adobe/aio-lib-telemetry/commit/6fb30324206200bd72ef8a99d78f7c02c90e8864) Thanks [@iivvaannxx](https://github.com/iivvaannxx)! - Automatically mark root spans with an error status if they return a response that matches an unsuccessful response shape (according to [App Builder documentation](https://developer.adobe.com/app-builder/docs/guides/runtime_guides/creating-actions#unsuccessful-response))

- [#53](https://github.com/adobe/aio-lib-telemetry/pull/53) [`da43624`](https://github.com/adobe/aio-lib-telemetry/commit/da43624af232c1ac9031ac88493037b9dede969e) Thanks [@iivvaannxx](https://github.com/iivvaannxx)! - Deprecate custom `x-telemetry-context` header. From now on, if invoking via HTTP requests, propagated context doesn't need to be nested inside that header. Following the W3C Trace Propagation spec, you can send the `traceparent` (and related) headers as normal headers. They will be picked from `__ow_headers` instead. **Note that this only applies for runtime actions invoked via HTTP requests**. When invoked via events you should still use the special `__telemetryContext` variables or specify yourself where to find the context carrier.

## 1.0.0

### Major Changes

- [#16](https://github.com/adobe/aio-lib-telemetry/pull/16) [`efae3f9`](https://github.com/adobe/aio-lib-telemetry/commit/efae3f97cea34a6199241e1e7e64bc072707607b) Thanks [@iivvaannxx](https://github.com/iivvaannxx)! - Removed attributes that exposed runtime environment information. These include the following: `deployment.region`, `deployment.cloud`, plus all the `host`, `os` and `process` attributes.

  It also renames `deployment.environment` to `environment`.

  Finally, attributes like `action.package_name` and `action.transaction_id` are now not added if they are `unknown`. `action.version` is also not included in `development`, as the value was always fixed to `0.0.0 (development)`, which is not much useful and there's already the `environment` attribute.

  You should not need to update your code, but acknowledge that some attributes are now missing. If you want them you should add them manually.

- [`0bc0a0e`](https://github.com/adobe/aio-lib-telemetry/commit/0bc0a0e481156051cdf141b07486500fd1cd1aba) Thanks [@renovate[bot]](https://github.com/renovate%5Bbot%5D)! - The `LogRecord` type (exported from the `otel` entrypoint) has been renamed to `SdkLogRecord` and it's no longer a class but a TypeScript interface.

- [#16](https://github.com/adobe/aio-lib-telemetry/pull/16) [`efae3f9`](https://github.com/adobe/aio-lib-telemetry/commit/efae3f97cea34a6199241e1e7e64bc072707607b) Thanks [@iivvaannxx](https://github.com/iivvaannxx)! - [`getPresetInstrumentations`](./docs/api-reference/functions/getPresetInstrumentations.md) now throws an `Error` if the given `preset` is unknown. This change has been made to prevent silent failures.

  There's no need to update your code if you're using correctly the presets provided by the library. At most you may want to add a `try`/`catch` block to handle the error.

### Minor Changes

- [`0bc0a0e`](https://github.com/adobe/aio-lib-telemetry/commit/0bc0a0e481156051cdf141b07486500fd1cd1aba) Thanks [@renovate[bot]](https://github.com/renovate%5Bbot%5D)! - Update OpenTelemetry dependencies (see the [Renovate PR](https://github.com/adobe/aio-lib-telemetry/pull/10) for the full list).

- [`e490daf`](https://github.com/adobe/aio-lib-telemetry/commit/e490daf053388e66e4d0650795dd55abde76d3c2) Thanks [@renovate[bot]](https://github.com/renovate%5Bbot%5D)! - Update OpenTelemetry Contrib dependencies (see the [Renovate PR](https://github.com/adobe/aio-lib-telemetry/pull/11) for the full list).

- [#16](https://github.com/adobe/aio-lib-telemetry/pull/16) [`efae3f9`](https://github.com/adobe/aio-lib-telemetry/commit/efae3f97cea34a6199241e1e7e64bc072707607b) Thanks [@iivvaannxx](https://github.com/iivvaannxx)! - Use `Error.captureStackTrace` native API if available on unhandled errors in instrumented functions.

- [#16](https://github.com/adobe/aio-lib-telemetry/pull/16) [`efae3f9`](https://github.com/adobe/aio-lib-telemetry/commit/efae3f97cea34a6199241e1e7e64bc072707607b) Thanks [@iivvaannxx](https://github.com/iivvaannxx)! - Add a `action.name` resource attribute in the default inferred telemetry attributes.

- [#16](https://github.com/adobe/aio-lib-telemetry/pull/16) [`efae3f9`](https://github.com/adobe/aio-lib-telemetry/commit/efae3f97cea34a6199241e1e7e64bc072707607b) Thanks [@iivvaannxx](https://github.com/iivvaannxx)! - Add a `self.name` attribute in instrumented functions with the name of the span.

### Patch Changes

- [#16](https://github.com/adobe/aio-lib-telemetry/pull/16) [`efae3f9`](https://github.com/adobe/aio-lib-telemetry/commit/efae3f97cea34a6199241e1e7e64bc072707607b) Thanks [@iivvaannxx](https://github.com/iivvaannxx)! - Fix action deadline calculation to correctly use `__OW_DEADLINE` as epoch milliseconds.

- [#16](https://github.com/adobe/aio-lib-telemetry/pull/16) [`efae3f9`](https://github.com/adobe/aio-lib-telemetry/commit/efae3f97cea34a6199241e1e7e64bc072707607b) Thanks [@iivvaannxx](https://github.com/iivvaannxx)! - Remove trailing slash in inferred `serviceName` when `packageName` is not known.

- [#16](https://github.com/adobe/aio-lib-telemetry/pull/16) [`efae3f9`](https://github.com/adobe/aio-lib-telemetry/commit/efae3f97cea34a6199241e1e7e64bc072707607b) Thanks [@iivvaannxx](https://github.com/iivvaannxx)! - Fixes logging on shutdown which was throwing if the SDK was not initialized, instead of just reporting a warning.

- [#16](https://github.com/adobe/aio-lib-telemetry/pull/16) [`efae3f9`](https://github.com/adobe/aio-lib-telemetry/commit/efae3f97cea34a6199241e1e7e64bc072707607b) Thanks [@iivvaannxx](https://github.com/iivvaannxx)! - Fix misrepresented `params` type, as it can also contain non-string values.

- [#16](https://github.com/adobe/aio-lib-telemetry/pull/16) [`efae3f9`](https://github.com/adobe/aio-lib-telemetry/commit/efae3f97cea34a6199241e1e7e64bc072707607b) Thanks [@iivvaannxx](https://github.com/iivvaannxx)! - Add default span name to the entrypoint if the function name is not available.

- [#16](https://github.com/adobe/aio-lib-telemetry/pull/16) [`efae3f9`](https://github.com/adobe/aio-lib-telemetry/commit/efae3f97cea34a6199241e1e7e64bc072707607b) Thanks [@iivvaannxx](https://github.com/iivvaannxx)! - Fix `Carrier` generic type in [`serializeContextIntoCarrier`](./docs/api-reference/functions/serializeContextIntoCarrier.md) and [`deserializeContextFromCarrier`](./docs/api-reference/functions/deserializeContextFromCarrier.md) to use `PropertyKey` as the `Record` key.

  Applies this change also in the `carrier` return type of [`getContextCarrier`](./docs/api-reference/type-aliases/TelemetryPropagationConfig.md#getcontextcarrier) and the `contextCarrier` parameter of [`InstrumentationContext`](./docs/api-reference/type-aliases/InstrumentationContext.md#contextcarrier).

- [#16](https://github.com/adobe/aio-lib-telemetry/pull/16) [`efae3f9`](https://github.com/adobe/aio-lib-telemetry/commit/efae3f97cea34a6199241e1e7e64bc072707607b) Thanks [@iivvaannxx](https://github.com/iivvaannxx)! - Fix error handling in entrypoint by letting runtime errors bubble up and only throwing if the error happens during instrumentation wrapping.

- [#21](https://github.com/adobe/aio-lib-telemetry/pull/21) [`dc9bd69`](https://github.com/adobe/aio-lib-telemetry/commit/dc9bd691f66036279af5cf3c0e3273be07ad3c7c) Thanks [@iivvaannxx](https://github.com/iivvaannxx)! - Fixes a bug where the runtime action `params` weren't being forwarded to the `getContextCarrier` helper of the `instrumentEntrypoint` configuration.

- [#16](https://github.com/adobe/aio-lib-telemetry/pull/16) [`efae3f9`](https://github.com/adobe/aio-lib-telemetry/commit/efae3f97cea34a6199241e1e7e64bc072707607b) Thanks [@iivvaannxx](https://github.com/iivvaannxx)! - Fix action name parsing for default inferred telemetry attributes.

- [#16](https://github.com/adobe/aio-lib-telemetry/pull/16) [`efae3f9`](https://github.com/adobe/aio-lib-telemetry/commit/efae3f97cea34a6199241e1e7e64bc072707607b) Thanks [@iivvaannxx](https://github.com/iivvaannxx)! - Don't keep a reference to the `NodeSDK` if it couldn't initialize.

- [#16](https://github.com/adobe/aio-lib-telemetry/pull/16) [`efae3f9`](https://github.com/adobe/aio-lib-telemetry/commit/efae3f97cea34a6199241e1e7e64bc072707607b) Thanks [@iivvaannxx](https://github.com/iivvaannxx)! - Fix `defineMetrics` generic definition to accept `PropertyKey` as the `Record` key.

- [#16](https://github.com/adobe/aio-lib-telemetry/pull/16) [`efae3f9`](https://github.com/adobe/aio-lib-telemetry/commit/efae3f97cea34a6199241e1e7e64bc072707607b) Thanks [@iivvaannxx](https://github.com/iivvaannxx)! - Improved error logging on uninitialized SDK and uninitialized telemetry API.

- [#16](https://github.com/adobe/aio-lib-telemetry/pull/16) [`efae3f9`](https://github.com/adobe/aio-lib-telemetry/commit/efae3f97cea34a6199241e1e7e64bc072707607b) Thanks [@iivvaannxx](https://github.com/iivvaannxx)! - [Automatic instrumentation for the Winston logger provider](https://www.npmjs.com/package/@opentelemetry/instrumentation-winston) has been removed from the `simple` preset. It's not needed because the OpenTelemetry transport added by that instrumentation is already added manually.

## 0.1.0

### Minor Changes

- [#3](https://github.com/adobe/aio-lib-telemetry/pull/3) [`5cecb35`](https://github.com/adobe/aio-lib-telemetry/commit/5cecb35aa14702d3058b58a2738c6d20db1b5e83) Thanks [@iivvaannxx](https://github.com/iivvaannxx)! - Initial release. This version includes the code that was previously (but temporarily) published as a workspace package in the [adobe/commerce-integration-starter-kit](https://github.com/adobe/commerce-integration-starter-kit/pull/42).
