@btravstack/observability 0.11.0 → 0.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -154,8 +154,10 @@ import { UnitSpanModule, otel } from "@btravstack/observability/otel";
154
154
  // Configuration is the OTEL_* environment conventions, read by the SDK itself.
155
155
  const AppImports = [observability(), otel()];
156
156
 
157
- // A span per kernel unit, correlated with the same ids the logger stamps:
158
- // runMain(App, { unit: UnitSpanModule })
157
+ // A span per unit, correlated with the same ids the logger stamps — bound on
158
+ // the starter's own `unit` option and forked by the runtime around each
159
+ // request, delivery or activity attempt, e.g.
160
+ // http({ unit: { anonymous: UnitSpanModule } })
159
161
  ```
160
162
 
161
163
  Inbound W3C `traceparent` feeds the unit's trace id in `@btravstack/http-server` and
package/dist/otel.cjs CHANGED
@@ -112,9 +112,9 @@ const otel = (options) => (0, _btravstack_di.Module)("Otel")({
112
112
  /** The span a unit rides, ended when the unit's fork closes. */
113
113
  var UnitSpan = class extends (0, _btravstack_di.Port)("UnitSpan") {};
114
114
  /**
115
- * A span per kernel unit, as a `StartOptions.unit` module: the kernel forks it
116
- * per unit and tears it down inside the unit's ambient record, so the span opens
117
- * when the unit does and `onStop` ends it on every path out.
115
+ * A span per unit, as a module a starter's own `unit` option binds: the runtime
116
+ * forks it around every unit it opens, so the span opens when the fork is built
117
+ * and `onStop` ends it on every path out.
118
118
  *
119
119
  * The correlation is the ambient record's own, carried as attributes so a span
120
120
  * joins the same query the logger's lines answer. The remote PARENT is
@@ -122,7 +122,8 @@ var UnitSpan = class extends (0, _btravstack_di.Port)("UnitSpan") {};
122
122
  * id alone, so this correlates by attribute rather than pretending to a W3C
123
123
  * parent-child edge it cannot prove.
124
124
  *
125
- * Compose it as `start`'s `unit`; the root must export `Tracer`.
125
+ * Bind it as a starter's `unit` module — `unit: { anonymous: UnitSpanModule }`,
126
+ * `unit: { message: … }`, `unit: { activity: … }`; the root must export `Tracer`.
126
127
  */
127
128
  const UnitSpanModule = (0, _btravstack_di.Module)("UnitSpan")({
128
129
  needs: [_btravstack_core.Tracer],
package/dist/otel.d.cts CHANGED
@@ -34,9 +34,9 @@ declare const UnitSpan_base: import("@btravstack/di").PortClass<"UnitSpan">;
34
34
  /** The span a unit rides, ended when the unit's fork closes. */
35
35
  declare class UnitSpan extends UnitSpan_base<Span> {}
36
36
  /**
37
- * A span per kernel unit, as a `StartOptions.unit` module: the kernel forks it
38
- * per unit and tears it down inside the unit's ambient record, so the span opens
39
- * when the unit does and `onStop` ends it on every path out.
37
+ * A span per unit, as a module a starter's own `unit` option binds: the runtime
38
+ * forks it around every unit it opens, so the span opens when the fork is built
39
+ * and `onStop` ends it on every path out.
40
40
  *
41
41
  * The correlation is the ambient record's own, carried as attributes so a span
42
42
  * joins the same query the logger's lines answer. The remote PARENT is
@@ -44,7 +44,8 @@ declare class UnitSpan extends UnitSpan_base<Span> {}
44
44
  * id alone, so this correlates by attribute rather than pretending to a W3C
45
45
  * parent-child edge it cannot prove.
46
46
  *
47
- * Compose it as `start`'s `unit`; the root must export `Tracer`.
47
+ * Bind it as a starter's `unit` module — `unit: { anonymous: UnitSpanModule }`,
48
+ * `unit: { message: … }`, `unit: { activity: … }`; the root must export `Tracer`.
48
49
  */
49
50
  declare const UnitSpanModule: Module<UnitSpan, never, Scope | Tracer>;
50
51
  //#endregion
package/dist/otel.d.mts CHANGED
@@ -34,9 +34,9 @@ declare const UnitSpan_base: import("@btravstack/di").PortClass<"UnitSpan">;
34
34
  /** The span a unit rides, ended when the unit's fork closes. */
35
35
  declare class UnitSpan extends UnitSpan_base<Span> {}
36
36
  /**
37
- * A span per kernel unit, as a `StartOptions.unit` module: the kernel forks it
38
- * per unit and tears it down inside the unit's ambient record, so the span opens
39
- * when the unit does and `onStop` ends it on every path out.
37
+ * A span per unit, as a module a starter's own `unit` option binds: the runtime
38
+ * forks it around every unit it opens, so the span opens when the fork is built
39
+ * and `onStop` ends it on every path out.
40
40
  *
41
41
  * The correlation is the ambient record's own, carried as attributes so a span
42
42
  * joins the same query the logger's lines answer. The remote PARENT is
@@ -44,7 +44,8 @@ declare class UnitSpan extends UnitSpan_base<Span> {}
44
44
  * id alone, so this correlates by attribute rather than pretending to a W3C
45
45
  * parent-child edge it cannot prove.
46
46
  *
47
- * Compose it as `start`'s `unit`; the root must export `Tracer`.
47
+ * Bind it as a starter's `unit` module — `unit: { anonymous: UnitSpanModule }`,
48
+ * `unit: { message: … }`, `unit: { activity: … }`; the root must export `Tracer`.
48
49
  */
49
50
  declare const UnitSpanModule: Module<UnitSpan, never, Scope | Tracer>;
50
51
  //#endregion
package/dist/otel.mjs CHANGED
@@ -111,9 +111,9 @@ const otel = (options) => Module("Otel")({
111
111
  /** The span a unit rides, ended when the unit's fork closes. */
112
112
  var UnitSpan = class extends Port("UnitSpan") {};
113
113
  /**
114
- * A span per kernel unit, as a `StartOptions.unit` module: the kernel forks it
115
- * per unit and tears it down inside the unit's ambient record, so the span opens
116
- * when the unit does and `onStop` ends it on every path out.
114
+ * A span per unit, as a module a starter's own `unit` option binds: the runtime
115
+ * forks it around every unit it opens, so the span opens when the fork is built
116
+ * and `onStop` ends it on every path out.
117
117
  *
118
118
  * The correlation is the ambient record's own, carried as attributes so a span
119
119
  * joins the same query the logger's lines answer. The remote PARENT is
@@ -121,7 +121,8 @@ var UnitSpan = class extends Port("UnitSpan") {};
121
121
  * id alone, so this correlates by attribute rather than pretending to a W3C
122
122
  * parent-child edge it cannot prove.
123
123
  *
124
- * Compose it as `start`'s `unit`; the root must export `Tracer`.
124
+ * Bind it as a starter's `unit` module — `unit: { anonymous: UnitSpanModule }`,
125
+ * `unit: { message: … }`, `unit: { activity: … }`; the root must export `Tracer`.
125
126
  */
126
127
  const UnitSpanModule = Module("UnitSpan")({
127
128
  needs: [Tracer],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@btravstack/observability",
3
- "version": "0.11.0",
3
+ "version": "0.13.0",
4
4
  "description": "Observability for @btravstack/core: a strict Logger port correlated with the kernel's units, a dependency-free JSON sink, and the lifecycle events as log lines",
5
5
  "keywords": [
6
6
  "dependency-injection",
@@ -65,7 +65,7 @@
65
65
  "./package.json": "./package.json"
66
66
  },
67
67
  "devDependencies": {
68
- "@btravstack/tsconfig": "0.2.0",
68
+ "@btravstack/tsconfig": "0.4.0",
69
69
  "@opentelemetry/api": "1.9.1",
70
70
  "@opentelemetry/sdk-node": "0.221.0",
71
71
  "@opentelemetry/sdk-trace": "2.10.0",
@@ -77,19 +77,19 @@
77
77
  "typescript": "7.0.2",
78
78
  "unthrown": "5.7.0",
79
79
  "vitest": "4.1.11",
80
- "@btravstack/config": "0.11.0",
81
- "@btravstack/core": "0.11.0",
82
- "@btravstack/di": "0.11.0",
83
- "@btravstack/testing": "0.11.0"
80
+ "@btravstack/config": "0.13.0",
81
+ "@btravstack/core": "0.13.0",
82
+ "@btravstack/di": "0.13.0",
83
+ "@btravstack/testing": "0.13.0"
84
84
  },
85
85
  "peerDependencies": {
86
86
  "@opentelemetry/api": "^1.9.0",
87
87
  "@opentelemetry/sdk-node": "^0.221.0",
88
88
  "pino": "^10",
89
89
  "unthrown": "^5.0.0",
90
- "@btravstack/config": "^0.11.0",
91
- "@btravstack/core": "^0.11.0",
92
- "@btravstack/di": "^0.11.0"
90
+ "@btravstack/config": "^0.13.0",
91
+ "@btravstack/core": "^0.13.0",
92
+ "@btravstack/di": "^0.13.0"
93
93
  },
94
94
  "peerDependenciesMeta": {
95
95
  "@opentelemetry/api": {