@orgloop/logger-otel 0.1.0 → 0.1.3
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 +49 -0
- package/package.json +2 -2
package/README.md
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# @orgloop/logger-otel
|
|
2
|
+
|
|
3
|
+
OrgLoop OpenTelemetry logger -- exports log entries via OTLP for production observability. Integrates with any OpenTelemetry-compatible backend (Grafana, Datadog, Honeycomb, etc.).
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @orgloop/logger-otel
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Configuration
|
|
12
|
+
|
|
13
|
+
```yaml
|
|
14
|
+
loggers:
|
|
15
|
+
- name: otel
|
|
16
|
+
type: "@orgloop/logger-otel"
|
|
17
|
+
config:
|
|
18
|
+
endpoint: "http://localhost:4318/v1/logs" # OTLP HTTP endpoint
|
|
19
|
+
protocol: "http/json" # http/json | http/protobuf | grpc
|
|
20
|
+
service_name: orgloop # OTel service name
|
|
21
|
+
service_version: "0.1.0" # OTel service version
|
|
22
|
+
headers: # Custom headers (e.g., auth)
|
|
23
|
+
Authorization: "Bearer ${OTEL_TOKEN}"
|
|
24
|
+
resource_attributes: # Additional OTel resource attributes
|
|
25
|
+
deployment.environment: production
|
|
26
|
+
batch:
|
|
27
|
+
max_queue_size: 2048 # Max queue size before dropping
|
|
28
|
+
scheduled_delay_ms: 5000 # Delay between batch exports
|
|
29
|
+
max_export_batch_size: 512 # Max records per export batch
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
All fields are optional and shown with their defaults.
|
|
33
|
+
|
|
34
|
+
## Behavior
|
|
35
|
+
|
|
36
|
+
Each OrgLoop `LogEntry` is exported as an OpenTelemetry `LogRecord` with:
|
|
37
|
+
|
|
38
|
+
- **Severity mapping:** Log phases are mapped to OTel severity levels -- `deliver.failure` and `system.error` become ERROR, `transform.error` and `deliver.retry` become WARN, most others are INFO, and `route.no_match` is DEBUG.
|
|
39
|
+
- **Attributes:** All LogEntry fields are exported as `orgloop.*` namespaced attributes (`orgloop.phase`, `orgloop.source`, `orgloop.target`, `orgloop.duration_ms`, etc.).
|
|
40
|
+
- **Batching:** Records are batched using the OpenTelemetry `BatchLogRecordProcessor` for efficient export.
|
|
41
|
+
- **Body:** The full LogEntry JSON is included as the log record body for backends that support structured log bodies.
|
|
42
|
+
|
|
43
|
+
## Documentation
|
|
44
|
+
|
|
45
|
+
Full documentation at [orgloop.ai](https://orgloop.ai)
|
|
46
|
+
|
|
47
|
+
## License
|
|
48
|
+
|
|
49
|
+
MIT
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@orgloop/logger-otel",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"description": "OrgLoop OpenTelemetry logger — OTLP export for production observability",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"@opentelemetry/exporter-logs-otlp-http": "^0.57.0",
|
|
13
13
|
"@opentelemetry/resources": "^1.30.0",
|
|
14
14
|
"@opentelemetry/semantic-conventions": "^1.28.0",
|
|
15
|
-
"@orgloop/sdk": "0.1.
|
|
15
|
+
"@orgloop/sdk": "0.1.3"
|
|
16
16
|
},
|
|
17
17
|
"orgloop": {
|
|
18
18
|
"type": "logger",
|