@zerotal/telemetry 1.3.0 → 1.5.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/CHANGELOG.md +36 -1
- package/package.json +3 -3
- package/src/Span.ts +7 -0
package/CHANGELOG.md
CHANGED
|
@@ -4,10 +4,45 @@ All notable changes to this package are documented here. The format is
|
|
|
4
4
|
based on [Keep a Changelog](https://keepachangelog.com/); this package
|
|
5
5
|
follows the Zerotal monorepo's unified versioning.
|
|
6
6
|
|
|
7
|
-
**Maturity: `
|
|
7
|
+
**Maturity: `stable`**
|
|
8
8
|
|
|
9
9
|
## [Unreleased]
|
|
10
10
|
|
|
11
|
+
## [1.5.0] — 2026-08-15
|
|
12
|
+
|
|
13
|
+
### Added
|
|
14
|
+
|
|
15
|
+
- **Tests for the exporters and the request middleware — the package's entire
|
|
16
|
+
output path.** Spans, context propagation and the event bridge were all covered,
|
|
17
|
+
which left the untested part the part that actually produces something. Both of
|
|
18
|
+
its failure modes are quiet:
|
|
19
|
+
|
|
20
|
+
- **A mistyped attribute.** OTLP types each value (`stringValue`, `intValue`,
|
|
21
|
+
`doubleValue`, `boolValue`), and a backend indexes on that type — an integer
|
|
22
|
+
sent as a string still shows in the trace but stops being aggregatable. Now
|
|
23
|
+
pinned per type, along with millisecond→nanosecond conversion (sending
|
|
24
|
+
milliseconds puts every span in 1970 with no error raised) and the empty
|
|
25
|
+
`parentSpanId` a root span needs, since a null there makes a collector drop
|
|
26
|
+
the batch.
|
|
27
|
+
- **An exporter that throws.** A collector being down must never surface as a
|
|
28
|
+
500 on a user's request; that the `fetch` failure is swallowed is now a test
|
|
29
|
+
rather than a comment.
|
|
30
|
+
|
|
31
|
+
`TelemetryMiddleware` gained coverage for the root span every child span
|
|
32
|
+
attaches to: the `http.*` attributes, 5xx as error while 4xx stays ok (marking
|
|
33
|
+
404s as errors makes an error-rate dashboard useless), the span ending even when
|
|
34
|
+
no response was produced, and staying inert when no tracer is configured.
|
|
35
|
+
35 tests → 56.
|
|
36
|
+
|
|
37
|
+
### Changed
|
|
38
|
+
|
|
39
|
+
- **`NoopSpan` and `_randomHex` are marked `@internal`** — a null-object span and a
|
|
40
|
+
hex generator for trace ids, neither of them API. The promise is 12 exports, not 14.
|
|
41
|
+
|
|
42
|
+
- **Maturity is now `stable`** — the public API follows SemVer strictly for the rest
|
|
43
|
+
of the 1.x line. Every promised export is documented, the output path is covered,
|
|
44
|
+
and the only dependency is `@zerotal/core`.
|
|
45
|
+
|
|
11
46
|
## [1.0.3] — 2026-08-07
|
|
12
47
|
|
|
13
48
|
### Changed
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zerotal/telemetry",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.5.0",
|
|
4
4
|
"license": "MIT",
|
|
5
|
-
"maturity": "
|
|
5
|
+
"maturity": "stable",
|
|
6
6
|
"private": false,
|
|
7
7
|
"type": "module",
|
|
8
8
|
"main": "./src/index.ts",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"typecheck": "tsc --noEmit"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@zerotal/core": "1.
|
|
32
|
+
"@zerotal/core": "1.5.0"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"typescript": "^5.8.0"
|
package/src/Span.ts
CHANGED
|
@@ -102,6 +102,8 @@ export class Span {
|
|
|
102
102
|
/**
|
|
103
103
|
* A span whose methods are all no-ops.
|
|
104
104
|
* Used when telemetry is disabled so call sites never need null-checks.
|
|
105
|
+
*
|
|
106
|
+
* @internal
|
|
105
107
|
*/
|
|
106
108
|
export class NoopSpan extends Span {
|
|
107
109
|
constructor() {
|
|
@@ -127,6 +129,11 @@ export class NoopSpan extends Span {
|
|
|
127
129
|
|
|
128
130
|
// ── Helpers ───────────────────────────────────────────────────────────────────
|
|
129
131
|
|
|
132
|
+
/**
|
|
133
|
+
* Random hex for trace and span ids.
|
|
134
|
+
*
|
|
135
|
+
* @internal
|
|
136
|
+
*/
|
|
130
137
|
export function _randomHex(bytes: number): string {
|
|
131
138
|
return Array.from(crypto.getRandomValues(new Uint8Array(bytes)))
|
|
132
139
|
.map((b) => b.toString(16).padStart(2, "0"))
|