@bsb/observable-opentelemetry 9.0.0 → 9.0.1

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.
Files changed (2) hide show
  1. package/README.md +53 -17
  2. package/package.json +7 -4
package/README.md CHANGED
@@ -2,22 +2,24 @@
2
2
 
3
3
  OpenTelemetry observable plugin for BSB with full OTLP export support for traces, metrics, and logs.
4
4
 
5
+ ## Key Features
6
+
7
+ - Full OpenTelemetry integration for traces, metrics, and logs
8
+ - OTLP export over HTTP and gRPC protocols
9
+ - Customizable resource attributes for service metadata
10
+ - Configurable sampling to control trace collection rates
11
+ - Efficient batch processing for data export
12
+
5
13
  ## Installation
6
14
 
7
15
  ```bash
8
16
  npm install @bsb/observable-opentelemetry
9
17
  ```
10
18
 
11
- ## Features
12
-
13
- - **Full OpenTelemetry integration** - Traces, metrics, and logs
14
- - **OTLP export** - HTTP and gRPC protocol support
15
- - **Resource attributes** - Customizable service metadata
16
- - **Configurable sampling** - Control trace collection rates
17
- - **Batch processing** - Efficient data export with batching
18
-
19
19
  ## Configuration
20
20
 
21
+ Add the plugin to your BSB configuration file:
22
+
21
23
  ```yaml
22
24
  plugins:
23
25
  observables:
@@ -43,15 +45,49 @@ plugins:
43
45
 
44
46
  ### Configuration Options
45
47
 
46
- - **serviceName**: Name of your service
47
- - **serviceVersion**: Version of your service
48
- - **endpoint**: OTLP collector endpoint URL
49
- - **export.protocol**: "http" or "grpc"
50
- - **export.interval**: Export interval in milliseconds
51
- - **export.maxBatchSize**: Maximum batch size for exports
52
- - **enabled**: Toggle traces, metrics, and logs individually
53
- - **resourceAttributes**: Custom resource attributes
54
- - **samplingRate**: Trace sampling rate (0.0 to 1.0)
48
+ | Option | Description | Default |
49
+ |--------|-------------|---------|
50
+ | `serviceName` | Name of your service | - |
51
+ | `serviceVersion` | Version of your service | - |
52
+ | `endpoint` | OTLP collector endpoint URL | `http://localhost:4318` |
53
+ | `export.protocol` | Export protocol: `http` or `grpc` | `http` |
54
+ | `export.interval` | Export interval in milliseconds | `5000` |
55
+ | `export.maxBatchSize` | Maximum batch size for exports | `512` |
56
+ | `enabled` | Toggle traces, metrics, and logs individually | All enabled |
57
+ | `resourceAttributes` | Custom resource attributes | `{}` |
58
+ | `samplingRate` | Trace sampling rate (0.0 to 1.0) | `1.0` |
59
+
60
+ ## Usage
61
+
62
+ Once configured, telemetry is automatically exported:
63
+
64
+ ```typescript
65
+ this.log.info("Service initialized");
66
+ await this.events.emitEvent("user.created", { userId: "123" });
67
+ ```
68
+
69
+ ## Collector Setup
70
+
71
+ Example OpenTelemetry Collector service:
72
+
73
+ ```yaml
74
+ version: "3"
75
+ services:
76
+ otel-collector:
77
+ image: otel/opentelemetry-collector:latest
78
+ ports:
79
+ - "4318:4318"
80
+ - "4317:4317"
81
+ ```
82
+
83
+ ## Documentation
84
+
85
+ Detailed documentation (used by the BSB Registry): `https://github.com/BetterCorp/better-service-base/blob/master/plugins/nodejs/observable-opentelemetry/docs/plugin.md`
86
+
87
+ ## Links
88
+
89
+ - GitHub: `https://github.com/BetterCorp/better-service-base/tree/master/plugins/nodejs/observable-opentelemetry`
90
+ - BSB Registry (package): `https://io.bsbcode.dev/packages/nodejs/@bsb/observable-opentelemetry`
55
91
 
56
92
  ## License
57
93
 
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@bsb/observable-opentelemetry",
3
- "version": "9.0.0",
3
+ "version": "9.0.1",
4
4
  "license": "(AGPL-3.0-only OR Commercial)",
5
5
  "author": {
6
6
  "name": "BetterCorp (PTY) Ltd",
7
- "email": "nick@bettercorp.dev",
7
+ "email": "ninja@bettercorp.dev",
8
8
  "url": "https://bettercorp.dev/"
9
9
  },
10
10
  "description": "OpenTelemetry observable plugin for BSB with OTLP export for traces, metrics, and logs",
@@ -64,6 +64,9 @@
64
64
  "node": ">=23.0.0",
65
65
  "npm": ">=11.0.0"
66
66
  },
67
- "homepage": "https://io.bsbcode.dev/plugins/bsb/observable-opentelemetry"
67
+ "homepage": "https://io.bsbcode.dev/packages/nodejs/@bsb/observable-opentelemetry"
68
68
  }
69
-
69
+
70
+
71
+
72
+