@libo11y/server 0.7.0 → 0.8.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
@@ -349,6 +349,13 @@ context in three places:
349
349
 
350
350
  Node 24 keeps the context in both of the last two cases.
351
351
 
352
+ ## The portable entry
353
+
354
+ `@libo11y/server/edge` exports `instrumentServe`, `instrumentFetch`,
355
+ `setRoute` and `OtlpProtobufMetricsSerializer` from modules that import no
356
+ Node builtin and read no `process` global, for runtimes with `fetch` but
357
+ without Node's modules. [`@libo11y/workers`](https://github.com/libo11y/libo11y/tree/main/ts/packages/workers) builds on it.
358
+
352
359
  ## Known limitations
353
360
 
354
361
  - Upstream's `RuntimeNodeInstrumentation` installs a require-in-the-middle
package/dist/edge.d.ts ADDED
@@ -0,0 +1,10 @@
1
+ /**
2
+ * @libo11y/server/edge: the parts of the server package that import no Node builtin and read no
3
+ * process global, for edge runtimes that have fetch but not Node's modules, such as Cloudflare
4
+ * Workers (@libo11y/workers). It holds instrumentServe, instrumentFetch, setRoute and the
5
+ * OTLP/protobuf metrics serializer that writes exemplars, with the same API and compatibility
6
+ * promise as the package root. edge.test.ts enforces the boundary.
7
+ */
8
+ export { type FetchOptions, instrumentFetch } from "./fetch.ts";
9
+ export { OtlpProtobufMetricsSerializer } from "./otlp-proto-metrics.ts";
10
+ export { instrumentServe, type ServeOptions, setRoute } from "./serve.ts";
package/dist/edge.js ADDED
@@ -0,0 +1,10 @@
1
+ /**
2
+ * @libo11y/server/edge: the parts of the server package that import no Node builtin and read no
3
+ * process global, for edge runtimes that have fetch but not Node's modules, such as Cloudflare
4
+ * Workers (@libo11y/workers). It holds instrumentServe, instrumentFetch, setRoute and the
5
+ * OTLP/protobuf metrics serializer that writes exemplars, with the same API and compatibility
6
+ * promise as the package root. edge.test.ts enforces the boundary.
7
+ */
8
+ export { instrumentFetch } from "./fetch.js";
9
+ export { OtlpProtobufMetricsSerializer } from "./otlp-proto-metrics.js";
10
+ export { instrumentServe, setRoute } from "./serve.js";
package/dist/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
1
  /** The @libo11y/server package version. scripts/release.ts keeps it equal to package.json. */
2
- export declare const VERSION = "0.7.0";
2
+ export declare const VERSION = "0.8.0";
package/dist/version.js CHANGED
@@ -1,2 +1,2 @@
1
1
  /** The @libo11y/server package version. scripts/release.ts keeps it equal to package.json. */
2
- export const VERSION = "0.7.0";
2
+ export const VERSION = "0.8.0";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@libo11y/server",
3
- "version": "0.7.0",
3
+ "version": "0.8.0",
4
4
  "description": "The libo11y server platform for TypeScript on Bun and Node: AsyncLocalStorage context, resource detection, OTLP exporters from OTEL_* with exemplars, setup, registry loading, signal handling, runtime metrics, and instrumentServe and instrumentFetch for HTTP.",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
@@ -9,6 +9,10 @@
9
9
  ".": {
10
10
  "types": "./dist/index.d.ts",
11
11
  "default": "./dist/index.js"
12
+ },
13
+ "./edge": {
14
+ "types": "./dist/edge.d.ts",
15
+ "default": "./dist/edge.js"
12
16
  }
13
17
  },
14
18
  "repository": {
@@ -17,8 +21,8 @@
17
21
  "directory": "ts/packages/server"
18
22
  },
19
23
  "dependencies": {
20
- "@libo11y/core": "0.7.0",
21
- "@libo11y/spec": "0.7.0",
24
+ "@libo11y/core": "0.8.0",
25
+ "@libo11y/spec": "0.8.0",
22
26
  "@opentelemetry/context-async-hooks": "3.1.1",
23
27
  "@opentelemetry/core": "3.1.1",
24
28
  "@opentelemetry/exporter-metrics-otlp-http": "0.301.1",
@@ -35,7 +39,7 @@
35
39
  "@opentelemetry/api": ">=1.10.0 <1.11.0"
36
40
  },
37
41
  "devDependencies": {
38
- "@libo11y/test": "0.7.0",
42
+ "@libo11y/test": "0.8.0",
39
43
  "@opentelemetry/api": "1.10.0"
40
44
  },
41
45
  "files": [