@bsb/observable-opentelemetry 9.0.1 → 9.1.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.
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1 -17
- package/lib/plugins/observable-opentelemetry/index.d.ts +53 -62
- package/lib/plugins/observable-opentelemetry/index.js +45 -82
- package/lib/schemas/observable-opentelemetry.json +0 -97
- package/lib/schemas/observable-opentelemetry.plugin.json +1 -98
- package/package.json +5 -8
package/lib/index.d.ts
CHANGED
|
@@ -24,4 +24,4 @@
|
|
|
24
24
|
* You should have received a copy of the GNU Affero General Public License
|
|
25
25
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
26
26
|
*/
|
|
27
|
-
export * from "./plugins/observable-opentelemetry";
|
|
27
|
+
export * from "./plugins/observable-opentelemetry/index.js";
|
package/lib/index.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/**
|
|
3
2
|
* BSB (Better-Service-Base) is an event-bus based microservice framework.
|
|
4
3
|
* Copyright (C) 2016 - 2025 BetterCorp (PTY) Ltd
|
|
@@ -25,19 +24,4 @@
|
|
|
25
24
|
* You should have received a copy of the GNU Affero General Public License
|
|
26
25
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
27
26
|
*/
|
|
28
|
-
|
|
29
|
-
if (k2 === undefined) k2 = k;
|
|
30
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
31
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
32
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
33
|
-
}
|
|
34
|
-
Object.defineProperty(o, k2, desc);
|
|
35
|
-
}) : (function(o, m, k, k2) {
|
|
36
|
-
if (k2 === undefined) k2 = k;
|
|
37
|
-
o[k2] = m[k];
|
|
38
|
-
}));
|
|
39
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
40
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
41
|
-
};
|
|
42
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
43
|
-
__exportStar(require("./plugins/observable-opentelemetry"), exports);
|
|
27
|
+
export * from "./plugins/observable-opentelemetry/index.js";
|
|
@@ -26,75 +26,66 @@
|
|
|
26
26
|
*/
|
|
27
27
|
import { BSBObservable, BSBObservableConstructor, BSBError } from "@bsb/base";
|
|
28
28
|
import { DTrace, LogMeta } from "@bsb/base";
|
|
29
|
-
import
|
|
29
|
+
import * as av from "@anyvali/js";
|
|
30
30
|
/**
|
|
31
31
|
* Configuration schema for OpenTelemetry plugin
|
|
32
32
|
*/
|
|
33
|
-
export declare const OpenTelemetryConfigSchema:
|
|
34
|
-
serviceName:
|
|
35
|
-
serviceVersion:
|
|
36
|
-
endpoint:
|
|
37
|
-
export:
|
|
38
|
-
protocol:
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
metrics: z.ZodDefault<z.ZodBoolean>;
|
|
69
|
-
logs: z.ZodDefault<z.ZodBoolean>;
|
|
70
|
-
}, z.core.$strip>;
|
|
71
|
-
resourceAttributes: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
72
|
-
samplingRate: z.ZodDefault<z.ZodNumber>;
|
|
73
|
-
}, z.core.$strip>>;
|
|
33
|
+
export declare const OpenTelemetryConfigSchema: av.ObjectSchema<{
|
|
34
|
+
serviceName: av.OptionalSchema<av.StringSchema>;
|
|
35
|
+
serviceVersion: av.OptionalSchema<av.StringSchema>;
|
|
36
|
+
endpoint: av.OptionalSchema<av.StringSchema>;
|
|
37
|
+
export: av.ObjectSchema<{
|
|
38
|
+
protocol: av.OptionalSchema<av.EnumSchema<string[]>>;
|
|
39
|
+
interval: av.OptionalSchema<av.Int32Schema>;
|
|
40
|
+
maxBatchSize: av.OptionalSchema<av.Int32Schema>;
|
|
41
|
+
}>;
|
|
42
|
+
enabled: av.ObjectSchema<{
|
|
43
|
+
traces: av.OptionalSchema<av.BoolSchema>;
|
|
44
|
+
metrics: av.OptionalSchema<av.BoolSchema>;
|
|
45
|
+
logs: av.OptionalSchema<av.BoolSchema>;
|
|
46
|
+
}>;
|
|
47
|
+
resourceAttributes: av.OptionalSchema<av.RecordSchema<av.StringSchema>>;
|
|
48
|
+
samplingRate: av.OptionalSchema<av.NumberSchema>;
|
|
49
|
+
}>;
|
|
50
|
+
export type OpenTelemetryConfig = av.Infer<typeof OpenTelemetryConfigSchema>;
|
|
51
|
+
export declare const Config: import("@bsb/base").BSBPluginConfigClass<av.ObjectSchema<{
|
|
52
|
+
serviceName: av.OptionalSchema<av.StringSchema>;
|
|
53
|
+
serviceVersion: av.OptionalSchema<av.StringSchema>;
|
|
54
|
+
endpoint: av.OptionalSchema<av.StringSchema>;
|
|
55
|
+
export: av.ObjectSchema<{
|
|
56
|
+
protocol: av.OptionalSchema<av.EnumSchema<string[]>>;
|
|
57
|
+
interval: av.OptionalSchema<av.Int32Schema>;
|
|
58
|
+
maxBatchSize: av.OptionalSchema<av.Int32Schema>;
|
|
59
|
+
}>;
|
|
60
|
+
enabled: av.ObjectSchema<{
|
|
61
|
+
traces: av.OptionalSchema<av.BoolSchema>;
|
|
62
|
+
metrics: av.OptionalSchema<av.BoolSchema>;
|
|
63
|
+
logs: av.OptionalSchema<av.BoolSchema>;
|
|
64
|
+
}>;
|
|
65
|
+
resourceAttributes: av.OptionalSchema<av.RecordSchema<av.StringSchema>>;
|
|
66
|
+
samplingRate: av.OptionalSchema<av.NumberSchema>;
|
|
67
|
+
}>>;
|
|
74
68
|
/**
|
|
75
69
|
* OpenTelemetry observable plugin with OTLP export
|
|
76
70
|
*/
|
|
77
71
|
export declare class Plugin extends BSBObservable<InstanceType<typeof Config>> {
|
|
78
|
-
static Config: import("@bsb/base").BSBPluginConfigClass<
|
|
79
|
-
serviceName:
|
|
80
|
-
serviceVersion:
|
|
81
|
-
endpoint:
|
|
82
|
-
export:
|
|
83
|
-
protocol:
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
resourceAttributes: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
96
|
-
samplingRate: z.ZodDefault<z.ZodNumber>;
|
|
97
|
-
}, z.core.$strip>>;
|
|
72
|
+
static Config: import("@bsb/base").BSBPluginConfigClass<av.ObjectSchema<{
|
|
73
|
+
serviceName: av.OptionalSchema<av.StringSchema>;
|
|
74
|
+
serviceVersion: av.OptionalSchema<av.StringSchema>;
|
|
75
|
+
endpoint: av.OptionalSchema<av.StringSchema>;
|
|
76
|
+
export: av.ObjectSchema<{
|
|
77
|
+
protocol: av.OptionalSchema<av.EnumSchema<string[]>>;
|
|
78
|
+
interval: av.OptionalSchema<av.Int32Schema>;
|
|
79
|
+
maxBatchSize: av.OptionalSchema<av.Int32Schema>;
|
|
80
|
+
}>;
|
|
81
|
+
enabled: av.ObjectSchema<{
|
|
82
|
+
traces: av.OptionalSchema<av.BoolSchema>;
|
|
83
|
+
metrics: av.OptionalSchema<av.BoolSchema>;
|
|
84
|
+
logs: av.OptionalSchema<av.BoolSchema>;
|
|
85
|
+
}>;
|
|
86
|
+
resourceAttributes: av.OptionalSchema<av.RecordSchema<av.StringSchema>>;
|
|
87
|
+
samplingRate: av.OptionalSchema<av.NumberSchema>;
|
|
88
|
+
}>>;
|
|
98
89
|
private logFormatter;
|
|
99
90
|
private sdk;
|
|
100
91
|
private tracer;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/**
|
|
3
2
|
* BSB (Better-Service-Base) is an event-bus based microservice framework.
|
|
4
3
|
* Copyright (C) 2016 - 2025 BetterCorp (PTY) Ltd
|
|
@@ -25,80 +24,45 @@
|
|
|
25
24
|
* You should have received a copy of the GNU Affero General Public License
|
|
26
25
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
27
26
|
*/
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
}
|
|
39
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
40
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
41
|
-
}) : function(o, v) {
|
|
42
|
-
o["default"] = v;
|
|
43
|
-
});
|
|
44
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
45
|
-
var ownKeys = function(o) {
|
|
46
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
47
|
-
var ar = [];
|
|
48
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
49
|
-
return ar;
|
|
50
|
-
};
|
|
51
|
-
return ownKeys(o);
|
|
52
|
-
};
|
|
53
|
-
return function (mod) {
|
|
54
|
-
if (mod && mod.__esModule) return mod;
|
|
55
|
-
var result = {};
|
|
56
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
57
|
-
__setModuleDefault(result, mod);
|
|
58
|
-
return result;
|
|
59
|
-
};
|
|
60
|
-
})();
|
|
61
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
62
|
-
exports.Plugin = exports.Config = exports.OpenTelemetryConfigSchema = void 0;
|
|
63
|
-
const base_1 = require("@bsb/base");
|
|
64
|
-
const zod_1 = require("zod");
|
|
65
|
-
const api = __importStar(require("@opentelemetry/api"));
|
|
66
|
-
const resources_1 = require("@opentelemetry/resources");
|
|
67
|
-
const semantic_conventions_1 = require("@opentelemetry/semantic-conventions");
|
|
68
|
-
const sdk_node_1 = require("@opentelemetry/sdk-node");
|
|
69
|
-
const exporter_trace_otlp_http_1 = require("@opentelemetry/exporter-trace-otlp-http");
|
|
70
|
-
const exporter_metrics_otlp_http_1 = require("@opentelemetry/exporter-metrics-otlp-http");
|
|
71
|
-
const exporter_logs_otlp_http_1 = require("@opentelemetry/exporter-logs-otlp-http");
|
|
72
|
-
const sdk_metrics_1 = require("@opentelemetry/sdk-metrics");
|
|
73
|
-
const sdk_logs_1 = require("@opentelemetry/sdk-logs");
|
|
27
|
+
import { BSBObservable, createConfigSchema, LogFormatter, BSBError } from "@bsb/base";
|
|
28
|
+
import * as av from "@anyvali/js";
|
|
29
|
+
import * as api from "@opentelemetry/api";
|
|
30
|
+
import { Resource } from "@opentelemetry/resources";
|
|
31
|
+
import { ATTR_SERVICE_NAME, ATTR_SERVICE_VERSION } from "@opentelemetry/semantic-conventions";
|
|
32
|
+
import { NodeSDK } from "@opentelemetry/sdk-node";
|
|
33
|
+
import { OTLPTraceExporter } from "@opentelemetry/exporter-trace-otlp-http";
|
|
34
|
+
import { OTLPMetricExporter } from "@opentelemetry/exporter-metrics-otlp-http";
|
|
35
|
+
import { OTLPLogExporter } from "@opentelemetry/exporter-logs-otlp-http";
|
|
36
|
+
import { PeriodicExportingMetricReader, MeterProvider } from "@opentelemetry/sdk-metrics";
|
|
37
|
+
import { BatchLogRecordProcessor, LoggerProvider } from "@opentelemetry/sdk-logs";
|
|
74
38
|
/**
|
|
75
39
|
* Configuration schema for OpenTelemetry plugin
|
|
76
40
|
*/
|
|
77
|
-
|
|
78
|
-
serviceName:
|
|
79
|
-
serviceVersion:
|
|
80
|
-
endpoint:
|
|
81
|
-
export:
|
|
82
|
-
protocol:
|
|
83
|
-
interval:
|
|
84
|
-
maxBatchSize:
|
|
85
|
-
}),
|
|
86
|
-
enabled:
|
|
87
|
-
traces:
|
|
88
|
-
metrics:
|
|
89
|
-
logs:
|
|
90
|
-
}),
|
|
91
|
-
resourceAttributes:
|
|
92
|
-
samplingRate:
|
|
93
|
-
});
|
|
94
|
-
|
|
41
|
+
export const OpenTelemetryConfigSchema = av.object({
|
|
42
|
+
serviceName: av.optional(av.string()).default("bsb-service"),
|
|
43
|
+
serviceVersion: av.optional(av.string()),
|
|
44
|
+
endpoint: av.optional(av.string().format("url")).default("http://localhost:4318"),
|
|
45
|
+
export: av.object({
|
|
46
|
+
protocol: av.optional(av.enum_(["http", "grpc"])).default("http"),
|
|
47
|
+
interval: av.optional(av.int32().min(100)).default(5000),
|
|
48
|
+
maxBatchSize: av.optional(av.int32().min(1)).default(512),
|
|
49
|
+
}, { unknownKeys: "strip" }),
|
|
50
|
+
enabled: av.object({
|
|
51
|
+
traces: av.optional(av.bool()).default(true),
|
|
52
|
+
metrics: av.optional(av.bool()).default(true),
|
|
53
|
+
logs: av.optional(av.bool()).default(true),
|
|
54
|
+
}, { unknownKeys: "strip" }),
|
|
55
|
+
resourceAttributes: av.optional(av.record(av.string())).default({}),
|
|
56
|
+
samplingRate: av.optional(av.number().min(0).max(1)).default(1.0),
|
|
57
|
+
}, { unknownKeys: "strip" });
|
|
58
|
+
export const Config = createConfigSchema({
|
|
95
59
|
name: 'observable-opentelemetry',
|
|
96
60
|
description: 'OpenTelemetry integration for logs, metrics, and traces via OTLP',
|
|
97
61
|
version: '9.0.0',
|
|
98
62
|
image: './observable-opentelemetry.png',
|
|
99
63
|
tags: ['opentelemetry', 'otlp', 'observability', 'logs', 'metrics', 'traces'],
|
|
100
64
|
documentation: ['./docs/plugin.md'],
|
|
101
|
-
},
|
|
65
|
+
}, OpenTelemetryConfigSchema);
|
|
102
66
|
/**
|
|
103
67
|
* Convert BSB log level to OpenTelemetry severity number
|
|
104
68
|
*/
|
|
@@ -140,9 +104,9 @@ function bsbLevelToOtelSeverityText(level) {
|
|
|
140
104
|
/**
|
|
141
105
|
* OpenTelemetry observable plugin with OTLP export
|
|
142
106
|
*/
|
|
143
|
-
class Plugin extends
|
|
144
|
-
static Config =
|
|
145
|
-
logFormatter = new
|
|
107
|
+
export class Plugin extends BSBObservable {
|
|
108
|
+
static Config = Config;
|
|
109
|
+
logFormatter = new LogFormatter();
|
|
146
110
|
sdk = null;
|
|
147
111
|
tracer = null;
|
|
148
112
|
meter = null;
|
|
@@ -160,23 +124,23 @@ class Plugin extends base_1.BSBObservable {
|
|
|
160
124
|
}
|
|
161
125
|
async init() {
|
|
162
126
|
// Create resource with service information
|
|
163
|
-
const resource = new
|
|
164
|
-
[
|
|
165
|
-
...(this.config.serviceVersion && { [
|
|
127
|
+
const resource = new Resource({
|
|
128
|
+
[ATTR_SERVICE_NAME]: this.config.serviceName,
|
|
129
|
+
...(this.config.serviceVersion && { [ATTR_SERVICE_VERSION]: this.config.serviceVersion }),
|
|
166
130
|
...this.config.resourceAttributes,
|
|
167
131
|
});
|
|
168
132
|
// Configure exporters
|
|
169
|
-
const traceExporter = new
|
|
133
|
+
const traceExporter = new OTLPTraceExporter({
|
|
170
134
|
url: `${this.config.endpoint}/v1/traces`,
|
|
171
135
|
});
|
|
172
|
-
const metricExporter = new
|
|
136
|
+
const metricExporter = new OTLPMetricExporter({
|
|
173
137
|
url: `${this.config.endpoint}/v1/metrics`,
|
|
174
138
|
});
|
|
175
|
-
const logExporter = new
|
|
139
|
+
const logExporter = new OTLPLogExporter({
|
|
176
140
|
url: `${this.config.endpoint}/v1/logs`,
|
|
177
141
|
});
|
|
178
142
|
// Initialize SDK
|
|
179
|
-
this.sdk = new
|
|
143
|
+
this.sdk = new NodeSDK({
|
|
180
144
|
resource,
|
|
181
145
|
traceExporter: this.config.enabled.traces ? traceExporter : undefined,
|
|
182
146
|
});
|
|
@@ -187,8 +151,8 @@ class Plugin extends base_1.BSBObservable {
|
|
|
187
151
|
}
|
|
188
152
|
// Setup metrics separately
|
|
189
153
|
if (this.config.enabled.metrics) {
|
|
190
|
-
const meterProvider = new
|
|
191
|
-
meterProvider.addMetricReader(new
|
|
154
|
+
const meterProvider = new MeterProvider({ resource });
|
|
155
|
+
meterProvider.addMetricReader(new PeriodicExportingMetricReader({
|
|
192
156
|
exporter: metricExporter,
|
|
193
157
|
exportIntervalMillis: this.config.export.interval,
|
|
194
158
|
}));
|
|
@@ -196,8 +160,8 @@ class Plugin extends base_1.BSBObservable {
|
|
|
196
160
|
}
|
|
197
161
|
// Setup logs separately
|
|
198
162
|
if (this.config.enabled.logs) {
|
|
199
|
-
this.loggerProvider = new
|
|
200
|
-
this.loggerProvider.addLogRecordProcessor(new
|
|
163
|
+
this.loggerProvider = new LoggerProvider({ resource });
|
|
164
|
+
this.loggerProvider.addLogRecordProcessor(new BatchLogRecordProcessor(logExporter));
|
|
201
165
|
this.logger = this.loggerProvider.getLogger(this.config.serviceName, this.config.serviceVersion);
|
|
202
166
|
}
|
|
203
167
|
}
|
|
@@ -255,7 +219,7 @@ class Plugin extends base_1.BSBObservable {
|
|
|
255
219
|
this.writeLog("warn", trace, pluginName, message, meta);
|
|
256
220
|
}
|
|
257
221
|
error(trace, pluginName, message, meta) {
|
|
258
|
-
if (message instanceof
|
|
222
|
+
if (message instanceof BSBError) {
|
|
259
223
|
if (message.raw !== null) {
|
|
260
224
|
this.writeLog("error", message.raw.trace, pluginName, message.raw.message, message.raw.meta);
|
|
261
225
|
}
|
|
@@ -398,4 +362,3 @@ class Plugin extends base_1.BSBObservable {
|
|
|
398
362
|
this.histograms.clear();
|
|
399
363
|
}
|
|
400
364
|
}
|
|
401
|
-
exports.Plugin = Plugin;
|
|
@@ -2,103 +2,6 @@
|
|
|
2
2
|
"pluginName": "observable-opentelemetry",
|
|
3
3
|
"version": "9.0.0",
|
|
4
4
|
"events": {},
|
|
5
|
-
"configSchema": {
|
|
6
|
-
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
7
|
-
"type": "object",
|
|
8
|
-
"properties": {
|
|
9
|
-
"serviceName": {
|
|
10
|
-
"default": "bsb-service",
|
|
11
|
-
"type": "string"
|
|
12
|
-
},
|
|
13
|
-
"serviceVersion": {
|
|
14
|
-
"type": "string"
|
|
15
|
-
},
|
|
16
|
-
"endpoint": {
|
|
17
|
-
"default": "http://localhost:4318",
|
|
18
|
-
"type": "string",
|
|
19
|
-
"format": "uri"
|
|
20
|
-
},
|
|
21
|
-
"export": {
|
|
22
|
-
"type": "object",
|
|
23
|
-
"properties": {
|
|
24
|
-
"protocol": {
|
|
25
|
-
"default": "http",
|
|
26
|
-
"type": "string",
|
|
27
|
-
"enum": [
|
|
28
|
-
"http",
|
|
29
|
-
"grpc"
|
|
30
|
-
]
|
|
31
|
-
},
|
|
32
|
-
"interval": {
|
|
33
|
-
"default": 5000,
|
|
34
|
-
"type": "integer",
|
|
35
|
-
"minimum": 100,
|
|
36
|
-
"maximum": 9007199254740991
|
|
37
|
-
},
|
|
38
|
-
"maxBatchSize": {
|
|
39
|
-
"default": 512,
|
|
40
|
-
"type": "integer",
|
|
41
|
-
"minimum": 1,
|
|
42
|
-
"maximum": 9007199254740991
|
|
43
|
-
}
|
|
44
|
-
},
|
|
45
|
-
"required": [
|
|
46
|
-
"protocol",
|
|
47
|
-
"interval",
|
|
48
|
-
"maxBatchSize"
|
|
49
|
-
],
|
|
50
|
-
"additionalProperties": false
|
|
51
|
-
},
|
|
52
|
-
"enabled": {
|
|
53
|
-
"type": "object",
|
|
54
|
-
"properties": {
|
|
55
|
-
"traces": {
|
|
56
|
-
"default": true,
|
|
57
|
-
"type": "boolean"
|
|
58
|
-
},
|
|
59
|
-
"metrics": {
|
|
60
|
-
"default": true,
|
|
61
|
-
"type": "boolean"
|
|
62
|
-
},
|
|
63
|
-
"logs": {
|
|
64
|
-
"default": true,
|
|
65
|
-
"type": "boolean"
|
|
66
|
-
}
|
|
67
|
-
},
|
|
68
|
-
"required": [
|
|
69
|
-
"traces",
|
|
70
|
-
"metrics",
|
|
71
|
-
"logs"
|
|
72
|
-
],
|
|
73
|
-
"additionalProperties": false
|
|
74
|
-
},
|
|
75
|
-
"resourceAttributes": {
|
|
76
|
-
"default": {},
|
|
77
|
-
"type": "object",
|
|
78
|
-
"propertyNames": {
|
|
79
|
-
"type": "string"
|
|
80
|
-
},
|
|
81
|
-
"additionalProperties": {
|
|
82
|
-
"type": "string"
|
|
83
|
-
}
|
|
84
|
-
},
|
|
85
|
-
"samplingRate": {
|
|
86
|
-
"default": 1,
|
|
87
|
-
"type": "number",
|
|
88
|
-
"minimum": 0,
|
|
89
|
-
"maximum": 1
|
|
90
|
-
}
|
|
91
|
-
},
|
|
92
|
-
"required": [
|
|
93
|
-
"serviceName",
|
|
94
|
-
"endpoint",
|
|
95
|
-
"export",
|
|
96
|
-
"enabled",
|
|
97
|
-
"resourceAttributes",
|
|
98
|
-
"samplingRate"
|
|
99
|
-
],
|
|
100
|
-
"additionalProperties": false
|
|
101
|
-
},
|
|
102
5
|
"pluginType": "observable",
|
|
103
6
|
"capabilities": {
|
|
104
7
|
"logging": {
|
|
@@ -16,102 +16,5 @@
|
|
|
16
16
|
"./docs/plugin.md"
|
|
17
17
|
],
|
|
18
18
|
"dependencies": [],
|
|
19
|
-
"image": "./observable-opentelemetry.png"
|
|
20
|
-
"configSchema": {
|
|
21
|
-
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
22
|
-
"type": "object",
|
|
23
|
-
"properties": {
|
|
24
|
-
"serviceName": {
|
|
25
|
-
"default": "bsb-service",
|
|
26
|
-
"type": "string"
|
|
27
|
-
},
|
|
28
|
-
"serviceVersion": {
|
|
29
|
-
"type": "string"
|
|
30
|
-
},
|
|
31
|
-
"endpoint": {
|
|
32
|
-
"default": "http://localhost:4318",
|
|
33
|
-
"type": "string",
|
|
34
|
-
"format": "uri"
|
|
35
|
-
},
|
|
36
|
-
"export": {
|
|
37
|
-
"type": "object",
|
|
38
|
-
"properties": {
|
|
39
|
-
"protocol": {
|
|
40
|
-
"default": "http",
|
|
41
|
-
"type": "string",
|
|
42
|
-
"enum": [
|
|
43
|
-
"http",
|
|
44
|
-
"grpc"
|
|
45
|
-
]
|
|
46
|
-
},
|
|
47
|
-
"interval": {
|
|
48
|
-
"default": 5000,
|
|
49
|
-
"type": "integer",
|
|
50
|
-
"minimum": 100,
|
|
51
|
-
"maximum": 9007199254740991
|
|
52
|
-
},
|
|
53
|
-
"maxBatchSize": {
|
|
54
|
-
"default": 512,
|
|
55
|
-
"type": "integer",
|
|
56
|
-
"minimum": 1,
|
|
57
|
-
"maximum": 9007199254740991
|
|
58
|
-
}
|
|
59
|
-
},
|
|
60
|
-
"required": [
|
|
61
|
-
"protocol",
|
|
62
|
-
"interval",
|
|
63
|
-
"maxBatchSize"
|
|
64
|
-
],
|
|
65
|
-
"additionalProperties": false
|
|
66
|
-
},
|
|
67
|
-
"enabled": {
|
|
68
|
-
"type": "object",
|
|
69
|
-
"properties": {
|
|
70
|
-
"traces": {
|
|
71
|
-
"default": true,
|
|
72
|
-
"type": "boolean"
|
|
73
|
-
},
|
|
74
|
-
"metrics": {
|
|
75
|
-
"default": true,
|
|
76
|
-
"type": "boolean"
|
|
77
|
-
},
|
|
78
|
-
"logs": {
|
|
79
|
-
"default": true,
|
|
80
|
-
"type": "boolean"
|
|
81
|
-
}
|
|
82
|
-
},
|
|
83
|
-
"required": [
|
|
84
|
-
"traces",
|
|
85
|
-
"metrics",
|
|
86
|
-
"logs"
|
|
87
|
-
],
|
|
88
|
-
"additionalProperties": false
|
|
89
|
-
},
|
|
90
|
-
"resourceAttributes": {
|
|
91
|
-
"default": {},
|
|
92
|
-
"type": "object",
|
|
93
|
-
"propertyNames": {
|
|
94
|
-
"type": "string"
|
|
95
|
-
},
|
|
96
|
-
"additionalProperties": {
|
|
97
|
-
"type": "string"
|
|
98
|
-
}
|
|
99
|
-
},
|
|
100
|
-
"samplingRate": {
|
|
101
|
-
"default": 1,
|
|
102
|
-
"type": "number",
|
|
103
|
-
"minimum": 0,
|
|
104
|
-
"maximum": 1
|
|
105
|
-
}
|
|
106
|
-
},
|
|
107
|
-
"required": [
|
|
108
|
-
"serviceName",
|
|
109
|
-
"endpoint",
|
|
110
|
-
"export",
|
|
111
|
-
"enabled",
|
|
112
|
-
"resourceAttributes",
|
|
113
|
-
"samplingRate"
|
|
114
|
-
],
|
|
115
|
-
"additionalProperties": false
|
|
116
|
-
}
|
|
19
|
+
"image": "./observable-opentelemetry.png"
|
|
117
20
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bsb/observable-opentelemetry",
|
|
3
|
-
"version": "9.
|
|
3
|
+
"version": "9.1.1",
|
|
4
|
+
"type": "module",
|
|
4
5
|
"license": "(AGPL-3.0-only OR Commercial)",
|
|
5
6
|
"author": {
|
|
6
7
|
"name": "BetterCorp (PTY) Ltd",
|
|
@@ -41,6 +42,7 @@
|
|
|
41
42
|
"@bsb/base": "^9.0.0"
|
|
42
43
|
},
|
|
43
44
|
"dependencies": {
|
|
45
|
+
"@anyvali/js": "^0.2.0",
|
|
44
46
|
"@opentelemetry/api": "^1.9.0",
|
|
45
47
|
"@opentelemetry/api-logs": "^0.54.0",
|
|
46
48
|
"@opentelemetry/sdk-node": "^0.54.0",
|
|
@@ -51,14 +53,13 @@
|
|
|
51
53
|
"@opentelemetry/exporter-logs-otlp-http": "^0.54.0",
|
|
52
54
|
"@opentelemetry/sdk-logs": "^0.54.0",
|
|
53
55
|
"@opentelemetry/resources": "^1.28.0",
|
|
54
|
-
"@opentelemetry/semantic-conventions": "^1.28.0"
|
|
55
|
-
"zod": "^4.3.6"
|
|
56
|
+
"@opentelemetry/semantic-conventions": "^1.28.0"
|
|
56
57
|
},
|
|
57
58
|
"devDependencies": {
|
|
58
59
|
"@types/node": "^25.0.0",
|
|
59
60
|
"typescript": "^5.9.0",
|
|
60
61
|
"mocha": "^11.0.0",
|
|
61
|
-
"@bsb/base": "
|
|
62
|
+
"@bsb/base": "^9.0.0"
|
|
62
63
|
},
|
|
63
64
|
"engines": {
|
|
64
65
|
"node": ">=23.0.0",
|
|
@@ -66,7 +67,3 @@
|
|
|
66
67
|
},
|
|
67
68
|
"homepage": "https://io.bsbcode.dev/packages/nodejs/@bsb/observable-opentelemetry"
|
|
68
69
|
}
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|