@principal-ai/otel-collector-server 0.1.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 +252 -0
- package/dist/OTELCollectorServer.d.ts +52 -0
- package/dist/OTELCollectorServer.d.ts.map +1 -0
- package/dist/OTELCollectorServer.js +252 -0
- package/dist/OTELCollectorServer.js.map +1 -0
- package/dist/__tests__/fixtures/traces.d.ts +8 -0
- package/dist/__tests__/fixtures/traces.d.ts.map +1 -0
- package/dist/__tests__/fixtures/traces.js +186 -0
- package/dist/__tests__/fixtures/traces.js.map +1 -0
- package/dist/bin/otel-collector-server.d.ts +6 -0
- package/dist/bin/otel-collector-server.d.ts.map +1 -0
- package/dist/bin/otel-collector-server.js +132 -0
- package/dist/bin/otel-collector-server.js.map +1 -0
- package/dist/core/BinaryManager.d.ts +35 -0
- package/dist/core/BinaryManager.d.ts.map +1 -0
- package/dist/core/BinaryManager.js +143 -0
- package/dist/core/BinaryManager.js.map +1 -0
- package/dist/core/CollectorProcessManager.d.ts +60 -0
- package/dist/core/CollectorProcessManager.d.ts.map +1 -0
- package/dist/core/CollectorProcessManager.js +197 -0
- package/dist/core/CollectorProcessManager.js.map +1 -0
- package/dist/core/ConfigGenerator.d.ts +23 -0
- package/dist/core/ConfigGenerator.d.ts.map +1 -0
- package/dist/core/ConfigGenerator.js +115 -0
- package/dist/core/ConfigGenerator.js.map +1 -0
- package/dist/index.d.ts +20 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +31 -0
- package/dist/index.js.map +1 -0
- package/dist/output/ConsoleOutput.d.ts +24 -0
- package/dist/output/ConsoleOutput.d.ts.map +1 -0
- package/dist/output/ConsoleOutput.js +156 -0
- package/dist/output/ConsoleOutput.js.map +1 -0
- package/dist/output/FileOutput.d.ts +18 -0
- package/dist/output/FileOutput.d.ts.map +1 -0
- package/dist/output/FileOutput.js +88 -0
- package/dist/output/FileOutput.js.map +1 -0
- package/dist/output/MessagePortOutput.d.ts +19 -0
- package/dist/output/MessagePortOutput.d.ts.map +1 -0
- package/dist/output/MessagePortOutput.js +25 -0
- package/dist/output/MessagePortOutput.js.map +1 -0
- package/dist/output/TraceOutput.d.ts +13 -0
- package/dist/output/TraceOutput.d.ts.map +1 -0
- package/dist/output/TraceOutput.js +6 -0
- package/dist/output/TraceOutput.js.map +1 -0
- package/dist/router/PortRouter.d.ts +41 -0
- package/dist/router/PortRouter.d.ts.map +1 -0
- package/dist/router/PortRouter.js +130 -0
- package/dist/router/PortRouter.js.map +1 -0
- package/dist/server/OTLPForwardingServer.d.ts +59 -0
- package/dist/server/OTLPForwardingServer.d.ts.map +1 -0
- package/dist/server/OTLPForwardingServer.js +245 -0
- package/dist/server/OTLPForwardingServer.js.map +1 -0
- package/dist/shared/logger.d.ts +18 -0
- package/dist/shared/logger.d.ts.map +1 -0
- package/dist/shared/logger.js +59 -0
- package/dist/shared/logger.js.map +1 -0
- package/dist/shared/types.d.ts +47 -0
- package/dist/shared/types.d.ts.map +1 -0
- package/dist/shared/types.js +6 -0
- package/dist/shared/types.js.map +1 -0
- package/package.json +61 -0
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* CollectorProcessManager - Manages OpenTelemetry Collector process lifecycle
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.CollectorProcessManager = void 0;
|
|
7
|
+
const child_process_1 = require("child_process");
|
|
8
|
+
const events_1 = require("events");
|
|
9
|
+
const logger_1 = require("../shared/logger");
|
|
10
|
+
class CollectorProcessManager extends events_1.EventEmitter {
|
|
11
|
+
constructor(config, logger) {
|
|
12
|
+
super();
|
|
13
|
+
this.collectorProcess = null;
|
|
14
|
+
this.startTime = 0;
|
|
15
|
+
this.restartCount = 0;
|
|
16
|
+
this.healthCheckTimer = null;
|
|
17
|
+
this.logger = logger || (0, logger_1.createLogger)('CollectorProcessManager');
|
|
18
|
+
this.config = {
|
|
19
|
+
maxRestartAttempts: 3,
|
|
20
|
+
restartDelay: 5000,
|
|
21
|
+
healthCheckInterval: 30000,
|
|
22
|
+
...config,
|
|
23
|
+
};
|
|
24
|
+
this.stats = {
|
|
25
|
+
uptime: 0,
|
|
26
|
+
restartCount: 0,
|
|
27
|
+
status: 'stopped',
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Start the collector process
|
|
32
|
+
*/
|
|
33
|
+
async start() {
|
|
34
|
+
if (this.collectorProcess) {
|
|
35
|
+
this.logger.warn('Collector already running');
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
this.logger.info('Starting OpenTelemetry Collector...');
|
|
39
|
+
this.stats.status = 'starting';
|
|
40
|
+
this.startTime = Date.now();
|
|
41
|
+
try {
|
|
42
|
+
this.spawnCollector();
|
|
43
|
+
this.startHealthChecks();
|
|
44
|
+
this.stats.status = 'running';
|
|
45
|
+
this.emit('ready');
|
|
46
|
+
this.logger.info(`Collector started (PID: ${this.stats.pid ?? 'unknown'})`);
|
|
47
|
+
}
|
|
48
|
+
catch (err) {
|
|
49
|
+
this.stats.status = 'crashed';
|
|
50
|
+
this.logger.error('Failed to start collector:', err);
|
|
51
|
+
throw err;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Stop the collector process
|
|
56
|
+
*/
|
|
57
|
+
async stop() {
|
|
58
|
+
if (!this.collectorProcess) {
|
|
59
|
+
this.logger.warn('Collector not running');
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
this.logger.info('Stopping OpenTelemetry Collector...');
|
|
63
|
+
this.stopHealthChecks();
|
|
64
|
+
return new Promise((resolve) => {
|
|
65
|
+
const timeout = setTimeout(() => {
|
|
66
|
+
this.logger.warn('Collector did not stop gracefully, forcing kill');
|
|
67
|
+
this.collectorProcess?.kill('SIGKILL');
|
|
68
|
+
resolve();
|
|
69
|
+
}, 5000);
|
|
70
|
+
this.collectorProcess?.once('exit', () => {
|
|
71
|
+
clearTimeout(timeout);
|
|
72
|
+
this.stats.status = 'stopped';
|
|
73
|
+
this.logger.info('Collector stopped');
|
|
74
|
+
resolve();
|
|
75
|
+
});
|
|
76
|
+
this.collectorProcess?.kill('SIGTERM');
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Check if collector is running
|
|
81
|
+
*/
|
|
82
|
+
isRunning() {
|
|
83
|
+
return this.collectorProcess !== null && this.stats.status === 'running';
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Get process statistics
|
|
87
|
+
*/
|
|
88
|
+
getStats() {
|
|
89
|
+
return {
|
|
90
|
+
...this.stats,
|
|
91
|
+
pid: this.collectorProcess?.pid,
|
|
92
|
+
uptime: this.startTime > 0 ? Date.now() - this.startTime : 0,
|
|
93
|
+
restartCount: this.restartCount,
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Spawn the collector process
|
|
98
|
+
*/
|
|
99
|
+
spawnCollector() {
|
|
100
|
+
this.collectorProcess = (0, child_process_1.spawn)(this.config.binaryPath, ['--config', this.config.configPath], {
|
|
101
|
+
stdio: ['ignore', 'pipe', 'pipe'],
|
|
102
|
+
env: {
|
|
103
|
+
...process.env,
|
|
104
|
+
},
|
|
105
|
+
});
|
|
106
|
+
if (!this.collectorProcess.pid) {
|
|
107
|
+
throw new Error('Failed to spawn collector process');
|
|
108
|
+
}
|
|
109
|
+
this.stats.pid = this.collectorProcess.pid;
|
|
110
|
+
// Pipe stdout
|
|
111
|
+
this.collectorProcess.stdout?.on('data', (data) => {
|
|
112
|
+
const message = data.toString().trim();
|
|
113
|
+
this.logger.debug('[Collector STDOUT]', message);
|
|
114
|
+
});
|
|
115
|
+
// Pipe stderr
|
|
116
|
+
this.collectorProcess.stderr?.on('data', (data) => {
|
|
117
|
+
const message = data.toString().trim();
|
|
118
|
+
this.logger.warn('[Collector STDERR]', message);
|
|
119
|
+
});
|
|
120
|
+
// Handle exit
|
|
121
|
+
this.collectorProcess.on('exit', (code, signal) => {
|
|
122
|
+
this.handleExit(code, signal);
|
|
123
|
+
});
|
|
124
|
+
// Handle errors
|
|
125
|
+
this.collectorProcess.on('error', (err) => {
|
|
126
|
+
this.logger.error('Collector process error:', err);
|
|
127
|
+
this.emit('error', err);
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* Handle collector process exit
|
|
132
|
+
*/
|
|
133
|
+
handleExit(code, signal) {
|
|
134
|
+
this.logger.warn(`Collector exited with code ${code}, signal ${signal}`);
|
|
135
|
+
this.collectorProcess = null;
|
|
136
|
+
this.stats.status = code === 0 ? 'stopped' : 'crashed';
|
|
137
|
+
this.stopHealthChecks();
|
|
138
|
+
this.emit('exit', code);
|
|
139
|
+
// Auto-restart if crashed and under max attempts
|
|
140
|
+
if (code !== 0 && this.restartCount < this.config.maxRestartAttempts) {
|
|
141
|
+
this.restartCount++;
|
|
142
|
+
this.logger.info(`Restarting collector (attempt ${this.restartCount}/${this.config.maxRestartAttempts})...`);
|
|
143
|
+
setTimeout(() => {
|
|
144
|
+
this.start().catch((err) => {
|
|
145
|
+
this.logger.error('Failed to restart collector:', err);
|
|
146
|
+
this.emit('error', err);
|
|
147
|
+
});
|
|
148
|
+
}, this.config.restartDelay);
|
|
149
|
+
}
|
|
150
|
+
else if (code !== 0) {
|
|
151
|
+
this.logger.error('Max restart attempts exceeded');
|
|
152
|
+
this.emit('error', new Error('Collector failed and max restart attempts exceeded'));
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* Start health checks
|
|
157
|
+
*/
|
|
158
|
+
startHealthChecks() {
|
|
159
|
+
if (this.healthCheckTimer) {
|
|
160
|
+
return;
|
|
161
|
+
}
|
|
162
|
+
this.healthCheckTimer = setInterval(() => {
|
|
163
|
+
this.performHealthCheck();
|
|
164
|
+
}, this.config.healthCheckInterval);
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* Stop health checks
|
|
168
|
+
*/
|
|
169
|
+
stopHealthChecks() {
|
|
170
|
+
if (this.healthCheckTimer) {
|
|
171
|
+
clearInterval(this.healthCheckTimer);
|
|
172
|
+
this.healthCheckTimer = null;
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
/**
|
|
176
|
+
* Perform health check
|
|
177
|
+
*/
|
|
178
|
+
performHealthCheck() {
|
|
179
|
+
if (!this.collectorProcess || !this.collectorProcess.pid) {
|
|
180
|
+
this.logger.warn('Health check failed: process not running');
|
|
181
|
+
this.stats.status = 'crashed';
|
|
182
|
+
return;
|
|
183
|
+
}
|
|
184
|
+
try {
|
|
185
|
+
// Check if process is still alive (Unix signal 0 doesn't actually send a signal)
|
|
186
|
+
process.kill(this.collectorProcess.pid, 0);
|
|
187
|
+
this.stats.lastHealthCheck = Date.now();
|
|
188
|
+
this.logger.debug('Health check passed');
|
|
189
|
+
}
|
|
190
|
+
catch (err) {
|
|
191
|
+
this.logger.error('Health check failed: process not responding');
|
|
192
|
+
this.stats.status = 'crashed';
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
exports.CollectorProcessManager = CollectorProcessManager;
|
|
197
|
+
//# sourceMappingURL=CollectorProcessManager.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CollectorProcessManager.js","sourceRoot":"","sources":["../../src/core/CollectorProcessManager.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAEH,iDAAoD;AACpD,mCAAsC;AACtC,6CAAwD;AAWxD,MAAa,uBAAwB,SAAQ,qBAAY;IASvD,YAAY,MAA4B,EAAE,MAAe;QACvD,KAAK,EAAE,CAAC;QAPF,qBAAgB,GAAwB,IAAI,CAAC;QAE7C,cAAS,GAAW,CAAC,CAAC;QACtB,iBAAY,GAAW,CAAC,CAAC;QACzB,qBAAgB,GAA0B,IAAI,CAAC;QAIrD,IAAI,CAAC,MAAM,GAAG,M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AAK,CAAC,eAAe,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;YACxC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,qBAAqB,CAAC,CAAC;QAC3C,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,6CAA6C,CAAC,CAAC;YACjE,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,SAAS,CAAC;QAChC,CAAC;IACH,CAAC;CACF;AAvND,0DAuNC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ConfigGenerator - Generates OpenTelemetry Collector configuration
|
|
3
|
+
*/
|
|
4
|
+
import { Logger } from '../shared/logger';
|
|
5
|
+
export interface CollectorConfig {
|
|
6
|
+
otlpPort: number;
|
|
7
|
+
otlpGrpcPort?: number;
|
|
8
|
+
wrapperPort: number;
|
|
9
|
+
logLevel?: 'debug' | 'info' | 'warn' | 'error';
|
|
10
|
+
}
|
|
11
|
+
export declare class ConfigGenerator {
|
|
12
|
+
private logger;
|
|
13
|
+
constructor(logger?: Logger);
|
|
14
|
+
/**
|
|
15
|
+
* Generate collector configuration YAML
|
|
16
|
+
*/
|
|
17
|
+
generate(config: CollectorConfig): string;
|
|
18
|
+
/**
|
|
19
|
+
* Write configuration to file
|
|
20
|
+
*/
|
|
21
|
+
writeConfig(config: CollectorConfig, filePath: string): Promise<void>;
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=ConfigGenerator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ConfigGenerator.d.ts","sourceRoot":"","sources":["../../src/core/ConfigGenerator.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,OAAO,EAAE,MAAM,EAAgB,MAAM,kBAAkB,CAAC;AAExD,MAAM,WAAW,eAAe;IAC9B,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;CAChD;AA8CD,qBAAa,eAAe;IAC1B,OAAO,CAAC,MAAM,CAAS;gBAEX,MAAM,CAAC,EAAE,MAAM;IAI3B;;OAEG;IACH,QAAQ,CAAC,MAAM,EAAE,eAAe,GAAG,MAAM;IA4DzC;;OAEG;IACG,WAAW,CAAC,MAAM,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAM5E"}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* ConfigGenerator - Generates OpenTelemetry Collector configuration
|
|
4
|
+
*/
|
|
5
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
8
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
9
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
10
|
+
}
|
|
11
|
+
Object.defineProperty(o, k2, desc);
|
|
12
|
+
}) : (function(o, m, k, k2) {
|
|
13
|
+
if (k2 === undefined) k2 = k;
|
|
14
|
+
o[k2] = m[k];
|
|
15
|
+
}));
|
|
16
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
17
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
18
|
+
}) : function(o, v) {
|
|
19
|
+
o["default"] = v;
|
|
20
|
+
});
|
|
21
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
22
|
+
var ownKeys = function(o) {
|
|
23
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
24
|
+
var ar = [];
|
|
25
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
26
|
+
return ar;
|
|
27
|
+
};
|
|
28
|
+
return ownKeys(o);
|
|
29
|
+
};
|
|
30
|
+
return function (mod) {
|
|
31
|
+
if (mod && mod.__esModule) return mod;
|
|
32
|
+
var result = {};
|
|
33
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
34
|
+
__setModuleDefault(result, mod);
|
|
35
|
+
return result;
|
|
36
|
+
};
|
|
37
|
+
})();
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.ConfigGenerator = void 0;
|
|
40
|
+
const fs = __importStar(require("fs"));
|
|
41
|
+
const yaml = __importStar(require("yaml"));
|
|
42
|
+
const logger_1 = require("../shared/logger");
|
|
43
|
+
class ConfigGenerator {
|
|
44
|
+
constructor(logger) {
|
|
45
|
+
this.logger = logger || (0, logger_1.createLogger)('ConfigGenerator');
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Generate collector configuration YAML
|
|
49
|
+
*/
|
|
50
|
+
generate(config) {
|
|
51
|
+
this.logger.debug('Generating collector config:', config);
|
|
52
|
+
const collectorConfig = {
|
|
53
|
+
receivers: {
|
|
54
|
+
otlp: {
|
|
55
|
+
protocols: {
|
|
56
|
+
http: {
|
|
57
|
+
endpoint: `0.0.0.0:${config.otlpPort}`,
|
|
58
|
+
cors: {
|
|
59
|
+
allowed_origins: [
|
|
60
|
+
'http://localhost:*',
|
|
61
|
+
'http://127.0.0.1:*',
|
|
62
|
+
],
|
|
63
|
+
},
|
|
64
|
+
},
|
|
65
|
+
},
|
|
66
|
+
},
|
|
67
|
+
},
|
|
68
|
+
processors: {
|
|
69
|
+
batch: {
|
|
70
|
+
timeout: '1s',
|
|
71
|
+
send_batch_size: 100,
|
|
72
|
+
},
|
|
73
|
+
},
|
|
74
|
+
exporters: {
|
|
75
|
+
otlphttp: {
|
|
76
|
+
endpoint: `http://127.0.0.1:${config.wrapperPort}/v1/traces`,
|
|
77
|
+
compression: 'none',
|
|
78
|
+
retry_on_failure: {
|
|
79
|
+
enabled: true,
|
|
80
|
+
initial_interval: '1s',
|
|
81
|
+
max_interval: '30s',
|
|
82
|
+
},
|
|
83
|
+
},
|
|
84
|
+
},
|
|
85
|
+
service: {
|
|
86
|
+
pipelines: {
|
|
87
|
+
traces: {
|
|
88
|
+
receivers: ['otlp'],
|
|
89
|
+
processors: ['batch'],
|
|
90
|
+
exporters: ['otlphttp'],
|
|
91
|
+
},
|
|
92
|
+
},
|
|
93
|
+
},
|
|
94
|
+
};
|
|
95
|
+
// Add gRPC if configured
|
|
96
|
+
if (config.otlpGrpcPort) {
|
|
97
|
+
collectorConfig.receivers.otlp.protocols.grpc = {
|
|
98
|
+
endpoint: `0.0.0.0:${config.otlpGrpcPort}`,
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
const yamlStr = yaml.stringify(collectorConfig);
|
|
102
|
+
this.logger.debug('Generated config:\n', yamlStr);
|
|
103
|
+
return yamlStr;
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Write configuration to file
|
|
107
|
+
*/
|
|
108
|
+
async writeConfig(config, filePath) {
|
|
109
|
+
const yamlContent = this.generate(config);
|
|
110
|
+
await fs.promises.writeFile(filePath, yamlContent, 'utf-8');
|
|
111
|
+
this.logger.info(`Config written to: ${filePath}`);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
exports.ConfigGenerator = ConfigGenerator;
|
|
115
|
+
//# sourceMappingURL=ConfigGenerator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ConfigGenerator.js","sourceRoot":"","sources":["../../src/core/ConfigGenerator.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,uCAAyB;AACzB,2CAA6B;AAC7B,6CAAwD;AAqDxD,MAAa,eAAe;IAG1B,YAAY,MAAe;QACzB,IAAI,CAAC,MA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,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,qBAAqB,EAAE,OAAO,CAAC,CAAC;QAElD,OAAO,OAAO,CAAC;IACjB,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,WAAW,CAAC,MAAuB,EAAE,QAAgB;QACzD,MAAM,WAAW,GAAG,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;QAE1C,MAAM,EAAE,CAAC,QAAQ,CAAC,SAAS,CAAC,QAAQ,EAAE,WAAW,EAAE,OAAO,CAAC,CAAC;QAC5D,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,sBAAsB,QAAQ,EAAE,CAAC,CAAC;IACrD,CAAC;CACF;AA/ED,0CA+EC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @principal-ai/otel-collector-server
|
|
3
|
+
*
|
|
4
|
+
* Node.js wrapper around the OpenTelemetry Collector with dual-mode support:
|
|
5
|
+
* - Standalone: Console/file output for development and testing
|
|
6
|
+
* - Electron: MessagePort routing for Electron renderer integration
|
|
7
|
+
*/
|
|
8
|
+
export { OTELCollectorServer } from './OTELCollectorServer';
|
|
9
|
+
export type { OTELCollectorServerConfig, ServerStats, ProcessStats, BinaryInfo, PortRegistration, } from './shared/types';
|
|
10
|
+
export type { LogLevel } from './shared/logger';
|
|
11
|
+
export { TraceOutput } from './output/TraceOutput';
|
|
12
|
+
export { ConsoleOutput } from './output/ConsoleOutput';
|
|
13
|
+
export { FileOutput } from './output/FileOutput';
|
|
14
|
+
export { MessagePortOutput } from './output/MessagePortOutput';
|
|
15
|
+
export { PortRouter } from './router/PortRouter';
|
|
16
|
+
export { BinaryManager } from './core/BinaryManager';
|
|
17
|
+
export { ConfigGenerator, CollectorConfig } from './core/ConfigGenerator';
|
|
18
|
+
export { CollectorProcessManager } from './core/CollectorProcessManager';
|
|
19
|
+
export { OTLPForwardingServer } from './server/OTLPForwardingServer';
|
|
20
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAG5D,YAAY,EACV,yBAAyB,EACzB,WAAW,EACX,YAAY,EACZ,UAAU,EACV,gBAAgB,GACjB,MAAM,gBAAgB,CAAC;AAExB,YAAY,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAGhD,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAG/D,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAGjD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAC1E,OAAO,EAAE,uBAAuB,EAAE,MAAM,gCAAgC,CAAC;AACzE,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @principal-ai/otel-collector-server
|
|
4
|
+
*
|
|
5
|
+
* Node.js wrapper around the OpenTelemetry Collector with dual-mode support:
|
|
6
|
+
* - Standalone: Console/file output for development and testing
|
|
7
|
+
* - Electron: MessagePort routing for Electron renderer integration
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.OTLPForwardingServer = exports.CollectorProcessManager = exports.ConfigGenerator = exports.BinaryManager = exports.PortRouter = exports.MessagePortOutput = exports.FileOutput = exports.ConsoleOutput = exports.OTELCollectorServer = void 0;
|
|
11
|
+
var OTELCollectorServer_1 = require("./OTELCollectorServer");
|
|
12
|
+
Object.defineProperty(exports, "OTELCollectorServer", { enumerable: true, get: function () { return OTELCollectorServer_1.OTELCollectorServer; } });
|
|
13
|
+
var ConsoleOutput_1 = require("./output/ConsoleOutput");
|
|
14
|
+
Object.defineProperty(exports, "ConsoleOutput", { enumerable: true, get: function () { return ConsoleOutput_1.ConsoleOutput; } });
|
|
15
|
+
var FileOutput_1 = require("./output/FileOutput");
|
|
16
|
+
Object.defineProperty(exports, "FileOutput", { enumerable: true, get: function () { return FileOutput_1.FileOutput; } });
|
|
17
|
+
var MessagePortOutput_1 = require("./output/MessagePortOutput");
|
|
18
|
+
Object.defineProperty(exports, "MessagePortOutput", { enumerable: true, get: function () { return MessagePortOutput_1.MessagePortOutput; } });
|
|
19
|
+
// Export router (Electron mode)
|
|
20
|
+
var PortRouter_1 = require("./router/PortRouter");
|
|
21
|
+
Object.defineProperty(exports, "PortRouter", { enumerable: true, get: function () { return PortRouter_1.PortRouter; } });
|
|
22
|
+
// Export core components (for advanced usage)
|
|
23
|
+
var BinaryManager_1 = require("./core/BinaryManager");
|
|
24
|
+
Object.defineProperty(exports, "BinaryManager", { enumerable: true, get: function () { return BinaryManager_1.BinaryManager; } });
|
|
25
|
+
var ConfigGenerator_1 = require("./core/ConfigGenerator");
|
|
26
|
+
Object.defineProperty(exports, "ConfigGenerator", { enumerable: true, get: function () { return ConfigGenerator_1.ConfigGenerator; } });
|
|
27
|
+
var CollectorProcessManager_1 = require("./core/CollectorProcessManager");
|
|
28
|
+
Object.defineProperty(exports, "CollectorProcessManager", { enumerable: true, get: function () { return CollectorProcessManager_1.CollectorProcessManager; } });
|
|
29
|
+
var OTLPForwardingServer_1 = require("./server/OTLPForwardingServer");
|
|
30
|
+
Object.defineProperty(exports, "OTLPForwardingServer", { enumerable: true, get: function () { return OTLPForwardingServer_1.OTLPForwardingServer; } });
|
|
31
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;AAEH,6DAA4D;AAAnD,0HAAA,mBAAmB,OAAA;AAe5B,wDAAuD;AAA9C,8GAAA,aAAa,OAAA;AACtB,kDAAiD;AAAxC,wGAAA,UAAU,OAAA;AACnB,gEAA+D;AAAtD,sHAAA,iBAAiB,OAAA;AAE1B,gCAAgC;AAChC,kDAAiD;AAAxC,wGAAA,UAAU,OAAA;AAEnB,8CAA8C;AAC9C,sDAAqD;AAA5C,8GAAA,aAAa,OAAA;AACtB,0DAA0E;AAAjE,kHAAA,eAAe,OAAA;AACxB,0EAAyE;AAAhE,kIAAA,uBAAuB,OAAA;AAChC,sEAAqE;AAA5D,4HAAA,oBAAoB,OAAA"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ConsoleOutput - Pretty-print traces to console
|
|
3
|
+
*/
|
|
4
|
+
import { IExportTraceServiceRequest } from '@opentelemetry/otlp-transformer';
|
|
5
|
+
import { TraceOutput } from './TraceOutput';
|
|
6
|
+
export interface ConsoleOutputOptions {
|
|
7
|
+
prettyPrint?: boolean;
|
|
8
|
+
showResource?: boolean;
|
|
9
|
+
showEvents?: boolean;
|
|
10
|
+
}
|
|
11
|
+
export declare class ConsoleOutput implements TraceOutput {
|
|
12
|
+
private options;
|
|
13
|
+
constructor(options?: ConsoleOutputOptions);
|
|
14
|
+
send(payload: IExportTraceServiceRequest, source: string): void;
|
|
15
|
+
private prettyPrintTrace;
|
|
16
|
+
private printResource;
|
|
17
|
+
private printSpan;
|
|
18
|
+
private extractAttributes;
|
|
19
|
+
private getImportantAttributes;
|
|
20
|
+
private calculateDuration;
|
|
21
|
+
private spanKindToString;
|
|
22
|
+
private statusToString;
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=ConsoleOutput.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ConsoleOutput.d.ts","sourceRoot":"","sources":["../../src/output/ConsoleOutput.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,0BAA0B,EAA+B,MAAM,iCAAiC,CAAC;AAC1G,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAI5C,MAAM,WAAW,oBAAoB;IACnC,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,qBAAa,aAAc,YAAW,WAAW;IACnC,OAAO,CAAC,OAAO;gBAAP,OAAO,GAAE,oBAAyB;IAStD,IAAI,CAAC,OAAO,EAAE,0BAA0B,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI;IAe/D,OAAO,CAAC,gBAAgB;IAoBxB,OAAO,CAAC,aAAa;IAoBrB,OAAO,CAAC,SAAS;IAmCjB,OAAO,CAAC,iBAAiB;IAuBzB,OAAO,CAAC,sBAAsB;IAyB9B,OAAO,CAAC,iBAAiB;IAYzB,OAAO,CAAC,gBAAgB;IAKxB,OAAO,CAAC,cAAc;CAMvB"}
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* ConsoleOutput - Pretty-print traces to console
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.ConsoleOutput = void 0;
|
|
7
|
+
class ConsoleOutput {
|
|
8
|
+
constructor(options = {}) {
|
|
9
|
+
this.options = options;
|
|
10
|
+
this.options = {
|
|
11
|
+
prettyPrint: true,
|
|
12
|
+
showResource: true,
|
|
13
|
+
showEvents: false,
|
|
14
|
+
...options,
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
send(payload, source) {
|
|
18
|
+
console.log(`\n${'='.repeat(70)}`);
|
|
19
|
+
console.log(`TRACE FROM ${source}`);
|
|
20
|
+
console.log(`Received at: ${new Date().toISOString()}`);
|
|
21
|
+
console.log('='.repeat(70));
|
|
22
|
+
if (this.options.prettyPrint) {
|
|
23
|
+
this.prettyPrintTrace(payload);
|
|
24
|
+
}
|
|
25
|
+
else {
|
|
26
|
+
console.log(JSON.stringify(payload, null, 2));
|
|
27
|
+
}
|
|
28
|
+
console.log('='.repeat(70) + '\n');
|
|
29
|
+
}
|
|
30
|
+
prettyPrintTrace(payload) {
|
|
31
|
+
payload.resourceSpans?.forEach((rs) => {
|
|
32
|
+
// Print resource attributes
|
|
33
|
+
if (this.options.showResource && rs.resource) {
|
|
34
|
+
this.printResource(rs.resource);
|
|
35
|
+
}
|
|
36
|
+
// Print spans
|
|
37
|
+
rs.scopeSpans?.forEach((ss) => {
|
|
38
|
+
if (ss.scope) {
|
|
39
|
+
console.log(`\nScope: ${ss.scope.name}${ss.scope.version ? ` (${ss.scope.version})` : ''}`);
|
|
40
|
+
}
|
|
41
|
+
ss.spans?.forEach((span) => {
|
|
42
|
+
this.printSpan(span);
|
|
43
|
+
});
|
|
44
|
+
});
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
printResource(resource) {
|
|
48
|
+
const attrs = this.extractAttributes(resource.attributes);
|
|
49
|
+
const serviceName = attrs['service.name'] || 'unknown';
|
|
50
|
+
const serviceVersion = attrs['service.version'];
|
|
51
|
+
console.log(`\nService: ${serviceName}${serviceVersion ? ` v${serviceVersion}` : ''}`);
|
|
52
|
+
// Show other resource attributes
|
|
53
|
+
const otherAttrs = Object.entries(attrs).filter(([key]) => !key.startsWith('service.'));
|
|
54
|
+
if (otherAttrs.length > 0 && this.options.showResource) {
|
|
55
|
+
console.log('Resource Attributes:');
|
|
56
|
+
otherAttrs.forEach(([key, value]) => {
|
|
57
|
+
console.log(` ${key}: ${value}`);
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
printSpan(span) {
|
|
62
|
+
const duration = this.calculateDuration(span);
|
|
63
|
+
const kind = this.spanKindToString(span.kind);
|
|
64
|
+
const status = this.statusToString(span.status?.code);
|
|
65
|
+
const indent = span.parentSpanId ? ' └─ ' : ' - ';
|
|
66
|
+
// Main span info
|
|
67
|
+
console.log(`${indent}${span.name} (${kind}) ${duration}ms [${status}]`);
|
|
68
|
+
// Show attributes if any
|
|
69
|
+
if (span.attributes && span.attributes.length > 0) {
|
|
70
|
+
const attrs = this.extractAttributes(span.attributes);
|
|
71
|
+
const importantAttrs = this.getImportantAttributes(attrs);
|
|
72
|
+
if (Object.keys(importantAttrs).length > 0) {
|
|
73
|
+
const attrStr = Object.entries(importantAttrs)
|
|
74
|
+
.map(([k, v]) => `${k}=${v}`)
|
|
75
|
+
.join(', ');
|
|
76
|
+
console.log(` ${attrStr}`);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
// Show events if enabled
|
|
80
|
+
if (this.options.showEvents && span.events && span.events.length > 0) {
|
|
81
|
+
span.events.forEach((event) => {
|
|
82
|
+
console.log(` ⚡ ${event.name}`);
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
// Show error message if present
|
|
86
|
+
if (status === 'ERROR' && span.status?.message) {
|
|
87
|
+
console.log(` ❌ ${span.status.message}`);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
extractAttributes(attributes) {
|
|
91
|
+
if (!attributes)
|
|
92
|
+
return {};
|
|
93
|
+
const result = {};
|
|
94
|
+
for (const attr of attributes) {
|
|
95
|
+
if (!attr.key)
|
|
96
|
+
continue;
|
|
97
|
+
const value = attr.value?.stringValue ??
|
|
98
|
+
attr.value?.intValue ??
|
|
99
|
+
attr.value?.doubleValue ??
|
|
100
|
+
attr.value?.boolValue ??
|
|
101
|
+
null;
|
|
102
|
+
if (value !== null) {
|
|
103
|
+
result[attr.key] = value;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
return result;
|
|
107
|
+
}
|
|
108
|
+
getImportantAttributes(attrs) {
|
|
109
|
+
// Filter to show only important attributes (HTTP, DB, etc.)
|
|
110
|
+
const importantKeys = [
|
|
111
|
+
'http.method',
|
|
112
|
+
'http.status_code',
|
|
113
|
+
'http.route',
|
|
114
|
+
'http.target',
|
|
115
|
+
'db.system',
|
|
116
|
+
'db.statement',
|
|
117
|
+
'rpc.service',
|
|
118
|
+
'rpc.method',
|
|
119
|
+
'error',
|
|
120
|
+
];
|
|
121
|
+
const result = {};
|
|
122
|
+
for (const key of importantKeys) {
|
|
123
|
+
if (attrs[key] !== undefined) {
|
|
124
|
+
result[key] = attrs[key];
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
return result;
|
|
128
|
+
}
|
|
129
|
+
calculateDuration(span) {
|
|
130
|
+
try {
|
|
131
|
+
const startNano = BigInt(String(span.startTimeUnixNano || '0'));
|
|
132
|
+
const endNano = BigInt(String(span.endTimeUnixNano || '0'));
|
|
133
|
+
const durationNano = endNano - startNano;
|
|
134
|
+
const durationMs = Number(durationNano / BigInt(1000000));
|
|
135
|
+
return Math.round(durationMs * 100) / 100; // Round to 2 decimals
|
|
136
|
+
}
|
|
137
|
+
catch {
|
|
138
|
+
return 0;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
spanKindToString(kind) {
|
|
142
|
+
const kinds = ['UNSPECIFIED', 'INTERNAL', 'SERVER', 'CLIENT', 'PRODUCER', 'CONSUMER'];
|
|
143
|
+
return kinds[kind || 0] || 'UNKNOWN';
|
|
144
|
+
}
|
|
145
|
+
statusToString(code) {
|
|
146
|
+
if (code === 0 || code === undefined)
|
|
147
|
+
return 'UNSET';
|
|
148
|
+
if (code === 1)
|
|
149
|
+
return 'OK';
|
|
150
|
+
if (code === 2)
|
|
151
|
+
return 'ERROR';
|
|
152
|
+
return 'UNKNOWN';
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
exports.ConsoleOutput = ConsoleOutput;
|
|
156
|
+
//# sourceMappingURL=ConsoleOutput.js.map
|
|
@@ -0,0 +1 @@
|
|
|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,CAAC,IAAwB;QAC7C,IAAI,IAAI,KAAK,CAAC,IAAI,IAAI,KAAK,SAAS;YAAE,OAAO,OAAO,CAAC;QACrD,IAAI,IAAI,KAAK,CAAC;YAAE,OAAO,IAAI,CAAC;QAC5B,IAAI,IAAI,KAAK,CAAC;YAAE,OAAO,OAAO,CAAC;QAC/B,OAAO,SAAS,CAAC;IACnB,CAAC;CACF;AA3KD,sCA2KC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* FileOutput - Write traces to file as JSONL
|
|
3
|
+
*/
|
|
4
|
+
import { IExportTraceServiceRequest } from '@opentelemetry/otlp-transformer';
|
|
5
|
+
import { TraceOutput } from './TraceOutput';
|
|
6
|
+
import { Logger } from '../shared/logger';
|
|
7
|
+
export declare class FileOutput implements TraceOutput {
|
|
8
|
+
private logger;
|
|
9
|
+
private writeStream;
|
|
10
|
+
private closed;
|
|
11
|
+
constructor(filePath: string, logger?: Logger);
|
|
12
|
+
send(payload: IExportTraceServiceRequest, source: string): void;
|
|
13
|
+
/**
|
|
14
|
+
* Close the file stream
|
|
15
|
+
*/
|
|
16
|
+
close(): Promise<void>;
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=FileOutput.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FileOutput.d.ts","sourceRoot":"","sources":["../../src/output/FileOutput.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,EAAE,0BAA0B,EAAE,MAAM,iCAAiC,CAAC;AAC7E,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,MAAM,EAAgB,MAAM,kBAAkB,CAAC;AAExD,qBAAa,UAAW,YAAW,WAAW;IAC5C,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,WAAW,CAAiB;IACpC,OAAO,CAAC,MAAM,CAAkB;gBAEpB,QAAQ,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM;IAgB7C,IAAI,CAAC,OAAO,EAAE,0BAA0B,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI;IAU/D;;OAEG;IACH,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;CAmBvB"}
|