@unireq/otel 0.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.
- package/LICENSE +21 -0
- package/dist/index.d.ts +73 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -0
- package/package.json +60 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Olivier Orabona
|
|
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,73 @@
|
|
|
1
|
+
import { Tracer } from '@opentelemetry/api';
|
|
2
|
+
import { RequestContext, Policy } from '@unireq/core';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* OpenTelemetry tracing policy for unireq
|
|
6
|
+
*
|
|
7
|
+
* Creates spans for HTTP requests following OpenTelemetry semantic conventions.
|
|
8
|
+
* Propagates trace context via W3C Trace Context headers.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Function to format span names
|
|
13
|
+
*/
|
|
14
|
+
type SpanNameFormatter = (ctx: RequestContext) => string;
|
|
15
|
+
/**
|
|
16
|
+
* Configuration options for OpenTelemetry tracing
|
|
17
|
+
*/
|
|
18
|
+
interface OtelOptions {
|
|
19
|
+
/**
|
|
20
|
+
* OpenTelemetry tracer instance
|
|
21
|
+
*/
|
|
22
|
+
readonly tracer: Tracer;
|
|
23
|
+
/**
|
|
24
|
+
* Custom span name formatter
|
|
25
|
+
* @default (ctx) => `HTTP ${ctx.method}`
|
|
26
|
+
*/
|
|
27
|
+
readonly spanNameFormatter?: SpanNameFormatter;
|
|
28
|
+
/**
|
|
29
|
+
* Record request body size in span attributes
|
|
30
|
+
* @default false
|
|
31
|
+
*/
|
|
32
|
+
readonly recordRequestBodySize?: boolean;
|
|
33
|
+
/**
|
|
34
|
+
* Record response body size in span attributes
|
|
35
|
+
* @default false
|
|
36
|
+
*/
|
|
37
|
+
readonly recordResponseBodySize?: boolean;
|
|
38
|
+
/**
|
|
39
|
+
* Custom attributes to add to every span
|
|
40
|
+
*/
|
|
41
|
+
readonly customAttributes?: Record<string, string | number | boolean>;
|
|
42
|
+
/**
|
|
43
|
+
* Propagate trace context to downstream services
|
|
44
|
+
* @default true
|
|
45
|
+
*/
|
|
46
|
+
readonly propagateContext?: boolean;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Create an OpenTelemetry tracing policy
|
|
50
|
+
*
|
|
51
|
+
* @example
|
|
52
|
+
* ```typescript
|
|
53
|
+
* import { client } from '@unireq/core';
|
|
54
|
+
* import { http } from '@unireq/http';
|
|
55
|
+
* import { otel } from '@unireq/otel';
|
|
56
|
+
* import { trace } from '@opentelemetry/api';
|
|
57
|
+
*
|
|
58
|
+
* const tracer = trace.getTracer('my-service', '1.0.0');
|
|
59
|
+
*
|
|
60
|
+
* const api = client(
|
|
61
|
+
* http('https://api.example.com'),
|
|
62
|
+
* otel({
|
|
63
|
+
* tracer,
|
|
64
|
+
* spanNameFormatter: (ctx) => `${ctx.method} ${new URL(ctx.url).pathname}`,
|
|
65
|
+
* customAttributes: { 'service.version': '1.0.0' },
|
|
66
|
+
* }),
|
|
67
|
+
* parse.json()
|
|
68
|
+
* );
|
|
69
|
+
* ```
|
|
70
|
+
*/
|
|
71
|
+
declare function otel(options: OtelOptions): Policy;
|
|
72
|
+
|
|
73
|
+
export { type OtelOptions, type SpanNameFormatter, otel };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var g="http.request.method",A="url.full",O="http.response.status_code",C="server.address",b="server.port",R="error.type",x="http.request.body.size",P="http.response.body.size",N=e=>`HTTP ${e.method}`;function q(e){try{let s=new URL(e),a=s.protocol==="https:"?443:80,i=s.port?Number.parseInt(s.port,10):a;return {host:s.hostname,port:i,protocol:s.protocol.replace(":","")}}catch{return {host:"unknown",port:void 0,protocol:"http"}}}function T(e){if(e){if(typeof e=="string")return new TextEncoder().encode(e).length;if(e instanceof ArrayBuffer)return e.byteLength;if(e instanceof Uint8Array)return e.length;if(typeof e=="object")try{return new TextEncoder().encode(JSON.stringify(e)).length}catch{return}}}function w(e){let{tracer:s,spanNameFormatter:a=N,recordRequestBodySize:i=false,recordResponseBodySize:m=false,customAttributes:S={},propagateContext:y=true}=e,n,p,c;return async(o,u)=>{if(!n)try{n=await import('@opentelemetry/api'),p=n.context,c=n.propagation;}catch{return u(o)}let{host:E,port:d}=q(o.url),h=a(o),r=s.startSpan(h,{kind:n.SpanKind.CLIENT,attributes:{[g]:o.method,[A]:o.url,[C]:E,...d!==void 0&&{[b]:d},...S}});if(i&&o.body){let t=T(o.body);t!==void 0&&r.setAttribute(x,t);}let f={...o.headers};if(y&&c&&p){let t=p.active();c.inject(n.trace.setSpan(t,r),f);}let _={...o,headers:f};try{let t=await u(_);if(r.setAttribute(O,t.status),m&&t.data){let l=T(t.data);l!==void 0&&r.setAttribute(P,l);}return t.status>=400?(r.setStatus({code:n.SpanStatusCode.ERROR,message:`HTTP ${t.status} ${t.statusText}`}),r.setAttribute(R,`${t.status}`)):r.setStatus({code:n.SpanStatusCode.OK}),t}catch(t){throw r.setStatus({code:n.SpanStatusCode.ERROR,message:t instanceof Error?t.message:"Unknown error"}),t instanceof Error&&(r.recordException(t),r.setAttribute(R,t.name)),t}finally{r.end();}}}export{w as otel};//# sourceMappingURL=index.js.map
|
|
2
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/tracing.ts"],"names":["ATTR_HTTP_REQUEST_METHOD","ATTR_URL_FULL","ATTR_HTTP_RESPONSE_STATUS_CODE","ATTR_SERVER_ADDRESS","ATTR_SERVER_PORT","ATTR_ERROR_TYPE","ATTR_HTTP_REQUEST_BODY_SIZE","ATTR_HTTP_RESPONSE_BODY_SIZE","defaultSpanNameFormatter","ctx","parseUrl","url","parsed","defaultPort","port","calculateBodySize","body","otel","options","tracer","spanNameFormatter","recordRequestBodySize","recordResponseBodySize","customAttributes","propagateContext","api","contextApi","propagation","next","host","spanName","span","size","headers","activeContext","enrichedCtx","response","error"],"mappings":"AAYA,IAAMA,CAAAA,CAA2B,sBAC3BC,CAAAA,CAAgB,UAAA,CAChBC,EAAiC,2BAAA,CACjCC,CAAAA,CAAsB,iBACtBC,CAAAA,CAAmB,aAAA,CACnBC,EAAkB,YAAA,CAClBC,CAAAA,CAA8B,yBAC9BC,CAAAA,CAA+B,yBAAA,CAiD/BC,EAA+CC,CAAAA,EAAQ,CAAA,KAAA,EAAQA,CAAAA,CAAI,MAAM,CAAA,CAAA,CAK/E,SAASC,EAASC,CAAAA,CAA2E,CAC3F,GAAI,CACF,IAA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,EACH,OAAA,CAAAwB,CACF,EAEA,GAAI,CACF,IAAMG,CAAAA,CAAW,MAAMR,CAAAA,CAAKO,CAAW,CAAA,CAMvC,GAHAJ,EAAK,YAAA,CAAa7B,CAAAA,CAAgCkC,EAAS,MAAM,CAAA,CAG7Dd,GAA0Bc,CAAAA,CAAS,IAAA,CAAM,CAC3C,IAAMJ,CAAAA,CAAOjB,EAAkBqB,CAAAA,CAAS,IAAI,EACxCJ,CAAAA,GAAS,KAAA,CAAA,EACXD,EAAK,YAAA,CAAaxB,CAAAA,CAA8ByB,CAAI,EAExD,CAGA,OAAII,EAAS,MAAA,EAAU,GAAA,EACrBL,EAAK,SAAA,CAAU,CACb,KAAMN,CAAAA,CAAI,cAAA,CAAe,KAAA,CACzB,OAAA,CAAS,CAAA,KAAA,EAAQW,CAAAA,CAAS,MAAM,CAAA,CAAA,EAAIA,CAAAA,CAAS,UAAU,CAAA,CACzD,CAAC,EACDL,CAAAA,CAAK,YAAA,CAAa1B,CAAAA,CAAiB,CAAA,EAAG+B,CAAAA,CAAS,MAAM,EAAE,CAAA,EAEvDL,CAAAA,CAAK,UAAU,CAAE,IAAA,CAAMN,EAAI,cAAA,CAAe,EAAG,CAAC,CAAA,CAGzCW,CACT,CAAA,MAASC,EAAO,CAEd,MAAAN,EAAK,SAAA,CAAU,CACb,KAAMN,CAAAA,CAAI,cAAA,CAAe,KAAA,CACzB,OAAA,CAASY,CAAAA,YAAiB,KAAA,CAAQA,EAAM,OAAA,CAAU,eACpD,CAAC,CAAA,CAEGA,CAAAA,YAAiB,QACnBN,CAAAA,CAAK,eAAA,CAAgBM,CAAK,CAAA,CAC1BN,CAAAA,CAAK,YAAA,CAAa1B,EAAiBgC,CAAAA,CAAM,IAAI,GAGzCA,CACR,CAAA,OAAE,CACAN,CAAAA,CAAK,GAAA,GACP,CACF,CACF","file":"index.js","sourcesContent":["/**\n * OpenTelemetry tracing policy for unireq\n *\n * Creates spans for HTTP requests following OpenTelemetry semantic conventions.\n * Propagates trace context via W3C Trace Context headers.\n */\n\nimport type { Context, Tracer } from '@opentelemetry/api';\nimport type { Policy, RequestContext, Response } from '@unireq/core';\n\n// Use stable semantic convention attribute names (as of 1.28.0)\n// These are the stable HTTP client span attribute names per OpenTelemetry spec\nconst ATTR_HTTP_REQUEST_METHOD = 'http.request.method';\nconst ATTR_URL_FULL = 'url.full';\nconst ATTR_HTTP_RESPONSE_STATUS_CODE = 'http.response.status_code';\nconst ATTR_SERVER_ADDRESS = 'server.address';\nconst ATTR_SERVER_PORT = 'server.port';\nconst ATTR_ERROR_TYPE = 'error.type';\nconst ATTR_HTTP_REQUEST_BODY_SIZE = 'http.request.body.size';\nconst ATTR_HTTP_RESPONSE_BODY_SIZE = 'http.response.body.size';\n\n/**\n * Function to format span names\n */\nexport type SpanNameFormatter = (ctx: RequestContext) => string;\n\n/**\n * Configuration options for OpenTelemetry tracing\n */\nexport interface OtelOptions {\n /**\n * OpenTelemetry tracer instance\n */\n readonly tracer: Tracer;\n\n /**\n * Custom span name formatter\n * @default (ctx) => `HTTP ${ctx.method}`\n */\n readonly spanNameFormatter?: SpanNameFormatter;\n\n /**\n * Record request body size in span attributes\n * @default false\n */\n readonly recordRequestBodySize?: boolean;\n\n /**\n * Record response body size in span attributes\n * @default false\n */\n readonly recordResponseBodySize?: boolean;\n\n /**\n * Custom attributes to add to every span\n */\n readonly customAttributes?: Record<string, string | number | boolean>;\n\n /**\n * Propagate trace context to downstream services\n * @default true\n */\n readonly propagateContext?: boolean;\n}\n\n/**\n * Default span name formatter\n */\nconst defaultSpanNameFormatter: SpanNameFormatter = (ctx) => `HTTP ${ctx.method}`;\n\n/**\n * Parse URL to extract host and port\n */\nfunction parseUrl(url: string): { host: string; port: number | undefined; protocol: string } {\n try {\n const parsed = new URL(url);\n const defaultPort = parsed.protocol === 'https:' ? 443 : 80;\n const port = parsed.port ? Number.parseInt(parsed.port, 10) : defaultPort;\n return {\n host: parsed.hostname,\n port,\n protocol: parsed.protocol.replace(':', ''),\n };\n } catch {\n return { host: 'unknown', port: undefined, protocol: 'http' };\n }\n}\n\n/**\n * Calculate body size for various body types\n */\nfunction calculateBodySize(body: unknown): number | undefined {\n if (!body) return undefined;\n\n if (typeof body === 'string') {\n return new TextEncoder().encode(body).length;\n }\n\n if (body instanceof ArrayBuffer) {\n return body.byteLength;\n }\n\n if (body instanceof Uint8Array) {\n return body.length;\n }\n\n if (typeof body === 'object') {\n try {\n return new TextEncoder().encode(JSON.stringify(body)).length;\n } catch {\n return undefined;\n }\n }\n\n return undefined;\n}\n\n/**\n * Create an OpenTelemetry tracing policy\n *\n * @example\n * ```typescript\n * import { client } from '@unireq/core';\n * import { http } from '@unireq/http';\n * import { otel } from '@unireq/otel';\n * import { trace } from '@opentelemetry/api';\n *\n * const tracer = trace.getTracer('my-service', '1.0.0');\n *\n * const api = client(\n * http('https://api.example.com'),\n * otel({\n * tracer,\n * spanNameFormatter: (ctx) => `${ctx.method} ${new URL(ctx.url).pathname}`,\n * customAttributes: { 'service.version': '1.0.0' },\n * }),\n * parse.json()\n * );\n * ```\n */\nexport function otel(options: OtelOptions): Policy {\n const {\n tracer,\n spanNameFormatter = defaultSpanNameFormatter,\n recordRequestBodySize = false,\n recordResponseBodySize = false,\n customAttributes = {},\n propagateContext = true,\n } = options;\n\n // Lazy import to avoid issues when OpenTelemetry is not available\n let api: typeof import('@opentelemetry/api') | undefined;\n let contextApi: { active: () => Context } | undefined;\n let propagation: { inject: (context: Context, carrier: Record<string, string>) => void } | undefined;\n\n return async (ctx: RequestContext, next): Promise<Response> => {\n // Lazy load OpenTelemetry API\n if (!api) {\n try {\n api = await import('@opentelemetry/api');\n contextApi = api.context;\n propagation = api.propagation;\n } catch {\n /* c8 ignore next 2 */ // Fallback when @opentelemetry/api is not installed\n return next(ctx);\n }\n }\n\n const { host, port } = parseUrl(ctx.url);\n const spanName = spanNameFormatter(ctx);\n\n // Create span with HTTP client kind\n const span = tracer.startSpan(spanName, {\n kind: api.SpanKind.CLIENT,\n attributes: {\n [ATTR_HTTP_REQUEST_METHOD]: ctx.method,\n [ATTR_URL_FULL]: ctx.url,\n [ATTR_SERVER_ADDRESS]: host,\n ...(port !== undefined && { [ATTR_SERVER_PORT]: port }),\n ...customAttributes,\n },\n });\n\n // Record request body size if enabled\n if (recordRequestBodySize && ctx.body) {\n const size = calculateBodySize(ctx.body);\n if (size !== undefined) {\n span.setAttribute(ATTR_HTTP_REQUEST_BODY_SIZE, size);\n }\n }\n\n // Inject trace context into request headers\n const headers = { ...ctx.headers };\n if (propagateContext && propagation && contextApi) {\n const activeContext = contextApi.active();\n propagation.inject(api.trace.setSpan(activeContext, span), headers);\n }\n\n const enrichedCtx: RequestContext = {\n ...ctx,\n headers,\n };\n\n try {\n const response = await next(enrichedCtx);\n\n // Record response attributes\n span.setAttribute(ATTR_HTTP_RESPONSE_STATUS_CODE, response.status);\n\n // Record response body size if enabled\n if (recordResponseBodySize && response.data) {\n const size = calculateBodySize(response.data);\n if (size !== undefined) {\n span.setAttribute(ATTR_HTTP_RESPONSE_BODY_SIZE, size);\n }\n }\n\n // Set span status based on response\n if (response.status >= 400) {\n span.setStatus({\n code: api.SpanStatusCode.ERROR,\n message: `HTTP ${response.status} ${response.statusText}`,\n });\n span.setAttribute(ATTR_ERROR_TYPE, `${response.status}`);\n } else {\n span.setStatus({ code: api.SpanStatusCode.OK });\n }\n\n return response;\n } catch (error) {\n // Record error\n span.setStatus({\n code: api.SpanStatusCode.ERROR,\n message: error instanceof Error ? error.message : 'Unknown error',\n });\n\n if (error instanceof Error) {\n span.recordException(error);\n span.setAttribute(ATTR_ERROR_TYPE, error.name);\n }\n\n throw error;\n } finally {\n span.end();\n }\n };\n}\n"]}
|
package/package.json
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@unireq/otel",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"description": "OpenTelemetry instrumentation for unireq HTTP clients",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/index.js",
|
|
7
|
+
"module": "./dist/index.js",
|
|
8
|
+
"types": "./dist/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"types": "./dist/index.d.ts",
|
|
12
|
+
"import": "./dist/index.js"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"files": [
|
|
16
|
+
"dist"
|
|
17
|
+
],
|
|
18
|
+
"keywords": [
|
|
19
|
+
"opentelemetry",
|
|
20
|
+
"otel",
|
|
21
|
+
"tracing",
|
|
22
|
+
"observability",
|
|
23
|
+
"instrumentation"
|
|
24
|
+
],
|
|
25
|
+
"author": "Olivier Orabona",
|
|
26
|
+
"license": "MIT",
|
|
27
|
+
"dependencies": {
|
|
28
|
+
"@unireq/core": "0.0.1"
|
|
29
|
+
},
|
|
30
|
+
"peerDependencies": {
|
|
31
|
+
"@opentelemetry/api": "^1.9.0",
|
|
32
|
+
"@opentelemetry/semantic-conventions": "^1.28.0"
|
|
33
|
+
},
|
|
34
|
+
"devDependencies": {
|
|
35
|
+
"@opentelemetry/api": "^1.9.0",
|
|
36
|
+
"@opentelemetry/semantic-conventions": "^1.28.0",
|
|
37
|
+
"typescript": "^5.9.3",
|
|
38
|
+
"tsup": "^8.5.1",
|
|
39
|
+
"vitest": "^4.0.16"
|
|
40
|
+
},
|
|
41
|
+
"engines": {
|
|
42
|
+
"node": ">=18.0.0"
|
|
43
|
+
},
|
|
44
|
+
"repository": {
|
|
45
|
+
"type": "git",
|
|
46
|
+
"url": "https://github.com/oorabona/unireq",
|
|
47
|
+
"directory": "packages/otel"
|
|
48
|
+
},
|
|
49
|
+
"bugs": {
|
|
50
|
+
"url": "https://github.com/oorabona/unireq/issues"
|
|
51
|
+
},
|
|
52
|
+
"homepage": "https://github.com/oorabona/unireq/tree/main/packages/otel",
|
|
53
|
+
"scripts": {
|
|
54
|
+
"build": "tsup",
|
|
55
|
+
"type-check": "tsc --noEmit",
|
|
56
|
+
"test": "vitest run",
|
|
57
|
+
"test:watch": "vitest",
|
|
58
|
+
"clean": "rm -rf dist *.tsbuildinfo"
|
|
59
|
+
}
|
|
60
|
+
}
|