Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions .changeset/fix-concurrent-getorset-spans.md

This file was deleted.

11 changes: 0 additions & 11 deletions .changeset/otel-active-context.md

This file was deleted.

7 changes: 0 additions & 7 deletions .changeset/otel-sdk-3.md

This file was deleted.

19 changes: 19 additions & 0 deletions packages/otel/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,24 @@
# @bentocache/otel

## 0.2.0

### Minor Changes

- ffbbfbe: Upgrade to OpenTelemetry JS SDK 3 (`@opentelemetry/core` 3.x, `@opentelemetry/instrumentation` 0.301.x). `@opentelemetry/api` is now a peer dependency (`^1.10.0`), and Node.js 22.15.0 or newer is required.

**Breaking change:** apps that stay on OpenTelemetry SDK 2 (`@opentelemetry/api` < 1.10) must keep using `@bentocache/otel@0.1.x`.

### Patch Changes

- 057a839: Fix concurrent `getOrSet` calls with the same key producing deeply nested spans instead of siblings
- ffbbfbe: Fix wrong span parenting. Each cache operation span is now the active context while the operation runs, so:

- cache operations from concurrent requests on the same key no longer end up in another request's trace
- spans created inside a `getOrSet` factory (database queries, nested cache calls) are children of the `cache.factory` span
- the instrumentation scope reports the package version instead of `0.1.0`

This relies on `context.attach()` from `@opentelemetry/api` 1.10, which `AsyncLocalStorageContextManager` (the Node.js SDK default) supports. `manuallyRegister()` now logs a warning when it cannot patch the `BentoCache` constructor, because `suppressInternalOperations` has no effect in that case.

## 0.1.2

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/otel/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@bentocache/otel",
"version": "0.1.2",
"version": "0.2.0",
"description": "OpenTelemetry instrumentation for Bentocache",
"keywords": [
"bentocache",
Expand Down
Loading