@spinajs/log-otlp 2.0.491 → 2.0.494

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
@@ -1,32 +1,32 @@
1
- # `@spinajs/log-otlp`
2
-
3
- OTLP/HTTP log export target for `@spinajs/log`. Exports SpinaJS logs to any
4
- OTLP-compatible backend ( the OpenTelemetry Collector, Grafana / Tempo / Loki
5
- via OTel, Datadog, ... ) over OTLP/HTTP-JSON, POSTing to `${endpoint}/v1/logs`.
6
-
7
- Entries are mapped to the OTLP Logs model ( `severityNumber` from the OTel
8
- mapping, `body`, resource + record attributes, `traceId` / `spanId` from the
9
- request trace context, structured errors to `exception.*` semantic attributes ),
10
- buffered with a `BatchQueue`, and retried with the `@spinajs/util` resilience
11
- pipeline ( exponential backoff + jitter, retryable-only, honoring `Retry-After` ).
12
-
13
- ## Usage
14
-
15
- ```js
16
- {
17
- logger: {
18
- targets: [
19
- {
20
- name: "Otlp",
21
- type: "OtlpLogTarget",
22
- options: {
23
- endpoint: "http://localhost:4318",
24
- headers: { Authorization: "Bearer <token>" },
25
- resource: { "service.name": "my-service" },
26
- },
27
- },
28
- ],
29
- rules: [{ name: "*", level: "trace", target: "Otlp" }],
30
- },
31
- }
32
- ```
1
+ # `@spinajs/log-otlp`
2
+
3
+ OTLP/HTTP log export target for `@spinajs/log`. Exports SpinaJS logs to any
4
+ OTLP-compatible backend ( the OpenTelemetry Collector, Grafana / Tempo / Loki
5
+ via OTel, Datadog, ... ) over OTLP/HTTP-JSON, POSTing to `${endpoint}/v1/logs`.
6
+
7
+ Entries are mapped to the OTLP Logs model ( `severityNumber` from the OTel
8
+ mapping, `body`, resource + record attributes, `traceId` / `spanId` from the
9
+ request trace context, structured errors to `exception.*` semantic attributes ),
10
+ buffered with a `BatchQueue`, and retried with the `@spinajs/util` resilience
11
+ pipeline ( exponential backoff + jitter, retryable-only, honoring `Retry-After` ).
12
+
13
+ ## Usage
14
+
15
+ ```js
16
+ {
17
+ logger: {
18
+ targets: [
19
+ {
20
+ name: "Otlp",
21
+ type: "OtlpLogTarget",
22
+ options: {
23
+ endpoint: "http://localhost:4318",
24
+ headers: { Authorization: "Bearer <token>" },
25
+ resource: { "service.name": "my-service" },
26
+ },
27
+ },
28
+ ],
29
+ rules: [{ name: "*", level: "trace", target: "Otlp" }],
30
+ },
31
+ }
32
+ ```