@forinda/kickjs-otel 0.5.2
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 +21 -0
- package/dist/index.d.ts +66 -0
- package/dist/index.js +135 -0
- package/dist/index.js.map +1 -0
- package/package.json +90 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Felix Orinda
|
|
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,66 @@
|
|
|
1
|
+
import { AppAdapter, Container, AdapterMiddleware } from '@forinda/kickjs-core';
|
|
2
|
+
|
|
3
|
+
interface OtelAdapterOptions {
|
|
4
|
+
/** Service name reported to the OTel backend (default: 'kickjs-app') */
|
|
5
|
+
serviceName?: string;
|
|
6
|
+
/** Service version (default: '0.0.0') */
|
|
7
|
+
serviceVersion?: string;
|
|
8
|
+
/** Enable HTTP request tracing (default: true) */
|
|
9
|
+
tracing?: boolean;
|
|
10
|
+
/** Enable request metrics — counter, histogram (default: true) */
|
|
11
|
+
metrics?: boolean;
|
|
12
|
+
/**
|
|
13
|
+
* Custom span attributes added to every request span.
|
|
14
|
+
* Receives the Express request object.
|
|
15
|
+
*/
|
|
16
|
+
customAttributes?: (req: any) => Record<string, string | number | boolean>;
|
|
17
|
+
/**
|
|
18
|
+
* Routes to ignore from tracing (e.g., health checks).
|
|
19
|
+
* Supports exact match or prefix match with trailing *.
|
|
20
|
+
* @example ['/health', '/_debug/*', '/favicon.ico']
|
|
21
|
+
*/
|
|
22
|
+
ignoreRoutes?: string[];
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* OpenTelemetry adapter for KickJS — automatic tracing and metrics.
|
|
27
|
+
*
|
|
28
|
+
* Creates spans for each HTTP request with route, method, status code,
|
|
29
|
+
* and duration. Optionally records request count and latency histograms.
|
|
30
|
+
*
|
|
31
|
+
* Works with any OTel-compatible backend: Jaeger, Grafana Tempo, Datadog,
|
|
32
|
+
* Honeycomb, etc. Configure exporters via the OTel SDK before bootstrapping.
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* ```ts
|
|
36
|
+
* import { OtelAdapter } from '@forinda/kickjs-otel'
|
|
37
|
+
*
|
|
38
|
+
* // Set up OTel SDK (e.g., with Jaeger exporter) before bootstrap
|
|
39
|
+
* bootstrap({
|
|
40
|
+
* modules,
|
|
41
|
+
* adapters: [
|
|
42
|
+
* new OtelAdapter({
|
|
43
|
+
* serviceName: 'my-api',
|
|
44
|
+
* serviceVersion: '1.0.0',
|
|
45
|
+
* ignoreRoutes: ['/health', '/_debug/*'],
|
|
46
|
+
* }),
|
|
47
|
+
* ],
|
|
48
|
+
* })
|
|
49
|
+
* ```
|
|
50
|
+
*/
|
|
51
|
+
declare class OtelAdapter implements AppAdapter {
|
|
52
|
+
name: string;
|
|
53
|
+
private options;
|
|
54
|
+
private tracer;
|
|
55
|
+
private meter;
|
|
56
|
+
private requestCounter;
|
|
57
|
+
private requestDuration;
|
|
58
|
+
constructor(options?: OtelAdapterOptions);
|
|
59
|
+
beforeStart(_app: any, _container: Container): void;
|
|
60
|
+
middleware(): AdapterMiddleware[];
|
|
61
|
+
private onFinish;
|
|
62
|
+
private shouldIgnore;
|
|
63
|
+
shutdown(): Promise<void>;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export { OtelAdapter, type OtelAdapterOptions };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
|
+
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
4
|
+
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
5
|
+
}) : x)(function(x) {
|
|
6
|
+
if (typeof require !== "undefined") return require.apply(this, arguments);
|
|
7
|
+
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
// src/otel.adapter.ts
|
|
11
|
+
import { Logger } from "@forinda/kickjs-core";
|
|
12
|
+
var log = Logger.for("OtelAdapter");
|
|
13
|
+
var OtelAdapter = class {
|
|
14
|
+
static {
|
|
15
|
+
__name(this, "OtelAdapter");
|
|
16
|
+
}
|
|
17
|
+
name = "OtelAdapter";
|
|
18
|
+
options;
|
|
19
|
+
tracer = null;
|
|
20
|
+
meter = null;
|
|
21
|
+
requestCounter = null;
|
|
22
|
+
requestDuration = null;
|
|
23
|
+
constructor(options = {}) {
|
|
24
|
+
this.options = {
|
|
25
|
+
serviceName: options.serviceName ?? "kickjs-app",
|
|
26
|
+
serviceVersion: options.serviceVersion ?? "0.0.0",
|
|
27
|
+
tracing: options.tracing ?? true,
|
|
28
|
+
metrics: options.metrics ?? true,
|
|
29
|
+
...options
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
beforeStart(_app, _container) {
|
|
33
|
+
try {
|
|
34
|
+
const otelApi = __require("@opentelemetry/api");
|
|
35
|
+
if (this.options.tracing) {
|
|
36
|
+
this.tracer = otelApi.trace.getTracer(this.options.serviceName, this.options.serviceVersion);
|
|
37
|
+
log.info(`Tracing enabled for ${this.options.serviceName}`);
|
|
38
|
+
}
|
|
39
|
+
if (this.options.metrics) {
|
|
40
|
+
this.meter = otelApi.metrics.getMeter(this.options.serviceName, this.options.serviceVersion);
|
|
41
|
+
this.requestCounter = this.meter.createCounter("http.server.request.count", {
|
|
42
|
+
description: "Total number of HTTP requests"
|
|
43
|
+
});
|
|
44
|
+
this.requestDuration = this.meter.createHistogram("http.server.request.duration", {
|
|
45
|
+
description: "HTTP request duration in milliseconds",
|
|
46
|
+
unit: "ms"
|
|
47
|
+
});
|
|
48
|
+
log.info("Metrics enabled \u2014 http.server.request.count, http.server.request.duration");
|
|
49
|
+
}
|
|
50
|
+
} catch {
|
|
51
|
+
log.warn("OpenTelemetry API not found. Install @opentelemetry/api to enable tracing and metrics.");
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
middleware() {
|
|
55
|
+
return [
|
|
56
|
+
{
|
|
57
|
+
handler: /* @__PURE__ */ __name((req, res, next) => {
|
|
58
|
+
if (this.shouldIgnore(req.path)) {
|
|
59
|
+
return next();
|
|
60
|
+
}
|
|
61
|
+
const startTime = performance.now();
|
|
62
|
+
let span = null;
|
|
63
|
+
if (this.tracer) {
|
|
64
|
+
const otelApi = __require("@opentelemetry/api");
|
|
65
|
+
span = this.tracer.startSpan(`${req.method} ${req.route?.path ?? req.path}`, {
|
|
66
|
+
attributes: {
|
|
67
|
+
"http.method": req.method,
|
|
68
|
+
"http.url": req.originalUrl,
|
|
69
|
+
"http.target": req.path,
|
|
70
|
+
"http.user_agent": req.get("user-agent") ?? "",
|
|
71
|
+
"net.host.name": req.hostname,
|
|
72
|
+
...this.options.customAttributes?.(req) ?? {}
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
const ctx = otelApi.trace.setSpan(otelApi.context.active(), span);
|
|
76
|
+
otelApi.context.with(ctx, () => {
|
|
77
|
+
this.onFinish(req, res, startTime, span);
|
|
78
|
+
next();
|
|
79
|
+
});
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
this.onFinish(req, res, startTime, null);
|
|
83
|
+
next();
|
|
84
|
+
}, "handler"),
|
|
85
|
+
phase: "beforeGlobal"
|
|
86
|
+
}
|
|
87
|
+
];
|
|
88
|
+
}
|
|
89
|
+
onFinish(req, res, startTime, span) {
|
|
90
|
+
res.on("finish", () => {
|
|
91
|
+
const duration = performance.now() - startTime;
|
|
92
|
+
const route = req.route?.path ?? req.path;
|
|
93
|
+
const attributes = {
|
|
94
|
+
"http.method": req.method,
|
|
95
|
+
"http.route": route,
|
|
96
|
+
"http.status_code": res.statusCode
|
|
97
|
+
};
|
|
98
|
+
if (span) {
|
|
99
|
+
span.setAttributes({
|
|
100
|
+
"http.status_code": res.statusCode,
|
|
101
|
+
"http.route": route
|
|
102
|
+
});
|
|
103
|
+
if (res.statusCode >= 400) {
|
|
104
|
+
span.setStatus({
|
|
105
|
+
code: 2,
|
|
106
|
+
message: `HTTP ${res.statusCode}`
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
span.end();
|
|
110
|
+
}
|
|
111
|
+
if (this.requestCounter) {
|
|
112
|
+
this.requestCounter.add(1, attributes);
|
|
113
|
+
}
|
|
114
|
+
if (this.requestDuration) {
|
|
115
|
+
this.requestDuration.record(duration, attributes);
|
|
116
|
+
}
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
shouldIgnore(path) {
|
|
120
|
+
if (!this.options.ignoreRoutes) return false;
|
|
121
|
+
return this.options.ignoreRoutes.some((pattern) => {
|
|
122
|
+
if (pattern.endsWith("*")) {
|
|
123
|
+
return path.startsWith(pattern.slice(0, -1));
|
|
124
|
+
}
|
|
125
|
+
return path === pattern;
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
async shutdown() {
|
|
129
|
+
log.info("OTel adapter shutdown");
|
|
130
|
+
}
|
|
131
|
+
};
|
|
132
|
+
export {
|
|
133
|
+
OtelAdapter
|
|
134
|
+
};
|
|
135
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/otel.adapter.ts"],"sourcesContent":["import {\n Logger,\n type AppAdapter,\n type AdapterMiddleware,\n type Container,\n} from '@forinda/kickjs-core'\nimport type { Request, Response, NextFunction } from 'express'\nimport type { OtelAdapterOptions } from './types'\n\nconst log = Logger.for('OtelAdapter')\n\n/**\n * OpenTelemetry adapter for KickJS — automatic tracing and metrics.\n *\n * Creates spans for each HTTP request with route, method, status code,\n * and duration. Optionally records request count and latency histograms.\n *\n * Works with any OTel-compatible backend: Jaeger, Grafana Tempo, Datadog,\n * Honeycomb, etc. Configure exporters via the OTel SDK before bootstrapping.\n *\n * @example\n * ```ts\n * import { OtelAdapter } from '@forinda/kickjs-otel'\n *\n * // Set up OTel SDK (e.g., with Jaeger exporter) before bootstrap\n * bootstrap({\n * modules,\n * adapters: [\n * new OtelAdapter({\n * serviceName: 'my-api',\n * serviceVersion: '1.0.0',\n * ignoreRoutes: ['/health', '/_debug/*'],\n * }),\n * ],\n * })\n * ```\n */\nexport class OtelAdapter implements AppAdapter {\n name = 'OtelAdapter'\n private options: Required<\n Pick<OtelAdapterOptions, 'serviceName' | 'serviceVersion' | 'tracing' | 'metrics'>\n > &\n OtelAdapterOptions\n private tracer: any = null\n private meter: any = null\n private requestCounter: any = null\n private requestDuration: any = null\n\n constructor(options: OtelAdapterOptions = {}) {\n this.options = {\n serviceName: options.serviceName ?? 'kickjs-app',\n serviceVersion: options.serviceVersion ?? '0.0.0',\n tracing: options.tracing ?? true,\n metrics: options.metrics ?? true,\n ...options,\n }\n }\n\n beforeStart(_app: any, _container: Container): void {\n try {\n // Dynamically import OTel API — it's a peer dependency\n const otelApi = require('@opentelemetry/api')\n\n if (this.options.tracing) {\n this.tracer = otelApi.trace.getTracer(this.options.serviceName, this.options.serviceVersion)\n log.info(`Tracing enabled for ${this.options.serviceName}`)\n }\n\n if (this.options.metrics) {\n this.meter = otelApi.metrics.getMeter(this.options.serviceName, this.options.serviceVersion)\n\n this.requestCounter = this.meter.createCounter('http.server.request.count', {\n description: 'Total number of HTTP requests',\n })\n\n this.requestDuration = this.meter.createHistogram('http.server.request.duration', {\n description: 'HTTP request duration in milliseconds',\n unit: 'ms',\n })\n\n log.info('Metrics enabled — http.server.request.count, http.server.request.duration')\n }\n } catch {\n log.warn(\n 'OpenTelemetry API not found. Install @opentelemetry/api to enable tracing and metrics.',\n )\n }\n }\n\n middleware(): AdapterMiddleware[] {\n return [\n {\n handler: (req: Request, res: Response, next: NextFunction) => {\n // Skip ignored routes\n if (this.shouldIgnore(req.path)) {\n return next()\n }\n\n const startTime = performance.now()\n\n // Start a span if tracing is enabled\n let span: any = null\n if (this.tracer) {\n const otelApi = require('@opentelemetry/api')\n span = this.tracer.startSpan(`${req.method} ${req.route?.path ?? req.path}`, {\n attributes: {\n 'http.method': req.method,\n 'http.url': req.originalUrl,\n 'http.target': req.path,\n 'http.user_agent': req.get('user-agent') ?? '',\n 'net.host.name': req.hostname,\n ...(this.options.customAttributes?.(req) ?? {}),\n },\n })\n\n // Set span on context so downstream code can add attributes\n const ctx = otelApi.trace.setSpan(otelApi.context.active(), span)\n otelApi.context.with(ctx, () => {\n this.onFinish(req, res, startTime, span)\n next()\n })\n return\n }\n\n this.onFinish(req, res, startTime, null)\n next()\n },\n phase: 'beforeGlobal',\n },\n ]\n }\n\n private onFinish(req: Request, res: Response, startTime: number, span: any): void {\n res.on('finish', () => {\n const duration = performance.now() - startTime\n const route = (req as any).route?.path ?? req.path\n const attributes = {\n 'http.method': req.method,\n 'http.route': route,\n 'http.status_code': res.statusCode,\n }\n\n // End span\n if (span) {\n span.setAttributes({\n 'http.status_code': res.statusCode,\n 'http.route': route,\n })\n if (res.statusCode >= 400) {\n span.setStatus({ code: 2, message: `HTTP ${res.statusCode}` })\n }\n span.end()\n }\n\n // Record metrics\n if (this.requestCounter) {\n this.requestCounter.add(1, attributes)\n }\n if (this.requestDuration) {\n this.requestDuration.record(duration, attributes)\n }\n })\n }\n\n private shouldIgnore(path: string): boolean {\n if (!this.options.ignoreRoutes) return false\n return this.options.ignoreRoutes.some((pattern) => {\n if (pattern.endsWith('*')) {\n return path.startsWith(pattern.slice(0, -1))\n }\n return path === pattern\n })\n }\n\n async shutdown(): Promise<void> {\n log.info('OTel adapter shutdown')\n }\n}\n"],"mappings":"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","names":["Logger","log","Logger","for","OtelAdapter","name","options","tracer","meter","requestCounter","requestDuration","serviceName","serviceVersion","tracing","metrics","beforeStart","_app","_container","otelApi","require","trace","getTracer","info","getMeter","createCounter","description","createHistogram","unit","warn","middleware","handler","req","res","next","shouldIgnore","path","startTime","performance","now","span","startSpan","method","route","attributes","originalUrl","get","hostname","customAttributes","ctx","setSpan","context","active","with","onFinish","phase","on","duration","statusCode","setAttributes","setStatus","code","message","end","add","record","ignoreRoutes","some","pattern","endsWith","startsWith","slice","shutdown"]}
|
package/package.json
ADDED
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@forinda/kickjs-otel",
|
|
3
|
+
"version": "0.5.2",
|
|
4
|
+
"description": "OpenTelemetry adapter for KickJS — automatic tracing, metrics, and export to any OTel backend",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"kickjs",
|
|
7
|
+
"nodejs",
|
|
8
|
+
"typescript",
|
|
9
|
+
"opentelemetry",
|
|
10
|
+
"otel",
|
|
11
|
+
"tracing",
|
|
12
|
+
"metrics",
|
|
13
|
+
"observability",
|
|
14
|
+
"jaeger",
|
|
15
|
+
"grafana",
|
|
16
|
+
"datadog",
|
|
17
|
+
"backend",
|
|
18
|
+
"framework",
|
|
19
|
+
"@forinda/kickjs-core",
|
|
20
|
+
"@forinda/kickjs-http"
|
|
21
|
+
],
|
|
22
|
+
"type": "module",
|
|
23
|
+
"main": "dist/index.js",
|
|
24
|
+
"types": "dist/index.d.ts",
|
|
25
|
+
"exports": {
|
|
26
|
+
".": {
|
|
27
|
+
"import": "./dist/index.js",
|
|
28
|
+
"types": "./dist/index.d.ts"
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
"files": [
|
|
32
|
+
"dist"
|
|
33
|
+
],
|
|
34
|
+
"dependencies": {
|
|
35
|
+
"reflect-metadata": "^0.2.2",
|
|
36
|
+
"@forinda/kickjs-core": "0.6.0",
|
|
37
|
+
"@forinda/kickjs-http": "0.6.0"
|
|
38
|
+
},
|
|
39
|
+
"peerDependencies": {
|
|
40
|
+
"@opentelemetry/api": ">=1.4.0",
|
|
41
|
+
"@opentelemetry/sdk-node": ">=0.50.0",
|
|
42
|
+
"@opentelemetry/sdk-trace-base": ">=1.20.0",
|
|
43
|
+
"@opentelemetry/sdk-metrics": ">=1.20.0",
|
|
44
|
+
"@opentelemetry/semantic-conventions": ">=1.20.0"
|
|
45
|
+
},
|
|
46
|
+
"peerDependenciesMeta": {
|
|
47
|
+
"@opentelemetry/sdk-node": {
|
|
48
|
+
"optional": true
|
|
49
|
+
},
|
|
50
|
+
"@opentelemetry/sdk-trace-base": {
|
|
51
|
+
"optional": true
|
|
52
|
+
},
|
|
53
|
+
"@opentelemetry/sdk-metrics": {
|
|
54
|
+
"optional": true
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
"devDependencies": {
|
|
58
|
+
"@opentelemetry/api": "^1.9.0",
|
|
59
|
+
"@opentelemetry/sdk-trace-base": "^1.30.1",
|
|
60
|
+
"@opentelemetry/sdk-metrics": "^1.30.1",
|
|
61
|
+
"@opentelemetry/semantic-conventions": "^1.28.0",
|
|
62
|
+
"@types/node": "^24.5.2",
|
|
63
|
+
"tsup": "^8.5.0",
|
|
64
|
+
"typescript": "^5.9.2"
|
|
65
|
+
},
|
|
66
|
+
"publishConfig": {
|
|
67
|
+
"access": "public"
|
|
68
|
+
},
|
|
69
|
+
"license": "MIT",
|
|
70
|
+
"author": "Felix Orinda",
|
|
71
|
+
"engines": {
|
|
72
|
+
"node": ">=20.0"
|
|
73
|
+
},
|
|
74
|
+
"homepage": "https://forinda.github.io/kick-js/",
|
|
75
|
+
"repository": {
|
|
76
|
+
"type": "git",
|
|
77
|
+
"url": "https://github.com/forinda/kick-js.git",
|
|
78
|
+
"directory": "packages/otel"
|
|
79
|
+
},
|
|
80
|
+
"bugs": {
|
|
81
|
+
"url": "https://github.com/forinda/kick-js/issues"
|
|
82
|
+
},
|
|
83
|
+
"scripts": {
|
|
84
|
+
"build": "tsup",
|
|
85
|
+
"dev": "tsup --watch",
|
|
86
|
+
"typecheck": "tsc --noEmit",
|
|
87
|
+
"clean": "rm -rf dist .turbo",
|
|
88
|
+
"lint": "tsc --noEmit"
|
|
89
|
+
}
|
|
90
|
+
}
|