@carecard/telemetry 3.16.0 → 3.17.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 +10 -1
- package/package.json +1 -1
- package/src/configuration.js +2 -4
package/README.md
CHANGED
|
@@ -2,15 +2,24 @@
|
|
|
2
2
|
|
|
3
3
|
Privacy-safe OpenTelemetry tracing for CareCard Node.js server processes.
|
|
4
4
|
|
|
5
|
+
Mandatory repository policy: load
|
|
6
|
+
`$pkg-telemetry-coding-standards-and-best-practices` before changing, reviewing,
|
|
7
|
+
testing, documenting, or releasing this package.
|
|
8
|
+
|
|
5
9
|
The package owns one explicit tracing bootstrap for CareCard services. It uses
|
|
6
10
|
W3C Trace Context, exports OTLP/HTTP spans to Grafana Alloy, and instruments
|
|
7
11
|
HTTP, PostgreSQL, and Kafka without sending application payloads to the tracing
|
|
8
12
|
backend.
|
|
9
13
|
|
|
14
|
+
Non-negotiable TypeScript type rule: Never use the TypeScript type `any`; always
|
|
15
|
+
use specific domain types, generics, existing project types, or `unknown` with
|
|
16
|
+
explicit narrowing in all TypeScript-family files (`.ts`, `.tsx`, `.mts`,
|
|
17
|
+
`.cts`, and `.d.ts`).
|
|
18
|
+
|
|
10
19
|
## Install
|
|
11
20
|
|
|
12
21
|
```sh
|
|
13
|
-
npm install @carecard/telemetry@3.
|
|
22
|
+
npm install @carecard/telemetry@3.17.0 --save-exact
|
|
14
23
|
```
|
|
15
24
|
|
|
16
25
|
## Bootstrap
|
package/package.json
CHANGED
package/src/configuration.js
CHANGED
|
@@ -15,10 +15,8 @@ function parseBoolean(value, defaultValue) {
|
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
function parseEndpoint(value = DEFAULT_ENDPOINT) {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
endpoint = new URL(value);
|
|
21
|
-
} catch {
|
|
18
|
+
const endpoint = URL.parse(value);
|
|
19
|
+
if (endpoint === null) {
|
|
22
20
|
throw new Error('OTEL_EXPORTER_OTLP_TRACES_ENDPOINT must be a valid http or https URL');
|
|
23
21
|
}
|
|
24
22
|
if (!['http:', 'https:'].includes(endpoint.protocol)) {
|