@orgloop/logger-otel 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/LICENSE.md +21 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +71 -0
- package/dist/index.js.map +1 -0
- package/dist/otel-logger.d.ts +36 -0
- package/dist/otel-logger.d.ts.map +1 -0
- package/dist/otel-logger.js +120 -0
- package/dist/otel-logger.js.map +1 -0
- package/package.json +34 -0
package/LICENSE.md
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 OrgLoop contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @orgloop/logger-otel — registration entry point.
|
|
3
|
+
*/
|
|
4
|
+
import type { LoggerRegistration } from '@orgloop/sdk';
|
|
5
|
+
export declare function register(): LoggerRegistration;
|
|
6
|
+
export { OtelLogger } from './otel-logger.js';
|
|
7
|
+
export { PHASE_SEVERITY } from './otel-logger.js';
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAGvD,wBAAgB,QAAQ,IAAI,kBAAkB,CA+D7C;AAED,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @orgloop/logger-otel — registration entry point.
|
|
3
|
+
*/
|
|
4
|
+
import { OtelLogger } from './otel-logger.js';
|
|
5
|
+
export function register() {
|
|
6
|
+
return {
|
|
7
|
+
id: 'otel',
|
|
8
|
+
logger: OtelLogger,
|
|
9
|
+
configSchema: {
|
|
10
|
+
type: 'object',
|
|
11
|
+
properties: {
|
|
12
|
+
endpoint: {
|
|
13
|
+
type: 'string',
|
|
14
|
+
description: 'OTLP HTTP endpoint for log export.',
|
|
15
|
+
default: 'http://localhost:4318/v1/logs',
|
|
16
|
+
},
|
|
17
|
+
protocol: {
|
|
18
|
+
type: 'string',
|
|
19
|
+
enum: ['http/json', 'http/protobuf', 'grpc'],
|
|
20
|
+
description: 'OTLP transport protocol.',
|
|
21
|
+
default: 'http/json',
|
|
22
|
+
},
|
|
23
|
+
headers: {
|
|
24
|
+
type: 'object',
|
|
25
|
+
description: 'Custom headers for OTLP requests (e.g., authorization).',
|
|
26
|
+
additionalProperties: { type: 'string' },
|
|
27
|
+
},
|
|
28
|
+
service_name: {
|
|
29
|
+
type: 'string',
|
|
30
|
+
description: 'OTel service name resource attribute.',
|
|
31
|
+
default: 'orgloop',
|
|
32
|
+
},
|
|
33
|
+
service_version: {
|
|
34
|
+
type: 'string',
|
|
35
|
+
description: 'OTel service version resource attribute.',
|
|
36
|
+
},
|
|
37
|
+
resource_attributes: {
|
|
38
|
+
type: 'object',
|
|
39
|
+
description: 'Additional OTel resource attributes.',
|
|
40
|
+
additionalProperties: { type: 'string' },
|
|
41
|
+
},
|
|
42
|
+
batch: {
|
|
43
|
+
type: 'object',
|
|
44
|
+
description: 'Batch processor configuration.',
|
|
45
|
+
properties: {
|
|
46
|
+
max_queue_size: {
|
|
47
|
+
type: 'number',
|
|
48
|
+
description: 'Maximum queue size before dropping.',
|
|
49
|
+
default: 2048,
|
|
50
|
+
},
|
|
51
|
+
scheduled_delay_ms: {
|
|
52
|
+
type: 'number',
|
|
53
|
+
description: 'Delay between batch exports in milliseconds.',
|
|
54
|
+
default: 5000,
|
|
55
|
+
},
|
|
56
|
+
max_export_batch_size: {
|
|
57
|
+
type: 'number',
|
|
58
|
+
description: 'Maximum number of records per export batch.',
|
|
59
|
+
default: 512,
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
additionalProperties: false,
|
|
63
|
+
},
|
|
64
|
+
},
|
|
65
|
+
additionalProperties: false,
|
|
66
|
+
},
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
export { OtelLogger } from './otel-logger.js';
|
|
70
|
+
export { PHASE_SEVERITY } from './otel-logger.js';
|
|
71
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAk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AA6C;4BAC1D,OAAO,EAAE,GAAG;yBACZ;qBACD;oBACD,oBAAoB,EAAE,KAAK;iBAC3B;aACD;YACD,oBAAoB,EAAE,KAAK;SAC3B;KACD,CAAC;AACH,CAAC;AAED,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* OpenTelemetry logger — exports OrgLoop LogEntry data via OTLP.
|
|
3
|
+
*
|
|
4
|
+
* Maps LogEntry fields to OTel LogRecord attributes and uses
|
|
5
|
+
* phase-based severity mapping for structured observability.
|
|
6
|
+
*/
|
|
7
|
+
import type { LogEntry, LogPhase, Logger } from '@orgloop/sdk';
|
|
8
|
+
/** Phase → OTel severity number mapping (follows OTel severity spec) */
|
|
9
|
+
declare const PHASE_SEVERITY: Record<LogPhase, {
|
|
10
|
+
text: string;
|
|
11
|
+
number: number;
|
|
12
|
+
}>;
|
|
13
|
+
export interface OtelLoggerConfig {
|
|
14
|
+
endpoint?: string;
|
|
15
|
+
protocol?: 'http/json' | 'http/protobuf' | 'grpc';
|
|
16
|
+
headers?: Record<string, string>;
|
|
17
|
+
service_name?: string;
|
|
18
|
+
service_version?: string;
|
|
19
|
+
resource_attributes?: Record<string, string>;
|
|
20
|
+
batch?: {
|
|
21
|
+
max_queue_size?: number;
|
|
22
|
+
scheduled_delay_ms?: number;
|
|
23
|
+
max_export_batch_size?: number;
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
export declare class OtelLogger implements Logger {
|
|
27
|
+
readonly id = "otel";
|
|
28
|
+
private loggerProvider;
|
|
29
|
+
private otelLogger;
|
|
30
|
+
init(config: Record<string, unknown>): Promise<void>;
|
|
31
|
+
log(entry: LogEntry): Promise<void>;
|
|
32
|
+
flush(): Promise<void>;
|
|
33
|
+
shutdown(): Promise<void>;
|
|
34
|
+
}
|
|
35
|
+
export { PH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AQtB,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC;CAS/B;AAED,OAAO,EAAE,cAAc,EAAE,CAAC"}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* OpenTelemetry logger — exports OrgLoop LogEntry data via OTLP.
|
|
3
|
+
*
|
|
4
|
+
* Maps LogEntry fields to OTel LogRecord attributes and uses
|
|
5
|
+
* phase-based severity mapping for structured observability.
|
|
6
|
+
*/
|
|
7
|
+
/** Phase → OTel severity number mapping (follows OTel severity spec) */
|
|
8
|
+
const PHASE_SEVERITY = {
|
|
9
|
+
'source.emit': { text: 'INFO', number: 9 },
|
|
10
|
+
'transform.start': { text: 'INFO', number: 9 },
|
|
11
|
+
'transform.pass': { text: 'INFO', number: 9 },
|
|
12
|
+
'transform.drop': { text: 'INFO', number: 9 },
|
|
13
|
+
'transform.error': { text: 'WARN', number: 13 },
|
|
14
|
+
'route.match': { text: 'INFO', number: 9 },
|
|
15
|
+
'route.no_match': { text: 'DEBUG', number: 5 },
|
|
16
|
+
'deliver.attempt': { text: 'INFO', number: 9 },
|
|
17
|
+
'deliver.success': { text: 'INFO', number: 9 },
|
|
18
|
+
'deliver.failure': { text: 'ERROR', number: 17 },
|
|
19
|
+
'deliver.retry': { text: 'WARN', number: 13 },
|
|
20
|
+
'system.start': { text: 'INFO', number: 9 },
|
|
21
|
+
'system.stop': { text: 'INFO', number: 9 },
|
|
22
|
+
'system.error': { text: 'ERROR', number: 17 },
|
|
23
|
+
};
|
|
24
|
+
export class OtelLogger {
|
|
25
|
+
id = 'otel';
|
|
26
|
+
loggerProvider = null;
|
|
27
|
+
otelLogger = null;
|
|
28
|
+
async init(config) {
|
|
29
|
+
const cfg = config;
|
|
30
|
+
const { Resource } = await import('@opentelemetry/resources');
|
|
31
|
+
const { ATTR_SERVICE_NAME, ATTR_SERVICE_VERSION } = await import('@opentelemetry/semantic-conventions');
|
|
32
|
+
const { LoggerProvider, BatchLogRecordProcessor } = await import('@opentelemetry/sdk-logs');
|
|
33
|
+
const { OTLPLogExporter } = await import('@opentelemetry/exporter-logs-otlp-http');
|
|
34
|
+
const resourceAttrs = {
|
|
35
|
+
[ATTR_SERVICE_NAME]: cfg.service_name ?? 'orgloop',
|
|
36
|
+
...(cfg.service_version ? { [ATTR_SERVICE_VERSION]: cfg.service_version } : {}),
|
|
37
|
+
...(cfg.resource_attributes ?? {}),
|
|
38
|
+
};
|
|
39
|
+
const resource = new Resource(resourceAttrs);
|
|
40
|
+
const exporter = new OTLPLogExporter({
|
|
41
|
+
url: cfg.endpoint ?? 'http://localhost:4318/v1/logs',
|
|
42
|
+
headers: cfg.headers,
|
|
43
|
+
});
|
|
44
|
+
const batchConfig = cfg.batch ?? {};
|
|
45
|
+
const processor = new BatchLogRecordProcessor(exporter, {
|
|
46
|
+
maxQueueSize: batchConfig.max_queue_size ?? 2048,
|
|
47
|
+
scheduledDelayMillis: batchConfig.scheduled_delay_ms ?? 5000,
|
|
48
|
+
maxExportBatchSize: batchConfig.max_export_batch_size ?? 512,
|
|
49
|
+
});
|
|
50
|
+
this.loggerProvider = new LoggerProvider({ resource });
|
|
51
|
+
this.loggerProvider.addLogRecordProcessor(processor);
|
|
52
|
+
this.otelLogger = this.loggerProvider.getLogger('orgloop', '0.1.0');
|
|
53
|
+
}
|
|
54
|
+
async log(entry) {
|
|
55
|
+
try {
|
|
56
|
+
if (!this.otelLogger)
|
|
57
|
+
return;
|
|
58
|
+
const severity = PHASE_SEVERITY[entry.phase] ?? { text: 'INFO', number: 9 };
|
|
59
|
+
const attributes = {
|
|
60
|
+
'orgloop.phase': entry.phase,
|
|
61
|
+
'orgloop.event_id': entry.event_id,
|
|
62
|
+
'orgloop.trace_id': entry.trace_id,
|
|
63
|
+
};
|
|
64
|
+
if (entry.source)
|
|
65
|
+
attributes['orgloop.source'] = entry.source;
|
|
66
|
+
if (entry.target)
|
|
67
|
+
attributes['orgloop.target'] = entry.target;
|
|
68
|
+
if (entry.route)
|
|
69
|
+
attributes['orgloop.route'] = entry.route;
|
|
70
|
+
if (entry.transform)
|
|
71
|
+
attributes['orgloop.transform'] = entry.transform;
|
|
72
|
+
if (entry.event_type)
|
|
73
|
+
attributes['orgloop.event_type'] = entry.event_type;
|
|
74
|
+
if (entry.duration_ms !== undefined)
|
|
75
|
+
attributes['orgloop.duration_ms'] = entry.duration_ms;
|
|
76
|
+
if (entry.error)
|
|
77
|
+
attributes['orgloop.error'] = entry.error;
|
|
78
|
+
if (entry.result)
|
|
79
|
+
attributes['orgloop.result'] = entry.result;
|
|
80
|
+
if (entry.queue_depth !== undefined)
|
|
81
|
+
attributes['orgloop.queue_depth'] = entry.queue_depth;
|
|
82
|
+
if (entry.hostname)
|
|
83
|
+
attributes['orgloop.hostname'] = entry.hostname;
|
|
84
|
+
if (entry.workspace)
|
|
85
|
+
attributes['orgloop.workspace'] = entry.workspace;
|
|
86
|
+
if (entry.orgloop_version)
|
|
87
|
+
attributes['orgloop.version'] = entry.orgloop_version;
|
|
88
|
+
this.otelLogger.emit({
|
|
89
|
+
severityNumber: severity.number,
|
|
90
|
+
severityText: severity.text,
|
|
91
|
+
body: JSON.stringify(entry),
|
|
92
|
+
timestamp: new Date(entry.timestamp),
|
|
93
|
+
attributes,
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
catch {
|
|
97
|
+
// Loggers must not throw
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
async flush() {
|
|
101
|
+
try {
|
|
102
|
+
await this.loggerProvider?.forceFlush();
|
|
103
|
+
}
|
|
104
|
+
catch {
|
|
105
|
+
// Loggers must not throw
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
async shutdown() {
|
|
109
|
+
try {
|
|
110
|
+
await this.loggerProvider?.shutdown();
|
|
111
|
+
}
|
|
112
|
+
catch {
|
|
113
|
+
// Loggers must not throw
|
|
114
|
+
}
|
|
115
|
+
this.loggerProvider = null;
|
|
116
|
+
this.otelLogger = null;
|
|
117
|
+
}
|
|
118
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AAK,CAAC,QAAQ;QACb,IAAI,CAAC;YACJ,MAAM,IAAI,CAAC,cAAc,EAAE,QAAQ,EAAE,CAAC;QACvC,CAAC;QAAC,MAAM,CAAC;YACR,yBAAyB;QAC1B,CAAC;QACD,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC;QAC3B,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC;IACxB,CAAC;CACD;AAED,OAAO,EAAE,cAAc,EAAE,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@orgloop/logger-otel",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "OrgLoop OpenTelemetry logger — OTLP export for production observability",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "dist/index.js",
|
|
7
|
+
"types": "dist/index.d.ts",
|
|
8
|
+
"dependencies": {
|
|
9
|
+
"@opentelemetry/api": "^1.9.0",
|
|
10
|
+
"@opentelemetry/api-logs": "^0.57.0",
|
|
11
|
+
"@opentelemetry/sdk-logs": "^0.57.0",
|
|
12
|
+
"@opentelemetry/exporter-logs-otlp-http": "^0.57.0",
|
|
13
|
+
"@opentelemetry/resources": "^1.30.0",
|
|
14
|
+
"@opentelemetry/semantic-conventions": "^1.28.0",
|
|
15
|
+
"@orgloop/sdk": "0.1.0"
|
|
16
|
+
},
|
|
17
|
+
"orgloop": {
|
|
18
|
+
"type": "logger",
|
|
19
|
+
"id": "otel"
|
|
20
|
+
},
|
|
21
|
+
"files": [
|
|
22
|
+
"dist"
|
|
23
|
+
],
|
|
24
|
+
"publishConfig": {
|
|
25
|
+
"access": "public"
|
|
26
|
+
},
|
|
27
|
+
"license": "MIT",
|
|
28
|
+
"scripts": {
|
|
29
|
+
"build": "tsc",
|
|
30
|
+
"clean": "rm -rf dist",
|
|
31
|
+
"typecheck": "tsc --noEmit",
|
|
32
|
+
"test": "vitest run"
|
|
33
|
+
}
|
|
34
|
+
}
|