@geekmidas/telescope 9.0.2 → 10.0.0-alpha.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 +14 -4
- package/dist/{http-D5kn3_Mt.d.mts → http-DULM1u2L.d.cts} +3 -3
- package/dist/{http-Dvca6fC3.d.cts.map → http-DULM1u2L.d.cts.map} +1 -1
- package/dist/{http-Dvca6fC3.d.cts → http-GB-Nlvwc.d.mts} +3 -3
- package/dist/{http-D5kn3_Mt.d.mts.map → http-GB-Nlvwc.d.mts.map} +1 -1
- package/dist/instrumentation/http.d.cts +1 -1
- package/dist/instrumentation/http.d.mts +1 -1
- package/dist/instrumentation/index.cjs +2 -2
- package/dist/instrumentation/index.d.cts +3 -3
- package/dist/instrumentation/index.d.mts +3 -3
- package/dist/instrumentation/index.mjs +2 -2
- package/dist/instrumentation/middleware.cjs +1 -1
- package/dist/instrumentation/middleware.d.cts +1 -1
- package/dist/instrumentation/middleware.d.mts +1 -1
- package/dist/instrumentation/middleware.mjs +1 -1
- package/dist/instrumentation/otel.cjs +1 -1
- package/dist/instrumentation/otel.d.cts +1 -1
- package/dist/instrumentation/otel.d.mts +1 -1
- package/dist/instrumentation/otel.mjs +1 -1
- package/dist/logger/console.d.cts.map +1 -1
- package/dist/logger/console.d.mts.map +1 -1
- package/dist/logger/pino.d.cts +2 -2
- package/dist/{middleware-DqPQpcup.cjs → middleware-Bcq6XXGG.cjs} +2 -2
- package/dist/middleware-Bcq6XXGG.cjs.map +1 -0
- package/dist/{middleware-4-GrQlOT.mjs → middleware-D1XEHvyy.mjs} +2 -2
- package/dist/middleware-D1XEHvyy.mjs.map +1 -0
- package/dist/{middleware-CA84nsNN.d.cts → middleware-PeyS-9Ny.d.cts} +2 -2
- package/dist/{middleware-CA84nsNN.d.cts.map → middleware-PeyS-9Ny.d.cts.map} +1 -1
- package/dist/{middleware-DAceVpfw.d.mts → middleware-oHvo_ZgU.d.mts} +2 -2
- package/dist/{middleware-DAceVpfw.d.mts.map → middleware-oHvo_ZgU.d.mts.map} +1 -1
- package/dist/{otel-40udNP5g.mjs → otel-B9bNoeZ2.mjs} +3 -3
- package/dist/otel-B9bNoeZ2.mjs.map +1 -0
- package/dist/{otel-1bJPb2Z7.d.mts → otel-Bk89b1lX.d.cts} +3 -3
- package/dist/{otel-1bJPb2Z7.d.mts.map → otel-Bk89b1lX.d.cts.map} +1 -1
- package/dist/{otel-COrpz_GZ.cjs → otel-BzjOtVxZ.cjs} +3 -3
- package/dist/otel-BzjOtVxZ.cjs.map +1 -0
- package/dist/{otel-SBVoVEHr.d.cts → otel-lPMsM26e.d.mts} +3 -3
- package/dist/{otel-SBVoVEHr.d.cts.map → otel-lPMsM26e.d.mts.map} +1 -1
- package/dist/storage/kysely.cjs +48 -38
- package/dist/storage/kysely.cjs.map +1 -1
- package/dist/storage/kysely.d.cts +29 -9
- package/dist/storage/kysely.d.cts.map +1 -1
- package/dist/storage/kysely.d.mts +29 -9
- package/dist/storage/kysely.d.mts.map +1 -1
- package/dist/storage/kysely.mjs +48 -38
- package/dist/storage/kysely.mjs.map +1 -1
- package/dist/tracing-BX8uY2nR.d.cts.map +1 -1
- package/dist/types-B1EIa_cQ.d.mts.map +1 -1
- package/dist/types-l7Rlb5Mg.d.cts.map +1 -1
- package/package.json +6 -3
- package/CHANGELOG.md +0 -72
- package/dist/middleware-4-GrQlOT.mjs.map +0 -1
- package/dist/middleware-DqPQpcup.cjs.map +0 -1
- package/dist/otel-40udNP5g.mjs.map +0 -1
- package/dist/otel-COrpz_GZ.cjs.map +0 -1
- package/src/Telescope.ts +0 -561
- package/src/__tests__/Telescope.spec.ts +0 -438
- package/src/__tests__/pino-transport.spec.ts +0 -115
- package/src/__tests__/redact.spec.ts +0 -336
- package/src/adapters/__tests__/lambda.spec.ts +0 -318
- package/src/adapters/__tests__/middy.spec.ts +0 -741
- package/src/adapters/index.ts +0 -22
- package/src/adapters/lambda.ts +0 -432
- package/src/adapters/middy.ts +0 -402
- package/src/adapters/types.ts +0 -181
- package/src/core.ts +0 -51
- package/src/index.ts +0 -34
- package/src/instrumentation/__tests__/core.spec.ts +0 -248
- package/src/instrumentation/__tests__/hono.spec.ts +0 -348
- package/src/instrumentation/__tests__/middleware.spec.ts +0 -528
- package/src/instrumentation/__tests__/otel.spec.ts +0 -291
- package/src/instrumentation/__tests__/tracing.spec.ts +0 -208
- package/src/instrumentation/core.ts +0 -228
- package/src/instrumentation/hono.ts +0 -270
- package/src/instrumentation/http.ts +0 -306
- package/src/instrumentation/index.ts +0 -90
- package/src/instrumentation/middleware.ts +0 -297
- package/src/instrumentation/otel.ts +0 -271
- package/src/instrumentation/setup.ts +0 -246
- package/src/instrumentation/tracing.ts +0 -145
- package/src/logger/__tests__/console.spec.ts +0 -366
- package/src/logger/__tests__/pino.spec.ts +0 -217
- package/src/logger/console.ts +0 -230
- package/src/logger/pino.ts +0 -201
- package/src/metrics/MetricsAggregator.ts +0 -555
- package/src/metrics/__tests__/MetricsAggregator.spec.ts +0 -298
- package/src/metrics/index.ts +0 -2
- package/src/metrics/storage/InMemoryMetricsStorage.ts +0 -380
- package/src/metrics/storage/MetricsStorage.ts +0 -74
- package/src/metrics/storage/index.ts +0 -3
- package/src/metrics/storage/types.ts +0 -243
- package/src/otlp/__tests__/receiver.spec.ts +0 -367
- package/src/otlp/__tests__/transformer.spec.ts +0 -455
- package/src/otlp/hono.ts +0 -120
- package/src/otlp/index.ts +0 -22
- package/src/otlp/receiver.ts +0 -162
- package/src/otlp/transformer.ts +0 -367
- package/src/otlp/types.ts +0 -364
- package/src/redact.ts +0 -116
- package/src/server/__tests__/hono.spec.ts +0 -814
- package/src/server/hono.ts +0 -442
- package/src/storage/__tests__/kysely.spec.ts +0 -715
- package/src/storage/__tests__/memory.spec.ts +0 -694
- package/src/storage/kysely.ts +0 -599
- package/src/storage/memory.ts +0 -204
- package/src/types.ts +0 -447
- package/src/ui-assets.ts +0 -40
- package/tsconfig.json +0 -9
- package/ui/CHANGELOG.md +0 -7
- package/ui/index.html +0 -12
- package/ui/node_modules/.bin/tsc +0 -21
- package/ui/node_modules/.bin/tsserver +0 -21
- package/ui/node_modules/.bin/vite +0 -21
- package/ui/package.json +0 -24
- package/ui/src/App.tsx +0 -595
- package/ui/src/api.ts +0 -88
- package/ui/src/components/ExceptionDetail.tsx +0 -100
- package/ui/src/components/FilterBar.tsx +0 -162
- package/ui/src/components/LogDetail.tsx +0 -91
- package/ui/src/components/RequestDetail.tsx +0 -143
- package/ui/src/main.tsx +0 -10
- package/ui/src/styles.css +0 -11
- package/ui/src/types.ts +0 -63
- package/ui/src/vite-env.d.ts +0 -1
- package/ui/src/vite-plugin-gkm-config.ts +0 -54
- package/ui/tsconfig.json +0 -20
- package/ui/tsconfig.tsbuildinfo +0 -1
- package/ui/vite.config.ts +0 -13
package/README.md
CHANGED
|
@@ -220,16 +220,26 @@ const storage = new InMemoryStorage({
|
|
|
220
220
|
});
|
|
221
221
|
```
|
|
222
222
|
|
|
223
|
-
### KyselyStorage
|
|
223
|
+
### KyselyStorage
|
|
224
224
|
|
|
225
225
|
For production use with database persistence.
|
|
226
226
|
|
|
227
227
|
```typescript
|
|
228
228
|
import { KyselyStorage } from '@geekmidas/telescope/storage/kysely';
|
|
229
229
|
|
|
230
|
-
const storage = new KyselyStorage(db
|
|
231
|
-
|
|
232
|
-
|
|
230
|
+
const storage = new KyselyStorage({ db });
|
|
231
|
+
```
|
|
232
|
+
|
|
233
|
+
The tables are `requests`, `logs` and `exceptions` — unqualified. A telescope
|
|
234
|
+
derived from a database is a schema tenant with a role whose `search_path` is
|
|
235
|
+
pinned to it, so an unqualified name already resolves there, and
|
|
236
|
+
`DROP SCHEMA telescope CASCADE` is the whole cleanup.
|
|
237
|
+
|
|
238
|
+
Pass `schema` only when the connection is *not* pinned — a shared pool, or a
|
|
239
|
+
migration run as an owner whose `search_path` finds `public` first:
|
|
240
|
+
|
|
241
|
+
```typescript
|
|
242
|
+
const storage = new KyselyStorage({ db, schema: 'telescope' });
|
|
233
243
|
```
|
|
234
244
|
|
|
235
245
|
### Custom Storage
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as _opentelemetry_api0 from "@opentelemetry/api";
|
|
2
2
|
import { Attributes, Context, Span } from "@opentelemetry/api";
|
|
3
3
|
|
|
4
4
|
//#region src/instrumentation/http.d.ts
|
|
@@ -51,7 +51,7 @@ interface HttpSpanAttributes extends HttpRequestAttributes {
|
|
|
51
51
|
/**
|
|
52
52
|
* Get or create a tracer for constructs instrumentation
|
|
53
53
|
*/
|
|
54
|
-
declare function getConstructsTracer():
|
|
54
|
+
declare function getConstructsTracer(): _opentelemetry_api0.Tracer;
|
|
55
55
|
/**
|
|
56
56
|
* Convert HTTP attributes to OpenTelemetry semantic conventions
|
|
57
57
|
*/
|
|
@@ -104,4 +104,4 @@ declare function isTracingEnabled(): boolean;
|
|
|
104
104
|
//# sourceMappingURL=http.d.ts.map
|
|
105
105
|
//#endregion
|
|
106
106
|
export { EndpointAttributes, HttpRequestAttributes, HttpResponseAttributes, HttpSpanAttributes, UserAttributes, createChildSpan, createHttpServerSpan, endHttpSpan, extractTraceContext, getConstructsTracer, injectTraceContext, isTracingEnabled, toOtelAttributes, withChildSpan, withHttpSpan };
|
|
107
|
-
//# sourceMappingURL=http-
|
|
107
|
+
//# sourceMappingURL=http-DULM1u2L.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"http-
|
|
1
|
+
{"version":3,"file":"http-DULM1u2L.d.cts","names":[],"sources":["../src/instrumentation/http.ts"],"sourcesContent":[],"mappings":";;;;;;;AAciB,UAAA,qBAAA,CAAqB;EAerB,MAAA,EAAA,MAAA;EAQA,GAAA,CAAA,EAAA,MAAA;EASA,IAAA,CAAA,EAAA,MAAA;EASA,KAAA,CAAA,EAAA,MAAA;EAAmB,IAAA,CAAA,EAAA,MAAA;EAAA,MACxB,CAAA,EAAA,MAAA,GAAA,OAAA;EAAsB,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AA,EA7GR,IA6GQ;;AAAD;AA2BV;iBAnHgB,WAAA,OACT,gBACI,gCACF;;;;;;;;;;;;;;;iBAwCa,uBACd,+BACI,SAAS,QAAQ;;oBACZ,UACd,QAAQ;;;;iBA0BK,eAAA,4BAA2C,aAAa;;;;iBAWlD,0CAEV,SAAS,QAAQ,iBACf,aACX,QAAQ;;;;iBA2BK,gBAAA,CAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as _opentelemetry_api0 from "@opentelemetry/api";
|
|
2
2
|
import { Attributes, Context, Span } from "@opentelemetry/api";
|
|
3
3
|
|
|
4
4
|
//#region src/instrumentation/http.d.ts
|
|
@@ -51,7 +51,7 @@ interface HttpSpanAttributes extends HttpRequestAttributes {
|
|
|
51
51
|
/**
|
|
52
52
|
* Get or create a tracer for constructs instrumentation
|
|
53
53
|
*/
|
|
54
|
-
declare function getConstructsTracer():
|
|
54
|
+
declare function getConstructsTracer(): _opentelemetry_api0.Tracer;
|
|
55
55
|
/**
|
|
56
56
|
* Convert HTTP attributes to OpenTelemetry semantic conventions
|
|
57
57
|
*/
|
|
@@ -104,4 +104,4 @@ declare function isTracingEnabled(): boolean;
|
|
|
104
104
|
//# sourceMappingURL=http.d.ts.map
|
|
105
105
|
//#endregion
|
|
106
106
|
export { EndpointAttributes, HttpRequestAttributes, HttpResponseAttributes, HttpSpanAttributes, UserAttributes, createChildSpan, createHttpServerSpan, endHttpSpan, extractTraceContext, getConstructsTracer, injectTraceContext, isTracingEnabled, toOtelAttributes, withChildSpan, withHttpSpan };
|
|
107
|
-
//# sourceMappingURL=http-
|
|
107
|
+
//# sourceMappingURL=http-GB-Nlvwc.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"http-
|
|
1
|
+
{"version":3,"file":"http-GB-Nlvwc.d.mts","names":[],"sources":["../src/instrumentation/http.ts"],"sourcesContent":[],"mappings":";;;;;;;AAciB,UAAA,qBAAA,CAAqB;E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A,EAAA,MAAA,CAAA,EAAA,GAAA,CAAA,EAxHL,OAwHK,CAAA,EAvHT,MAuHS,CAAA,MAAA,EAAA,MAAA,CAAA;;;;AAED,iBAhHK,oBAAA,CAgHL,KAAA,EA/GH,kBA+GG,EAAA,aAAA,CAAA,EA9GM,OA8GN,CAAA,EA7GR,IA6GQ;;AAAD;AA2BV;iBAnHgB,WAAA,OACT,gBACI,gCACF;;;;;;;;;;;;;;;iBAwCa,uBACd,+BACI,SAAS,QAAQ;;oBACZ,UACd,QAAQ;;;;iBA0BK,eAAA,4BAA2C,aAAa;;;;iBAWlD,0CAEV,SAAS,QAAQ,iBACf,aACX,QAAQ;;;;iBA2BK,gBAAA,CAAA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { EndpointAttributes, HttpRequestAttributes, HttpResponseAttributes, HttpSpanAttributes, UserAttributes, createChildSpan, createHttpServerSpan, endHttpSpan, extractTraceContext, getConstructsTracer, injectTraceContext, isTracingEnabled, toOtelAttributes, withChildSpan, withHttpSpan } from "../http-
|
|
1
|
+
import { EndpointAttributes, HttpRequestAttributes, HttpResponseAttributes, HttpSpanAttributes, UserAttributes, createChildSpan, createHttpServerSpan, endHttpSpan, extractTraceContext, getConstructsTracer, injectTraceContext, isTracingEnabled, toOtelAttributes, withChildSpan, withHttpSpan } from "../http-DULM1u2L.cjs";
|
|
2
2
|
export { EndpointAttributes, HttpRequestAttributes, HttpResponseAttributes, HttpSpanAttributes, UserAttributes, createChildSpan, createHttpServerSpan, endHttpSpan, extractTraceContext, getConstructsTracer, injectTraceContext, isTracingEnabled, toOtelAttributes, withChildSpan, withHttpSpan };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { EndpointAttributes, HttpRequestAttributes, HttpResponseAttributes, HttpSpanAttributes, UserAttributes, createChildSpan, createHttpServerSpan, endHttpSpan, extractTraceContext, getConstructsTracer, injectTraceContext, isTracingEnabled, toOtelAttributes, withChildSpan, withHttpSpan } from "../http-
|
|
1
|
+
import { EndpointAttributes, HttpRequestAttributes, HttpResponseAttributes, HttpSpanAttributes, UserAttributes, createChildSpan, createHttpServerSpan, endHttpSpan, extractTraceContext, getConstructsTracer, injectTraceContext, isTracingEnabled, toOtelAttributes, withChildSpan, withHttpSpan } from "../http-GB-Nlvwc.mjs";
|
|
2
2
|
export { EndpointAttributes, HttpRequestAttributes, HttpResponseAttributes, HttpSpanAttributes, UserAttributes, createChildSpan, createHttpServerSpan, endHttpSpan, extractTraceContext, getConstructsTracer, injectTraceContext, isTracingEnabled, toOtelAttributes, withChildSpan, withHttpSpan };
|
|
@@ -2,8 +2,8 @@ const require_core = require('../core-CtVHRJGv.cjs');
|
|
|
2
2
|
const require_tracing = require('../tracing-Bt1zWRlb.cjs');
|
|
3
3
|
const require_http = require('../http-BsqmhurZ.cjs');
|
|
4
4
|
const require_hono = require('../hono-CPHX7FAm.cjs');
|
|
5
|
-
const require_middleware = require('../middleware-
|
|
6
|
-
const require_otel = require('../otel-
|
|
5
|
+
const require_middleware = require('../middleware-Bcq6XXGG.cjs');
|
|
6
|
+
const require_otel = require('../otel-BzjOtVxZ.cjs');
|
|
7
7
|
const require_setup = require('../setup-DufxQpi9.cjs');
|
|
8
8
|
|
|
9
9
|
exports.NoopSpanProcessor = require_core.NoopSpanProcessor;
|
|
@@ -2,8 +2,8 @@ import { SpanProcessorOptions, SpanProcessorStrategy } from "../types-BRzW1NM8.c
|
|
|
2
2
|
import { NoopSpanProcessor, createSpanProcessor, enableTelemetryDebug, flushTelemetry, getRecommendedStrategy, isTelemetryInitialized, setGlobalLogProcessor, setGlobalSpanProcessor, withTelemetryFlush } from "../core-B4Jpia5H.cjs";
|
|
3
3
|
import { addSpanEvent, createSpan, getActiveSpan, getSpanId, getTraceId, recordException, setSpanAttributes, withSpan, withSpanSync } from "../tracing-BX8uY2nR.cjs";
|
|
4
4
|
import { HonoTelemetryMiddlewareOptions, getSpanFromContext, getTraceContextFromHono, honoTelemetryMiddleware, withHonoSpanContext } from "../hono-CemCKU87.cjs";
|
|
5
|
-
import { EndpointAttributes, HttpRequestAttributes, HttpResponseAttributes, HttpSpanAttributes, UserAttributes, createChildSpan, createHttpServerSpan, endHttpSpan, extractTraceContext, getConstructsTracer, injectTraceContext, isTracingEnabled, toOtelAttributes, withChildSpan, withHttpSpan } from "../http-
|
|
6
|
-
import { TelemetryMiddlewareOptions, getContextFromEvent, getSpanFromEvent, telemetryMiddleware, withEventContext } from "../middleware-
|
|
7
|
-
import { OTelTelemetry, OTelTelemetryOptions } from "../otel-
|
|
5
|
+
import { EndpointAttributes, HttpRequestAttributes, HttpResponseAttributes, HttpSpanAttributes, UserAttributes, createChildSpan, createHttpServerSpan, endHttpSpan, extractTraceContext, getConstructsTracer, injectTraceContext, isTracingEnabled, toOtelAttributes, withChildSpan, withHttpSpan } from "../http-DULM1u2L.cjs";
|
|
6
|
+
import { TelemetryMiddlewareOptions, getContextFromEvent, getSpanFromEvent, telemetryMiddleware, withEventContext } from "../middleware-PeyS-9Ny.cjs";
|
|
7
|
+
import { OTelTelemetry, OTelTelemetryOptions } from "../otel-Bk89b1lX.cjs";
|
|
8
8
|
import { TelemetryOptions, setupTelemetry, shutdownTelemetry } from "../setup-D58N1f9O.cjs";
|
|
9
9
|
export { EndpointAttributes, HonoTelemetryMiddlewareOptions, HttpRequestAttributes, HttpResponseAttributes, HttpSpanAttributes, NoopSpanProcessor, OTelTelemetry, OTelTelemetryOptions, SpanProcessorOptions, SpanProcessorStrategy, TelemetryMiddlewareOptions, TelemetryOptions, UserAttributes, addSpanEvent, createChildSpan, createHttpServerSpan, createSpan, createSpanProcessor, enableTelemetryDebug, endHttpSpan, extractTraceContext, flushTelemetry, getActiveSpan, getConstructsTracer, getContextFromEvent, getRecommendedStrategy, getSpanFromContext, getSpanFromEvent, getSpanId, getTraceContextFromHono, getTraceId, honoTelemetryMiddleware, injectTraceContext, isTelemetryInitialized, isTracingEnabled, recordException, setGlobalLogProcessor, setGlobalSpanProcessor, setSpanAttributes, setupTelemetry, shutdownTelemetry, telemetryMiddleware, toOtelAttributes, withChildSpan, withEventContext, withHonoSpanContext, withHttpSpan, withSpan, withSpanSync, withTelemetryFlush };
|
|
@@ -2,8 +2,8 @@ import { SpanProcessorOptions, SpanProcessorStrategy } from "../types-BzQ78Efw.m
|
|
|
2
2
|
import { NoopSpanProcessor, createSpanProcessor, enableTelemetryDebug, flushTelemetry, getRecommendedStrategy, isTelemetryInitialized, setGlobalLogProcessor, setGlobalSpanProcessor, withTelemetryFlush } from "../core--quSp5Qr.mjs";
|
|
3
3
|
import { addSpanEvent, createSpan, getActiveSpan, getSpanId, getTraceId, recordException, setSpanAttributes, withSpan, withSpanSync } from "../tracing-PnECEbEu.mjs";
|
|
4
4
|
import { HonoTelemetryMiddlewareOptions, getSpanFromContext, getTraceContextFromHono, honoTelemetryMiddleware, withHonoSpanContext } from "../hono--uKQ7Jgi.mjs";
|
|
5
|
-
import { EndpointAttributes, HttpRequestAttributes, HttpResponseAttributes, HttpSpanAttributes, UserAttributes, createChildSpan, createHttpServerSpan, endHttpSpan, extractTraceContext, getConstructsTracer, injectTraceContext, isTracingEnabled, toOtelAttributes, withChildSpan, withHttpSpan } from "../http-
|
|
6
|
-
import { TelemetryMiddlewareOptions, getContextFromEvent, getSpanFromEvent, telemetryMiddleware, withEventContext } from "../middleware-
|
|
7
|
-
import { OTelTelemetry, OTelTelemetryOptions } from "../otel-
|
|
5
|
+
import { EndpointAttributes, HttpRequestAttributes, HttpResponseAttributes, HttpSpanAttributes, UserAttributes, createChildSpan, createHttpServerSpan, endHttpSpan, extractTraceContext, getConstructsTracer, injectTraceContext, isTracingEnabled, toOtelAttributes, withChildSpan, withHttpSpan } from "../http-GB-Nlvwc.mjs";
|
|
6
|
+
import { TelemetryMiddlewareOptions, getContextFromEvent, getSpanFromEvent, telemetryMiddleware, withEventContext } from "../middleware-oHvo_ZgU.mjs";
|
|
7
|
+
import { OTelTelemetry, OTelTelemetryOptions } from "../otel-lPMsM26e.mjs";
|
|
8
8
|
import { TelemetryOptions, setupTelemetry, shutdownTelemetry } from "../setup-Bkxm4g6b.mjs";
|
|
9
9
|
export { EndpointAttributes, HonoTelemetryMiddlewareOptions, HttpRequestAttributes, HttpResponseAttributes, HttpSpanAttributes, NoopSpanProcessor, OTelTelemetry, OTelTelemetryOptions, SpanProcessorOptions, SpanProcessorStrategy, TelemetryMiddlewareOptions, TelemetryOptions, UserAttributes, addSpanEvent, createChildSpan, createHttpServerSpan, createSpan, createSpanProcessor, enableTelemetryDebug, endHttpSpan, extractTraceContext, flushTelemetry, getActiveSpan, getConstructsTracer, getContextFromEvent, getRecommendedStrategy, getSpanFromContext, getSpanFromEvent, getSpanId, getTraceContextFromHono, getTraceId, honoTelemetryMiddleware, injectTraceContext, isTelemetryInitialized, isTracingEnabled, recordException, setGlobalLogProcessor, setGlobalSpanProcessor, setSpanAttributes, setupTelemetry, shutdownTelemetry, telemetryMiddleware, toOtelAttributes, withChildSpan, withEventContext, withHonoSpanContext, withHttpSpan, withSpan, withSpanSync, withTelemetryFlush };
|
|
@@ -2,8 +2,8 @@ import { NoopSpanProcessor, createSpanProcessor, enableTelemetryDebug, flushTele
|
|
|
2
2
|
import { addSpanEvent, createSpan, getActiveSpan, getSpanId, getTraceId, recordException, setSpanAttributes, withSpan, withSpanSync } from "../tracing-Cijm_5NI.mjs";
|
|
3
3
|
import { createChildSpan, createHttpServerSpan, endHttpSpan, extractTraceContext, getConstructsTracer, injectTraceContext, isTracingEnabled, toOtelAttributes, withChildSpan, withHttpSpan } from "../http-BIvr0YdI.mjs";
|
|
4
4
|
import { getSpanFromContext, getTraceContextFromHono, honoTelemetryMiddleware, withHonoSpanContext } from "../hono-Bw-ey6CT.mjs";
|
|
5
|
-
import { getContextFromEvent, getSpanFromEvent, telemetryMiddleware, withEventContext } from "../middleware-
|
|
6
|
-
import { OTelTelemetry } from "../otel-
|
|
5
|
+
import { getContextFromEvent, getSpanFromEvent, telemetryMiddleware, withEventContext } from "../middleware-D1XEHvyy.mjs";
|
|
6
|
+
import { OTelTelemetry } from "../otel-B9bNoeZ2.mjs";
|
|
7
7
|
import { setupTelemetry, shutdownTelemetry } from "../setup-DC9JMEYZ.mjs";
|
|
8
8
|
|
|
9
9
|
export { NoopSpanProcessor, OTelTelemetry, addSpanEvent, createChildSpan, createHttpServerSpan, createSpan, createSpanProcessor, enableTelemetryDebug, endHttpSpan, extractTraceContext, flushTelemetry, getActiveSpan, getConstructsTracer, getContextFromEvent, getRecommendedStrategy, getSpanFromContext, getSpanFromEvent, getSpanId, getTraceContextFromHono, getTraceId, honoTelemetryMiddleware, injectTraceContext, isTelemetryInitialized, isTracingEnabled, recordException, setGlobalLogProcessor, setGlobalSpanProcessor, setSpanAttributes, setupTelemetry, shutdownTelemetry, telemetryMiddleware, toOtelAttributes, withChildSpan, withEventContext, withHonoSpanContext, withHttpSpan, withSpan, withSpanSync, withTelemetryFlush };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
require('../http-BsqmhurZ.cjs');
|
|
2
|
-
const require_middleware = require('../middleware-
|
|
2
|
+
const require_middleware = require('../middleware-Bcq6XXGG.cjs');
|
|
3
3
|
|
|
4
4
|
exports.getContextFromEvent = require_middleware.getContextFromEvent;
|
|
5
5
|
exports.getSpanFromEvent = require_middleware.getSpanFromEvent;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { TelemetryMiddlewareOptions, getContextFromEvent, getSpanFromEvent, telemetryMiddleware, withEventContext } from "../middleware-
|
|
1
|
+
import { TelemetryMiddlewareOptions, getContextFromEvent, getSpanFromEvent, telemetryMiddleware, withEventContext } from "../middleware-PeyS-9Ny.cjs";
|
|
2
2
|
export { TelemetryMiddlewareOptions, getContextFromEvent, getSpanFromEvent, telemetryMiddleware, withEventContext };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { TelemetryMiddlewareOptions, getContextFromEvent, getSpanFromEvent, telemetryMiddleware, withEventContext } from "../middleware-
|
|
1
|
+
import { TelemetryMiddlewareOptions, getContextFromEvent, getSpanFromEvent, telemetryMiddleware, withEventContext } from "../middleware-oHvo_ZgU.mjs";
|
|
2
2
|
export { TelemetryMiddlewareOptions, getContextFromEvent, getSpanFromEvent, telemetryMiddleware, withEventContext };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import "../http-BIvr0YdI.mjs";
|
|
2
|
-
import { getContextFromEvent, getSpanFromEvent, telemetryMiddleware, withEventContext } from "../middleware-
|
|
2
|
+
import { getContextFromEvent, getSpanFromEvent, telemetryMiddleware, withEventContext } from "../middleware-D1XEHvyy.mjs";
|
|
3
3
|
|
|
4
4
|
export { getContextFromEvent, getSpanFromEvent, telemetryMiddleware, withEventContext };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { OTelTelemetry, OTelTelemetryOptions, Telemetry, TelemetryContext, TelemetryRequest, TelemetryResponse } from "../otel-
|
|
1
|
+
import { OTelTelemetry, OTelTelemetryOptions, Telemetry, TelemetryContext, TelemetryRequest, TelemetryResponse } from "../otel-Bk89b1lX.cjs";
|
|
2
2
|
export { OTelTelemetry, OTelTelemetryOptions, Telemetry, TelemetryContext, TelemetryRequest, TelemetryResponse };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { OTelTelemetry, OTelTelemetryOptions, Telemetry, TelemetryContext, TelemetryRequest, TelemetryResponse } from "../otel-
|
|
1
|
+
import { OTelTelemetry, OTelTelemetryOptions, Telemetry, TelemetryContext, TelemetryRequest, TelemetryResponse } from "../otel-lPMsM26e.mjs";
|
|
2
2
|
export { OTelTelemetry, OTelTelemetryOptions, Telemetry, TelemetryContext, TelemetryRequest, TelemetryResponse };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"console.d.cts","names":[],"sources":["../../src/logger/console.ts"],"sourcesContent":[],"mappings":";;;;;;;;UAKiB,MAAA;EAAA,KAAA,EACT,KADe;EAAA,IAAA,EAEhB,KAFgB;EAAA,IACf,EAED,KAFC;EAAK,KACN,EAEC,KAFD;EAAK,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B,qBAAA,YACJ,oBACF,kBACC,0BACR"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"console.d.mts","names":[],"sources":["../../src/logger/console.ts"],"sourcesContent":[],"mappings":";;;;;;;;UAKiB,MAAA;EAAA,KAAA,EACT,KADe;EAAA,IAAA,EAEhB,KAFgB;EAAA,IACf,EAED,KAFC;EAAK,KACN,EAEC,KAFD;EAAK,KACL,EAEC,KAFD;EAAK,KACJ,EAEA,KAFA;EAAK,KACL,EAAA,CAAA,GAAA,EAAA,MAAA,EAAA,GAEiB,MAFjB;;AAEiB,KAGb,KAAA,GAHa;EAAM,CAAA,UAAA,MAAA,CAAA,CAAA,GAAA,EAIN,CAJM,EAAA,GAAA,CAAA,EAAA,MAAA,EAAA,GAAA,IAAA,EAAA,GAAA,EAAA,CAAA,EAAA,IAAA;EAGnB,CAAA,GAAA,EAAA,MAAK,CAAA,EAAA,
|
|
1
|
+
{"version":3,"file":"console.d.mts","names":[],"sources":["../../src/logger/console.ts"],"sourcesContent":[],"mappings":";;;;;;;;UAKiB,MAAA;EAAA,KAAA,EACT,KADe;EAAA,IAAA,EAEhB,KAFgB;EAAA,IACf,EAED,KAFC;EAAK,KACN,EAEC,KAFD;EAAK,KACL,EAEC,KAFD;EAAK,KACJ,EAEA,KAFA;EAAK,KACL,EAAA,CAAA,GAAA,EAAA,MAAA,EAAA,GAEiB,MAFjB;;AAEiB,KAGb,KAAA,GAHa;EAAM,CAAA,UAAA,MAAA,CAAA,CAAA,GAAA,EAIN,CAJM,EAAA,GAAA,CAAA,EAAA,MAAA,EAAA,GAAA,IAAA,EAAA,GAAA,EAAA,CAAA,EAAA,IAAA;EAGnB,CAAA,GAAA,EAAA,MAAK,CAAA,EAAA,IACQ;AAIzB,CAAA;AAAuC,UAAtB,sBAAA,CAAsB;EAAA;;;EAiBtB,SAAA,EAbL,SAaK;EA+BJ;;;;EA8CA,MACN,CAAA,EAtFG,MAsFH;EAAK;;;EAKC,SA6BL,CAAA,EAAA,MAAA;EAAK;;;EAjFiC,OAAA,CAAA,EA/BnC,MA+BmC,CAAA,MAAA,EAAA,OAAA,CAAA;AAyJ9C;;;;;;AAIkB;;;;;;;;;;;;;;;;;;;;;cA7JL,eAAA,YAA2B;;;;;uBAMlB;;SAwCd;QACD;QACA;SACC;SAGA;SA6BA;;;;;sBAiCa;;;;;oCAac;;;;;;;;;;;;;;;;;;iBA0BnB,qBAAA,YACJ,oBACF,kBACC,0BACR"}
|
package/dist/logger/pino.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "../types-l7Rlb5Mg.cjs";
|
|
2
2
|
import "../MetricsAggregator-4SqelGcG.cjs";
|
|
3
3
|
import { Telescope } from "../Telescope-D4nmwDRA.cjs";
|
|
4
|
-
import * as
|
|
4
|
+
import * as stream1 from "stream";
|
|
5
5
|
import build from "pino-abstract-transport";
|
|
6
6
|
|
|
7
7
|
//#region src/logger/pino.d.ts
|
|
@@ -62,7 +62,7 @@ interface TelescopePinoTransportOptions {
|
|
|
62
62
|
* logger.info({ userId: '123' }, 'User logged in');
|
|
63
63
|
* ```
|
|
64
64
|
*/
|
|
65
|
-
declare function createPinoTransport(options: TelescopePinoTransportOptions):
|
|
65
|
+
declare function createPinoTransport(options: TelescopePinoTransportOptions): stream1.Transform & build.OnUnknown;
|
|
66
66
|
/**
|
|
67
67
|
* Create a Pino destination that sends logs to Telescope.
|
|
68
68
|
* Alias for createPinoTransport for API compatibility.
|
|
@@ -24,7 +24,7 @@ function getContextFromEvent(event) {
|
|
|
24
24
|
* ```typescript
|
|
25
25
|
* import { telemetryMiddleware } from '@geekmidas/telescope/instrumentation';
|
|
26
26
|
*
|
|
27
|
-
* const adaptor = new AmazonApiGatewayV2Endpoint(
|
|
27
|
+
* const adaptor = new AmazonApiGatewayV2Endpoint(endpoint, {
|
|
28
28
|
* telemetry: { middleware: telemetryMiddleware() },
|
|
29
29
|
* });
|
|
30
30
|
* ```
|
|
@@ -181,4 +181,4 @@ Object.defineProperty(exports, 'withEventContext', {
|
|
|
181
181
|
return withEventContext;
|
|
182
182
|
}
|
|
183
183
|
});
|
|
184
|
-
//# sourceMappingURL=middleware-
|
|
184
|
+
//# sourceMappingURL=middleware-Bcq6XXGG.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"middleware-Bcq6XXGG.cjs","names":["event: any","options: TelemetryMiddlewareOptions","lambdaContext: LambdaContext","route: string | undefined","host: string | undefined","scheme: 'http' | 'https' | undefined","userAgent: string | undefined","clientIp: string | undefined","requestId: string | undefined","attrs: HttpSpanAttributes","headers: Record<string, string | string[] | undefined>","normalized: Record<string, string | string[] | undefined>","fn: () => Promise<T>"],"sources":["../src/instrumentation/middleware.ts"],"sourcesContent":["/**\n * OpenTelemetry instrumentation middleware for @geekmidas/constructs\n *\n * This middleware automatically creates spans for HTTP requests,\n * extracts trace context from incoming headers, and records\n * request/response metadata as span attributes.\n */\nimport type { MiddlewareObj } from '@middy/core';\nimport { context, type Span, trace } from '@opentelemetry/api';\nimport type { Context as LambdaContext } from 'aws-lambda';\nimport {\n\tcreateHttpServerSpan,\n\tendHttpSpan,\n\textractTraceContext,\n\ttype HttpSpanAttributes,\n} from './http';\n\n/**\n * Options for the telemetry middleware\n */\nexport interface TelemetryMiddlewareOptions {\n\t/**\n\t * Whether to record request body as span attribute\n\t * @default false\n\t */\n\trecordBody?: boolean;\n\n\t/**\n\t * Whether to record response body as span attribute\n\t * @default false\n\t */\n\trecordResponseBody?: boolean;\n\n\t/**\n\t * Custom function to extract endpoint name from event\n\t */\n\tgetEndpointName?: (event: any) => string | undefined;\n\n\t/**\n\t * Custom function to extract operation ID from event\n\t */\n\tgetOperationId?: (event: any) => string | undefined;\n\n\t/**\n\t * Custom function to extract user ID from event\n\t */\n\tgetUserId?: (event: any) => string | undefined;\n\n\t/**\n\t * Whether to skip tracing for this request\n\t */\n\tshouldSkip?: (event: any) => boolean;\n}\n\n// Symbol for storing span on event\nconst SPAN_SYMBOL = Symbol('telemetry.span');\nconst CONTEXT_SYMBOL = Symbol('telemetry.context');\n\n/**\n * Get the current span from the Lambda event\n */\nexport function getSpanFromEvent(event: any): Span | undefined {\n\treturn event?.[SPAN_SYMBOL];\n}\n\n/**\n * Get the current trace context from the Lambda event\n */\nexport function getContextFromEvent(event: any): any {\n\treturn event?.[CONTEXT_SYMBOL];\n}\n\n/**\n * Create a telemetry middleware for Lambda handlers\n *\n * @example\n * ```typescript\n * import { telemetryMiddleware } from '@geekmidas/telescope/instrumentation';\n *\n * const adaptor = new AmazonApiGatewayV2Endpoint(endpoint, {\n * telemetry: { middleware: telemetryMiddleware() },\n * });\n * ```\n */\nexport function telemetryMiddleware(\n\toptions: TelemetryMiddlewareOptions = {},\n): MiddlewareObj<any, any, Error, LambdaContext> {\n\treturn {\n\t\tbefore: async (request) => {\n\t\t\t// Skip if custom skip function returns true\n\t\t\tif (options.shouldSkip?.(request.event)) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst event = request.event;\n\t\t\tconst lambdaContext = request.context;\n\n\t\t\t// Extract trace context from headers\n\t\t\tconst headers = normalizeHeaders(event.headers || {});\n\t\t\tconst parentContext = extractTraceContext(headers);\n\n\t\t\t// Build span attributes from event\n\t\t\tconst attrs = buildSpanAttributes(event, lambdaContext, options);\n\n\t\t\t// Create the span\n\t\t\tconst span = createHttpServerSpan(attrs, parentContext);\n\n\t\t\t// Store span and context on event for access in handler\n\t\t\tevent[SPAN_SYMBOL] = span;\n\t\t\tevent[CONTEXT_SYMBOL] = trace.setSpan(parentContext, span);\n\n\t\t\t// Add Lambda-specific attributes\n\t\t\tspan.setAttribute('faas.invocation_id', lambdaContext.awsRequestId);\n\t\t\tspan.setAttribute('faas.name', lambdaContext.functionName);\n\n\t\t\tif (options.recordBody && event.body) {\n\t\t\t\tconst bodyStr =\n\t\t\t\t\ttypeof event.body === 'string'\n\t\t\t\t\t\t? event.body\n\t\t\t\t\t\t: JSON.stringify(event.body);\n\t\t\t\t// Truncate large bodies\n\t\t\t\tspan.setAttribute(\n\t\t\t\t\t'http.request.body',\n\t\t\t\t\tbodyStr.length > 4096 ? `${bodyStr.slice(0, 4096)}...` : bodyStr,\n\t\t\t\t);\n\t\t\t}\n\t\t},\n\n\t\tafter: async (request) => {\n\t\t\tconst span = getSpanFromEvent(request.event);\n\t\t\tif (!span) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst response = request.response;\n\t\t\tconst statusCode =\n\t\t\t\ttypeof response?.statusCode === 'number' ? response.statusCode : 200;\n\n\t\t\tif (options.recordResponseBody && response?.body) {\n\t\t\t\tconst bodyStr =\n\t\t\t\t\ttypeof response.body === 'string'\n\t\t\t\t\t\t? response.body\n\t\t\t\t\t\t: JSON.stringify(response.body);\n\t\t\t\tspan.setAttribute(\n\t\t\t\t\t'http.response.body',\n\t\t\t\t\tbodyStr.length > 4096 ? `${bodyStr.slice(0, 4096)}...` : bodyStr,\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tendHttpSpan(span, { statusCode });\n\t\t},\n\n\t\tonError: async (request) => {\n\t\t\tconst span = getSpanFromEvent(request.event);\n\t\t\tif (!span) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst error = request.error;\n\t\t\tconst response = request.response;\n\n\t\t\t// Determine status code from response or error\n\t\t\tlet statusCode = 500;\n\t\t\tif (response?.statusCode) {\n\t\t\t\tstatusCode = response.statusCode;\n\t\t\t} else if (error && 'statusCode' in error) {\n\t\t\t\tstatusCode = (error as any).statusCode;\n\t\t\t}\n\n\t\t\tendHttpSpan(\n\t\t\t\tspan,\n\t\t\t\t{ statusCode },\n\t\t\t\terror instanceof Error ? error : new Error(String(error)),\n\t\t\t);\n\t\t},\n\t};\n}\n\n/**\n * Build span attributes from Lambda event\n */\nfunction buildSpanAttributes(\n\tevent: any,\n\tlambdaContext: LambdaContext,\n\toptions: TelemetryMiddlewareOptions,\n): HttpSpanAttributes {\n\t// Detect event type (API Gateway v1, v2, ALB, or direct invoke)\n\tconst isV2 =\n\t\t'requestContext' in event && 'http' in (event.requestContext || {});\n\tconst isV1 =\n\t\t'requestContext' in event &&\n\t\t'httpMethod' in event &&\n\t\t!('http' in (event.requestContext || {}));\n\n\tlet method = 'INVOKE';\n\tlet path = '/';\n\tlet route: string | undefined;\n\tlet host: string | undefined;\n\tlet scheme: 'http' | 'https' | undefined;\n\tlet userAgent: string | undefined;\n\tlet clientIp: string | undefined;\n\tlet requestId: string | undefined;\n\n\tif (isV2) {\n\t\t// API Gateway v2 (HTTP API)\n\t\tconst http = event.requestContext.http;\n\t\tmethod = http.method;\n\t\tpath = event.rawPath || http.path;\n\t\troute = event.routeKey?.replace(/^[A-Z]+\\s+/, ''); // Remove HTTP method prefix\n\t\thost = event.headers?.host;\n\t\tscheme = 'https';\n\t\tuserAgent = http.userAgent;\n\t\tclientIp = http.sourceIp;\n\t\trequestId = event.requestContext.requestId;\n\t} else if (isV1) {\n\t\t// API Gateway v1 (REST API)\n\t\tmethod = event.httpMethod;\n\t\tpath = event.path;\n\t\troute = event.resource;\n\t\thost = event.headers?.Host || event.headers?.host;\n\t\tscheme = 'https';\n\t\tuserAgent = event.headers?.['User-Agent'] || event.headers?.['user-agent'];\n\t\tclientIp = event.requestContext?.identity?.sourceIp;\n\t\trequestId = event.requestContext?.requestId;\n\t} else if ('httpMethod' in event) {\n\t\t// ALB event\n\t\tmethod = event.httpMethod;\n\t\tpath = event.path;\n\t\thost = event.headers?.host;\n\t\tuserAgent = event.headers?.['user-agent'] || event.headers?.['User-Agent'];\n\t\tclientIp = event.headers?.['x-forwarded-for']?.split(',')[0]?.trim();\n\t}\n\n\tconst attrs: HttpSpanAttributes = {\n\t\tmethod,\n\t\tpath,\n\t\troute,\n\t\thost,\n\t\tscheme,\n\t\tuserAgent,\n\t\tclientIp,\n\t\trequestId: requestId || lambdaContext.awsRequestId,\n\t};\n\n\t// Add endpoint metadata if extractors provided\n\tif (options.getEndpointName || options.getOperationId) {\n\t\tattrs.endpoint = {\n\t\t\tname: options.getEndpointName?.(event),\n\t\t\toperationId: options.getOperationId?.(event),\n\t\t};\n\t}\n\n\t// Add user metadata if extractor provided\n\tif (options.getUserId) {\n\t\tconst userId = options.getUserId(event);\n\t\tif (userId) {\n\t\t\tattrs.user = { userId };\n\t\t}\n\t}\n\n\treturn attrs;\n}\n\n/**\n * Normalize headers to lowercase keys\n */\nfunction normalizeHeaders(\n\theaders: Record<string, string | string[] | undefined>,\n): Record<string, string | string[] | undefined> {\n\tconst normalized: Record<string, string | string[] | undefined> = {};\n\tfor (const [key, value] of Object.entries(headers)) {\n\t\tnormalized[key.toLowerCase()] = value;\n\t}\n\treturn normalized;\n}\n\n/**\n * Run a function within the span context from a Lambda event\n *\n * @example\n * ```typescript\n * await withEventContext(event, async () => {\n * // Any spans created here will be children of the request span\n * await doSomething();\n * });\n * ```\n */\nexport async function withEventContext<T>(\n\tevent: any,\n\tfn: () => Promise<T>,\n): Promise<T> {\n\tconst ctx = getContextFromEvent(event);\n\tif (!ctx) {\n\t\treturn fn();\n\t}\n\treturn context.with(ctx, fn);\n}\n"],"mappings":";;;;;AAuDA,MAAM,cAAc,OAAO,iBAAiB;AAC5C,MAAM,iBAAiB,OAAO,oBAAoB;;;;AAKlD,SAAgB,iBAAiBA,OAA8B;AAC9D,QAAO,QAAQ;AACf;;;;AAKD,SAAgB,oBAAoBA,OAAiB;AACpD,QAAO,QAAQ;AACf;;;;;;;;;;;;;AAcD,SAAgB,oBACfC,UAAsC,CAAE,GACQ;AAChD,QAAO;EACN,QAAQ,OAAO,YAAY;AAE1B,OAAI,QAAQ,aAAa,QAAQ,MAAM,CACtC;GAGD,MAAM,QAAQ,QAAQ;GACtB,MAAM,gBAAgB,QAAQ;GAG9B,MAAM,UAAU,iBAAiB,MAAM,WAAW,CAAE,EAAC;GACrD,MAAM,gBAAgB,iCAAoB,QAAQ;GAGlD,MAAM,QAAQ,oBAAoB,OAAO,eAAe,QAAQ;GAGhE,MAAM,OAAO,kCAAqB,OA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AAC,KAAK,MAAM,IAAI,OAAO,QAAQ,QAAQ,CACjD,YAAW,IAAI,aAAa,IAAI;AAEjC,QAAO;AACP;;;;;;;;;;;;AAaD,eAAsB,iBACrBX,OACAY,IACa;CACb,MAAM,MAAM,oBAAoB,MAAM;AACtC,MAAK,IACJ,QAAO,IAAI;AAEZ,QAAO,4BAAQ,KAAK,KAAK,GAAG;AAC5B"}
|
|
@@ -23,7 +23,7 @@ function getContextFromEvent(event) {
|
|
|
23
23
|
* ```typescript
|
|
24
24
|
* import { telemetryMiddleware } from '@geekmidas/telescope/instrumentation';
|
|
25
25
|
*
|
|
26
|
-
* const adaptor = new AmazonApiGatewayV2Endpoint(
|
|
26
|
+
* const adaptor = new AmazonApiGatewayV2Endpoint(endpoint, {
|
|
27
27
|
* telemetry: { middleware: telemetryMiddleware() },
|
|
28
28
|
* });
|
|
29
29
|
* ```
|
|
@@ -157,4 +157,4 @@ async function withEventContext(event, fn) {
|
|
|
157
157
|
|
|
158
158
|
//#endregion
|
|
159
159
|
export { getContextFromEvent, getSpanFromEvent, telemetryMiddleware, withEventContext };
|
|
160
|
-
//# sourceMappingURL=middleware-
|
|
160
|
+
//# sourceMappingURL=middleware-D1XEHvyy.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"middleware-D1XEHvyy.mjs","names":["event: any","options: TelemetryMiddlewareOptions","lambdaContext: LambdaContext","route: string | undefined","host: string | undefined","scheme: 'http' | 'https' | undefined","userAgent: string | undefined","clientIp: string | undefined","requestId: string | undefined","attrs: HttpSpanAttributes","headers: Record<string, string | string[] | undefined>","normalized: Record<string, string | string[] | undefined>","fn: () => Promise<T>"],"sources":["../src/instrumentation/middleware.ts"],"sourcesContent":["/**\n * OpenTelemetry instrumentation middleware for @geekmidas/constructs\n *\n * This middleware automatically creates spans for HTTP requests,\n * extracts trace context from incoming headers, and records\n * request/response metadata as span attributes.\n */\nimport type { MiddlewareObj } from '@middy/core';\nimport { context, type Span, trace } from '@opentelemetry/api';\nimport type { Context as LambdaContext } from 'aws-lambda';\nimport {\n\tcreateHttpServerSpan,\n\tendHttpSpan,\n\textractTraceContext,\n\ttype HttpSpanAttributes,\n} from './http';\n\n/**\n * Options for the telemetry middleware\n */\nexport interface TelemetryMiddlewareOptions {\n\t/**\n\t * Whether to record request body as span attribute\n\t * @default false\n\t */\n\trecordBody?: boolean;\n\n\t/**\n\t * Whether to record response body as span attribute\n\t * @default false\n\t */\n\trecordResponseBody?: boolean;\n\n\t/**\n\t * Custom function to extract endpoint name from event\n\t */\n\tgetEndpointName?: (event: any) => string | undefined;\n\n\t/**\n\t * Custom function to extract operation ID from event\n\t */\n\tgetOperationId?: (event: any) => string | undefined;\n\n\t/**\n\t * Custom function to extract user ID from event\n\t */\n\tgetUserId?: (event: any) => string | undefined;\n\n\t/**\n\t * Whether to skip tracing for this request\n\t */\n\tshouldSkip?: (event: any) => boolean;\n}\n\n// Symbol for storing span on event\nconst SPAN_SYMBOL = Symbol('telemetry.span');\nconst CONTEXT_SYMBOL = Symbol('telemetry.context');\n\n/**\n * Get the current span from the Lambda event\n */\nexport function getSpanFromEvent(event: any): Span | undefined {\n\treturn event?.[SPAN_SYMBOL];\n}\n\n/**\n * Get the current trace context from the Lambda event\n */\nexport function getContextFromEvent(event: any): any {\n\treturn event?.[CONTEXT_SYMBOL];\n}\n\n/**\n * Create a telemetry middleware for Lambda handlers\n *\n * @example\n * ```typescript\n * import { telemetryMiddleware } from '@geekmidas/telescope/instrumentation';\n *\n * const adaptor = new AmazonApiGatewayV2Endpoint(endpoint, {\n * telemetry: { middleware: telemetryMiddleware() },\n * });\n * ```\n */\nexport function telemetryMiddleware(\n\toptions: TelemetryMiddlewareOptions = {},\n): MiddlewareObj<any, any, Error, LambdaContext> {\n\treturn {\n\t\tbefore: async (request) => {\n\t\t\t// Skip if custom skip function returns true\n\t\t\tif (options.shouldSkip?.(request.event)) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst event = request.event;\n\t\t\tconst lambdaContext = request.context;\n\n\t\t\t// Extract trace context from headers\n\t\t\tconst headers = normalizeHeaders(event.headers || {});\n\t\t\tconst parentContext = extractTraceContext(headers);\n\n\t\t\t// Build span attributes from event\n\t\t\tconst attrs = buildSpanAttributes(event, lambdaContext, options);\n\n\t\t\t// Create the span\n\t\t\tconst span = createHttpServerSpan(attrs, parentContext);\n\n\t\t\t// Store span and context on event for access in handler\n\t\t\tevent[SPAN_SYMBOL] = span;\n\t\t\tevent[CONTEXT_SYMBOL] = trace.setSpan(parentContext, span);\n\n\t\t\t// Add Lambda-specific attributes\n\t\t\tspan.setAttribute('faas.invocation_id', lambdaContext.awsRequestId);\n\t\t\tspan.setAttribute('faas.name', lambdaContext.functionName);\n\n\t\t\tif (options.recordBody && event.body) {\n\t\t\t\tconst bodyStr =\n\t\t\t\t\ttypeof event.body === 'string'\n\t\t\t\t\t\t? event.body\n\t\t\t\t\t\t: JSON.stringify(event.body);\n\t\t\t\t// Truncate large bodies\n\t\t\t\tspan.setAttribute(\n\t\t\t\t\t'http.request.body',\n\t\t\t\t\tbodyStr.length > 4096 ? `${bodyStr.slice(0, 4096)}...` : bodyStr,\n\t\t\t\t);\n\t\t\t}\n\t\t},\n\n\t\tafter: async (request) => {\n\t\t\tconst span = getSpanFromEvent(request.event);\n\t\t\tif (!span) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst response = request.response;\n\t\t\tconst statusCode =\n\t\t\t\ttypeof response?.statusCode === 'number' ? response.statusCode : 200;\n\n\t\t\tif (options.recordResponseBody && response?.body) {\n\t\t\t\tconst bodyStr =\n\t\t\t\t\ttypeof response.body === 'string'\n\t\t\t\t\t\t? response.body\n\t\t\t\t\t\t: JSON.stringify(response.body);\n\t\t\t\tspan.setAttribute(\n\t\t\t\t\t'http.response.body',\n\t\t\t\t\tbodyStr.length > 4096 ? `${bodyStr.slice(0, 4096)}...` : bodyStr,\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tendHttpSpan(span, { statusCode });\n\t\t},\n\n\t\tonError: async (request) => {\n\t\t\tconst span = getSpanFromEvent(request.event);\n\t\t\tif (!span) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst error = request.error;\n\t\t\tconst response = request.response;\n\n\t\t\t// Determine status code from response or error\n\t\t\tlet statusCode = 500;\n\t\t\tif (response?.statusCode) {\n\t\t\t\tstatusCode = response.statusCode;\n\t\t\t} else if (error && 'statusCode' in error) {\n\t\t\t\tstatusCode = (error as any).statusCode;\n\t\t\t}\n\n\t\t\tendHttpSpan(\n\t\t\t\tspan,\n\t\t\t\t{ statusCode },\n\t\t\t\terror instanceof Error ? error : new Error(String(error)),\n\t\t\t);\n\t\t},\n\t};\n}\n\n/**\n * Build span attributes from Lambda event\n */\nfunction buildSpanAttributes(\n\tevent: any,\n\tlambdaContext: LambdaContext,\n\toptions: TelemetryMiddlewareOptions,\n): HttpSpanAttributes {\n\t// Detect event type (API Gateway v1, v2, ALB, or direct invoke)\n\tconst isV2 =\n\t\t'requestContext' in event && 'http' in (event.requestContext || {});\n\tconst isV1 =\n\t\t'requestContext' in event &&\n\t\t'httpMethod' in event &&\n\t\t!('http' in (event.requestContext || {}));\n\n\tlet method = 'INVOKE';\n\tlet path = '/';\n\tlet route: string | undefined;\n\tlet host: string | undefined;\n\tlet scheme: 'http' | 'https' | undefined;\n\tlet userAgent: string | undefined;\n\tlet clientIp: string | undefined;\n\tlet requestId: string | undefined;\n\n\tif (isV2) {\n\t\t// API Gateway v2 (HTTP API)\n\t\tconst http = event.requestContext.http;\n\t\tmethod = http.method;\n\t\tpath = event.rawPath || http.path;\n\t\troute = event.routeKey?.replace(/^[A-Z]+\\s+/, ''); // Remove HTTP method prefix\n\t\thost = event.headers?.host;\n\t\tscheme = 'https';\n\t\tuserAgent = http.userAgent;\n\t\tclientIp = http.sourceIp;\n\t\trequestId = event.requestContext.requestId;\n\t} else if (isV1) {\n\t\t// API Gateway v1 (REST API)\n\t\tmethod = event.httpMethod;\n\t\tpath = event.path;\n\t\troute = event.resource;\n\t\thost = event.headers?.Host || event.headers?.host;\n\t\tscheme = 'https';\n\t\tuserAgent = event.headers?.['User-Agent'] || event.headers?.['user-agent'];\n\t\tclientIp = event.requestContext?.identity?.sourceIp;\n\t\trequestId = event.requestContext?.requestId;\n\t} else if ('httpMethod' in event) {\n\t\t// ALB event\n\t\tmethod = event.httpMethod;\n\t\tpath = event.path;\n\t\thost = event.headers?.host;\n\t\tuserAgent = event.headers?.['user-agent'] || event.headers?.['User-Agent'];\n\t\tclientIp = event.headers?.['x-forwarded-for']?.split(',')[0]?.trim();\n\t}\n\n\tconst attrs: HttpSpanAttributes = {\n\t\tmethod,\n\t\tpath,\n\t\troute,\n\t\thost,\n\t\tscheme,\n\t\tuserAgent,\n\t\tclientIp,\n\t\trequestId: requestId || lambdaContext.awsRequestId,\n\t};\n\n\t// Add endpoint metadata if extractors provided\n\tif (options.getEndpointName || options.getOperationId) {\n\t\tattrs.endpoint = {\n\t\t\tname: options.getEndpointName?.(event),\n\t\t\toperationId: options.getOperationId?.(event),\n\t\t};\n\t}\n\n\t// Add user metadata if extractor provided\n\tif (options.getUserId) {\n\t\tconst userId = options.getUserId(event);\n\t\tif (userId) {\n\t\t\tattrs.user = { userId };\n\t\t}\n\t}\n\n\treturn attrs;\n}\n\n/**\n * Normalize headers to lowercase keys\n */\nfunction normalizeHeaders(\n\theaders: Record<string, string | string[] | undefined>,\n): Record<string, string | string[] | undefined> {\n\tconst normalized: Record<string, string | string[] | undefined> = {};\n\tfor (const [key, value] of Object.entries(headers)) {\n\t\tnormalized[key.toLowerCase()] = value;\n\t}\n\treturn normalized;\n}\n\n/**\n * Run a function within the span context from a Lambda event\n *\n * @example\n * ```typescript\n * await withEventContext(event, async () => {\n * // Any spans created here will be children of the request span\n * await doSomething();\n * });\n * ```\n */\nexport async function withEventContext<T>(\n\tevent: any,\n\tfn: () => Promise<T>,\n): Promise<T> {\n\tconst ctx = getContextFromEvent(event);\n\tif (!ctx) {\n\t\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B,OAAO;AAEjC,WAAS,MAAM;AACf,SAAO,MAAM;AACb,SAAO,MAAM,SAAS;AACtB,cAAY,MAAM,UAAU,iBAAiB,MAAM,UAAU;AAC7D,aAAW,MAAM,UAAU,oBAAoB,MAAM,IAAI,CAAC,IAAI,MAAM;CACpE;CAED,MAAMC,QAA4B;EACjC;EACA;EACA;EACA;EACA;EACA;EACA;EACA,WAAW,aAAa,cAAc;CACtC;AAGD,KAAI,QAAQ,mBAAmB,QAAQ,eACtC,OAAM,WAAW;EAChB,MAAM,QAAQ,kBAAkB,MAAM;EACtC,aAAa,QAAQ,iBAAiB,MAAM;CAC5C;AAIF,KAAI,QAAQ,WAAW;EACtB,MAAM,SAAS,QAAQ,UAAU,MAAM;AACvC,MAAI,OACH,OAAM,OAAO,EAAE,OAAQ;CAExB;AAED,QAAO;AACP;;;;AAKD,SAAS,iBACRC,SACgD;CAChD,MAAMC,aAA4D,CAAE;AACpE,MAAK,MAAM,CAAC,KAAK,MAAM,IAAI,OAAO,QAAQ,QAAQ,CACjD,YAAW,IAAI,aAAa,IAAI;AAEjC,QAAO;AACP;;;;;;;;;;;;AAaD,eAAsB,iBACrBX,OACAY,IACa;CACb,MAAM,MAAM,oBAAoB,MAAM;AACtC,MAAK,IACJ,QAAO,IAAI;AAEZ,QAAO,QAAQ,KAAK,KAAK,GAAG;AAC5B"}
|
|
@@ -50,7 +50,7 @@ declare function getContextFromEvent(event: any): any;
|
|
|
50
50
|
* ```typescript
|
|
51
51
|
* import { telemetryMiddleware } from '@geekmidas/telescope/instrumentation';
|
|
52
52
|
*
|
|
53
|
-
* const adaptor = new AmazonApiGatewayV2Endpoint(
|
|
53
|
+
* const adaptor = new AmazonApiGatewayV2Endpoint(endpoint, {
|
|
54
54
|
* telemetry: { middleware: telemetryMiddleware() },
|
|
55
55
|
* });
|
|
56
56
|
* ```
|
|
@@ -71,4 +71,4 @@ declare function withEventContext<T>(event: any, fn: () => Promise<T>): Promise<
|
|
|
71
71
|
//# sourceMappingURL=middleware.d.ts.map
|
|
72
72
|
//#endregion
|
|
73
73
|
export { TelemetryMiddlewareOptions, getContextFromEvent, getSpanFromEvent, telemetryMiddleware, withEventContext };
|
|
74
|
-
//# sourceMappingURL=middleware-
|
|
74
|
+
//# sourceMappingURL=middleware-PeyS-9Ny.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"middleware-
|
|
1
|
+
{"version":3,"file":"middleware-PeyS-9Ny.d.cts","names":[],"sources":["../src/instrumentation/middleware.ts"],"sourcesContent":[],"mappings":";;;;;;;;;AAsFG,UAlEc,0BAAA,CAkEd;EAAa;AAyMhB;;;EAEoB,UAAT,CAAA,EAAA,OAAA;EAAO;;AACR;;;;;;;;;;;;;;;;;;;;;;;iBArOM,gBAAA,cAA8B;;;;iBAO9B,mBAAA;;;;;;;;;;;;;iBAgBA,mBAAA,WACN,6BACP,wBAAwB,OAAO;;;;;;;;;;;;iBAyMZ,0CAEX,QAAQ,KAChB,QAAQ"}
|
|
@@ -50,7 +50,7 @@ declare function getContextFromEvent(event: any): any;
|
|
|
50
50
|
* ```typescript
|
|
51
51
|
* import { telemetryMiddleware } from '@geekmidas/telescope/instrumentation';
|
|
52
52
|
*
|
|
53
|
-
* const adaptor = new AmazonApiGatewayV2Endpoint(
|
|
53
|
+
* const adaptor = new AmazonApiGatewayV2Endpoint(endpoint, {
|
|
54
54
|
* telemetry: { middleware: telemetryMiddleware() },
|
|
55
55
|
* });
|
|
56
56
|
* ```
|
|
@@ -71,4 +71,4 @@ declare function withEventContext<T>(event: any, fn: () => Promise<T>): Promise<
|
|
|
71
71
|
//# sourceMappingURL=middleware.d.ts.map
|
|
72
72
|
//#endregion
|
|
73
73
|
export { TelemetryMiddlewareOptions, getContextFromEvent, getSpanFromEvent, telemetryMiddleware, withEventContext };
|
|
74
|
-
//# sourceMappingURL=middleware-
|
|
74
|
+
//# sourceMappingURL=middleware-oHvo_ZgU.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"middleware-
|
|
1
|
+
{"version":3,"file":"middleware-oHvo_ZgU.d.mts","names":[],"sources":["../src/instrumentation/middleware.ts"],"sourcesContent":[],"mappings":";;;;;;;;;AAsFG,UAlEc,0BAAA,CAkEd;EAAa;AAyMhB;;;EAEoB,UAAT,CAAA,EAAA,OAAA;EAAO;;AACR;;;;;;;;;;;;;;;;;;;;;;;iBArOM,gBAAA,cAA8B;;;;iBAO9B,mBAAA;;;;;;;;;;;;;iBAgBA,mBAAA,WACN,6BACP,wBAAwB,OAAO;;;;;;;;;;;;iBAyMZ,0CAEX,QAAQ,KAChB,QAAQ"}
|
|
@@ -9,14 +9,14 @@ import { trace } from "@opentelemetry/api";
|
|
|
9
9
|
* ```typescript
|
|
10
10
|
* import { OTelTelemetry } from '@geekmidas/telescope/instrumentation';
|
|
11
11
|
*
|
|
12
|
-
* const adaptor = new AmazonApiGatewayV2Endpoint(
|
|
12
|
+
* const adaptor = new AmazonApiGatewayV2Endpoint(endpoint, {
|
|
13
13
|
* telemetry: new OTelTelemetry(),
|
|
14
14
|
* });
|
|
15
15
|
* ```
|
|
16
16
|
*
|
|
17
17
|
* @example With options
|
|
18
18
|
* ```typescript
|
|
19
|
-
* const adaptor = new AmazonApiGatewayV2Endpoint(
|
|
19
|
+
* const adaptor = new AmazonApiGatewayV2Endpoint(endpoint, {
|
|
20
20
|
* telemetry: new OTelTelemetry({
|
|
21
21
|
* recordBody: true,
|
|
22
22
|
* getUserId: (event) => event.requestContext?.authorizer?.userId,
|
|
@@ -127,4 +127,4 @@ function normalizeHeaders(headers) {
|
|
|
127
127
|
|
|
128
128
|
//#endregion
|
|
129
129
|
export { OTelTelemetry };
|
|
130
|
-
//# sourceMappingURL=otel-
|
|
130
|
+
//# sourceMappingURL=otel-B9bNoeZ2.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"otel-B9bNoeZ2.mjs","names":["options: OTelTelemetryOptions","request: TelemetryRequest","ctx: TelemetryContext","response: TelemetryResponse","error: Error","event: any","lambdaContext: any","route: string | undefined","host: string | undefined","scheme: 'http' | 'https' | undefined","userAgent: string | undefined","clientIp: string | undefined","requestId: string | undefined","attrs: HttpSpanAttributes","headers: Record<string, string | string[] | undefined>","normalized: Record<string, string | string[] | undefined>"],"sources":["../src/instrumentation/otel.ts"],"sourcesContent":["/**\n * OpenTelemetry implementation of the Telemetry interface\n *\n * This provides automatic span creation for Lambda handlers using\n * OpenTelemetry. Works with any OTel-compatible backend (Jaeger, Zipkin,\n * Datadog, Honeycomb, etc.)\n */\nimport { type Span, trace } from '@opentelemetry/api';\nimport type { Context as LambdaContext } from 'aws-lambda';\n\n/**\n * Context object returned by onRequestStart, passed to subsequent hooks.\n * This matches the Telemetry interface from @geekmidas/constructs.\n */\nexport interface TelemetryContext {\n\t[key: string]: unknown;\n}\n\n/**\n * Request information passed to telemetry hooks.\n * This matches the Telemetry interface from @geekmidas/constructs.\n */\nexport interface TelemetryRequest {\n\tevent: any;\n\tcontext: LambdaContext;\n}\n\n/**\n * Response information passed to onRequestEnd.\n * This matches the Telemetry interface from @geekmidas/constructs.\n */\nexport interface TelemetryResponse {\n\tstatusCode: number;\n\tbody?: string;\n\theaders?: Record<string, string>;\n}\n\n/**\n * Telemetry interface for instrumenting endpoint requests.\n * This matches the Telemetry interface from @geekmidas/constructs.\n */\nexport interface Telemetry {\n\tonRequestStart(request: TelemetryRequest): TelemetryContext;\n\tonRequestEnd(ctx: TelemetryContext, response: TelemetryResponse): void;\n\tonRequestError(ctx: TelemetryContext, error: Error): void;\n}\n\nimport {\n\tcreateHttpServerSpan,\n\tendHttpSpan,\n\textractTraceContext,\n\ttype HttpSpanAttributes,\n} from './http';\n\n/**\n * Options for OTelTelemetry\n */\nexport interface OTelTelemetryOptions {\n\t/**\n\t * Whether to record request body as span attribute\n\t * @default false\n\t */\n\trecordBody?: boolean;\n\n\t/**\n\t * Whether to record response body as span attribute\n\t * @default false\n\t */\n\trecordResponseBody?: boolean;\n\n\t/**\n\t * Custom function to extract user ID from event\n\t */\n\tgetUserId?: (event: any) => string | undefined;\n\n\t/**\n\t * Custom function to extract endpoint name from event\n\t */\n\tgetEndpointName?: (event: any) => string | undefined;\n\n\t/**\n\t * Custom function to extract operation ID from event\n\t */\n\tgetOperationId?: (event: any) => string | undefined;\n}\n\n/**\n * Telemetry context with span reference\n */\ninterface OTelContext extends TelemetryContext {\n\tspan: Span;\n\totelContext: any;\n}\n\n/**\n * OpenTelemetry implementation of the Telemetry interface\n *\n * @example\n * ```typescript\n * import { OTelTelemetry } from '@geekmidas/telescope/instrumentation';\n *\n * const adaptor = new AmazonApiGatewayV2Endpoint(endpoint, {\n * telemetry: new OTelTelemetry(),\n * });\n * ```\n *\n * @example With options\n * ```typescript\n * const adaptor = new AmazonApiGatewayV2Endpoint(endpoint, {\n * telemetry: new OTelTelemetry({\n * recordBody: true,\n * getUserId: (event) => event.requestContext?.authorizer?.userId,\n * }),\n * });\n * ```\n */\nexport class OTelTelemetry implements Telemetry {\n\tconstructor(private options: OTelTelemetryOptions = {}) {}\n\n\tonRequestStart(request: TelemetryRequest): TelemetryContext {\n\t\tconst { event, context: lambdaContext } = request;\n\n\t\t// Extract trace context from headers\n\t\tconst headers = normalizeHeaders(event.headers || {});\n\t\tconst parentContext = extractTraceContext(headers);\n\n\t\t// Build span attributes from event\n\t\tconst attrs = this.buildSpanAttributes(event, lambdaContext);\n\n\t\t// Create the span\n\t\tconst span = createHttpServerSpan(attrs, parentContext);\n\t\tconst otelContext = trace.setSpan(parentContext, span);\n\n\t\t// Add Lambda-specific attributes\n\t\tspan.setAttribute('faas.invocation_id', lambdaContext.awsRequestId);\n\t\tspan.setAttribute('faas.name', lambdaContext.functionName);\n\n\t\t// Record body if requested\n\t\tif (this.options.recordBody && event.body) {\n\t\t\tconst bodyStr =\n\t\t\t\ttypeof event.body === 'string'\n\t\t\t\t\t? event.body\n\t\t\t\t\t: JSON.stringify(event.body);\n\t\t\tspan.setAttribute(\n\t\t\t\t'http.request.body',\n\t\t\t\tbodyStr.length > 4096 ? `${bodyStr.slice(0, 4096)}...` : bodyStr,\n\t\t\t);\n\t\t}\n\n\t\treturn { span, otelContext } as OTelContext;\n\t}\n\n\tonRequestEnd(ctx: TelemetryContext, response: TelemetryResponse): void {\n\t\tconst { span } = ctx as OTelContext;\n\n\t\tif (this.options.recordResponseBody && response.body) {\n\t\t\tspan.setAttribute(\n\t\t\t\t'http.response.body',\n\t\t\t\tresponse.body.length > 4096\n\t\t\t\t\t? `${response.body.slice(0, 4096)}...`\n\t\t\t\t\t: response.body,\n\t\t\t);\n\t\t}\n\n\t\tendHttpSpan(span, { statusCode: response.statusCode });\n\t}\n\n\tonRequestError(ctx: TelemetryContext, error: Error): void {\n\t\tconst { span } = ctx as OTelContext;\n\t\tendHttpSpan(span, { statusCode: 500 }, error);\n\t}\n\n\t/**\n\t * Build span attributes from Lambda event\n\t */\n\tprivate buildSpanAttributes(\n\t\tevent: any,\n\t\tlambdaContext: any,\n\t): HttpSpanAttributes {\n\t\t// Detect event type (API Gateway v1, v2, ALB, or direct invoke)\n\t\tconst isV2 =\n\t\t\t'requestContext' in event && 'http' in (event.requestContext || {});\n\t\tconst isV1 =\n\t\t\t'requestContext' in event &&\n\t\t\t'httpMethod' in event &&\n\t\t\t!('http' in (event.requestContext || {}));\n\n\t\tlet method = 'INVOKE';\n\t\tlet path = '/';\n\t\tlet route: string | undefined;\n\t\tlet host: string | undefined;\n\t\tlet scheme: 'http' | 'https' | undefined;\n\t\tlet userAgent: string | undefined;\n\t\tlet clientIp: string | undefined;\n\t\tlet requestId: string | undefined;\n\n\t\tif (isV2) {\n\t\t\t// API Gateway v2 (HTTP API)\n\t\t\tconst http = event.requestContext.http;\n\t\t\tmethod = http.method;\n\t\t\tpath = event.rawPath || http.path;\n\t\t\troute = event.routeKey?.replace(/^[A-Z]+\\s+/, ''); // Remove HTTP method prefix\n\t\t\thost = event.headers?.host;\n\t\t\tscheme = 'https';\n\t\t\tuserAgent = http.userAgent;\n\t\t\tclientIp = http.sourceIp;\n\t\t\trequestId = event.requestContext.requestId;\n\t\t} else if (isV1) {\n\t\t\t// API Gateway v1 (REST API)\n\t\t\tmethod = event.httpMethod;\n\t\t\tpath = event.path;\n\t\t\troute = event.resource;\n\t\t\thost = event.headers?.Host || event.headers?.host;\n\t\t\tscheme = 'https';\n\t\t\tuserAgent =\n\t\t\t\tevent.headers?.['User-Agent'] || event.headers?.['user-agent'];\n\t\t\tclientIp = event.requestContext?.identity?.sourceIp;\n\t\t\trequestId = event.requestContext?.requestId;\n\t\t} else if ('httpMethod' in event) {\n\t\t\t// ALB event\n\t\t\tmethod = event.httpMethod;\n\t\t\tpath = event.path;\n\t\t\thost = event.headers?.host;\n\t\t\tuserAgent =\n\t\t\t\tevent.headers?.['user-agent'] || event.headers?.['User-Agent'];\n\t\t\tclientIp = event.headers?.['x-forwarded-for']?.split(',')[0]?.trim();\n\t\t}\n\n\t\tconst attrs: HttpSpanAttributes = {\n\t\t\tmethod,\n\t\t\tpath,\n\t\t\troute,\n\t\t\thost,\n\t\t\tscheme,\n\t\t\tuserAgent,\n\t\t\tclientIp,\n\t\t\trequestId: requestId || lambdaContext.awsRequestId,\n\t\t};\n\n\t\t// Add endpoint metadata if extractors provided\n\t\tif (this.options.getEndpointName || this.options.getOperationId) {\n\t\t\tattrs.endpoint = {\n\t\t\t\tname: this.options.getEndpointName?.(event),\n\t\t\t\toperationId: this.options.getOperationId?.(event),\n\t\t\t};\n\t\t}\n\n\t\t// Add user metadata if extractor provided\n\t\tif (this.options.getUserId) {\n\t\t\tconst userId = this.options.getUserId(event);\n\t\t\tif (userId) {\n\t\t\t\tattrs.user = { userId };\n\t\t\t}\n\t\t}\n\n\t\treturn attrs;\n\t}\n}\n\n/**\n * Normalize headers to lowercase keys\n */\nfunction normalizeHeaders(\n\theaders: Record<string, string | string[] | undefined>,\n): Record<string, string | string[] | undefined> {\n\tconst normalized: Record<string, string | string[] | undefined> = {};\n\tfor (const [key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Q;EAExB;AAED,SAAO;CACP;AACD;;;;AAKD,SAAS,iBACRC,SACgD;CAChD,MAAMC,aAA4D,CAAE;AACpE,MAAK,MAAM,CAAC,KAAK,MAAM,IAAI,OAAO,QAAQ,QAAQ,CACjD,YAAW,IAAI,aAAa,IAAI;AAEjC,QAAO;AACP"}
|
|
@@ -69,14 +69,14 @@ interface OTelTelemetryOptions {
|
|
|
69
69
|
* ```typescript
|
|
70
70
|
* import { OTelTelemetry } from '@geekmidas/telescope/instrumentation';
|
|
71
71
|
*
|
|
72
|
-
* const adaptor = new AmazonApiGatewayV2Endpoint(
|
|
72
|
+
* const adaptor = new AmazonApiGatewayV2Endpoint(endpoint, {
|
|
73
73
|
* telemetry: new OTelTelemetry(),
|
|
74
74
|
* });
|
|
75
75
|
* ```
|
|
76
76
|
*
|
|
77
77
|
* @example With options
|
|
78
78
|
* ```typescript
|
|
79
|
-
* const adaptor = new AmazonApiGatewayV2Endpoint(
|
|
79
|
+
* const adaptor = new AmazonApiGatewayV2Endpoint(endpoint, {
|
|
80
80
|
* telemetry: new OTelTelemetry({
|
|
81
81
|
* recordBody: true,
|
|
82
82
|
* getUserId: (event) => event.requestContext?.authorizer?.userId,
|
|
@@ -98,4 +98,4 @@ declare class OTelTelemetry implements Telemetry {
|
|
|
98
98
|
//# sourceMappingURL=otel.d.ts.map
|
|
99
99
|
//#endregion
|
|
100
100
|
export { OTelTelemetry, OTelTelemetryOptions, Telemetry, TelemetryContext, TelemetryRequest, TelemetryResponse };
|
|
101
|
-
//# sourceMappingURL=otel-
|
|
101
|
+
//# sourceMappingURL=otel-Bk89b1lX.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"otel-
|
|
1
|
+
{"version":3,"file":"otel-Bk89b1lX.d.cts","names":[],"sources":["../src/instrumentation/otel.ts"],"sourcesContent":[],"mappings":";;;;;;AAcA;AAQA;AASiB,UAjBA,gBAAA,CAiBiB;EAUjB,CAAA,GAAA,EAAA,MAAS,CAAA,EAAA,OAAA;;;;;;AAGL,UAtBJ,gBAAA,CAsBI;EAAgB,KAAS,EAAA,GAAA;EAAK,OAAA,EApBzC,OAoByC;AAanD;AA2DA;;;;AAG4C,UAxF3B,iBAAA,CAwF2B;EAAgB,UAiCzC,EAAA,MAAA;EAAgB,IAAY,CAAA,EAAA,MAAA;EAAiB,OAe3C,CAAA,EArIV,MAqIU,CAAA,MAAA,EAAA,MAAA,CAAA;;;AAnD0B;;;UA3E9B,SAAA;0BACQ,mBAAmB;oBACzB,4BAA4B;sBAC1B,yBAAyB;;;;;UAa7B,oBAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cA2DJ,aAAA,YAAyB;;wBACR;0BAEL,mBAAmB;oBAiCzB,4BAA4B;sBAe1B,yBAAyB"}
|
|
@@ -10,14 +10,14 @@ const __opentelemetry_api = require_chunk.__toESM(require("@opentelemetry/api"))
|
|
|
10
10
|
* ```typescript
|
|
11
11
|
* import { OTelTelemetry } from '@geekmidas/telescope/instrumentation';
|
|
12
12
|
*
|
|
13
|
-
* const adaptor = new AmazonApiGatewayV2Endpoint(
|
|
13
|
+
* const adaptor = new AmazonApiGatewayV2Endpoint(endpoint, {
|
|
14
14
|
* telemetry: new OTelTelemetry(),
|
|
15
15
|
* });
|
|
16
16
|
* ```
|
|
17
17
|
*
|
|
18
18
|
* @example With options
|
|
19
19
|
* ```typescript
|
|
20
|
-
* const adaptor = new AmazonApiGatewayV2Endpoint(
|
|
20
|
+
* const adaptor = new AmazonApiGatewayV2Endpoint(endpoint, {
|
|
21
21
|
* telemetry: new OTelTelemetry({
|
|
22
22
|
* recordBody: true,
|
|
23
23
|
* getUserId: (event) => event.requestContext?.authorizer?.userId,
|
|
@@ -133,4 +133,4 @@ Object.defineProperty(exports, 'OTelTelemetry', {
|
|
|
133
133
|
return OTelTelemetry;
|
|
134
134
|
}
|
|
135
135
|
});
|
|
136
|
-
//# sourceMappingURL=otel-
|
|
136
|
+
//# sourceMappingURL=otel-BzjOtVxZ.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"otel-BzjOtVxZ.cjs","names":["options: OTelTelemetryOptions","request: TelemetryRequest","ctx: TelemetryContext","response: TelemetryResponse","error: Error","event: any","lambdaContext: any","route: string | undefined","host: string | undefined","scheme: 'http' | 'https' | undefined","userAgent: string | undefined","clientIp: string | undefined","requestId: string | undefined","attrs: HttpSpanAttributes","headers: Record<string, string | string[] | undefined>","normalized: Record<string, string | string[] | undefined>"],"sources":["../src/instrumentation/otel.ts"],"sourcesContent":["/**\n * OpenTelemetry implementation of the Telemetry interface\n *\n * This provides automatic span creation for Lambda handlers using\n * OpenTelemetry. Works with any OTel-compatible backend (Jaeger, Zipkin,\n * Datadog, Honeycomb, etc.)\n */\nimport { type Span, trace } from '@opentelemetry/api';\nimport type { Context as LambdaContext } from 'aws-lambda';\n\n/**\n * Context object returned by onRequestStart, passed to subsequent hooks.\n * This matches the Telemetry interface from @geekmidas/constructs.\n */\nexport interface TelemetryContext {\n\t[key: string]: unknown;\n}\n\n/**\n * Request information passed to telemetry hooks.\n * This matches the Telemetry interface from @geekmidas/constructs.\n */\nexport interface TelemetryRequest {\n\tevent: any;\n\tcontext: LambdaContext;\n}\n\n/**\n * Response information passed to onRequestEnd.\n * This matches the Telemetry interface from @geekmidas/constructs.\n */\nexport interface TelemetryResponse {\n\tstatusCode: number;\n\tbody?: string;\n\theaders?: Record<string, string>;\n}\n\n/**\n * Telemetry interface for instrumenting endpoint requests.\n * This matches the Telemetry interface from @geekmidas/constructs.\n */\nexport interface Telemetry {\n\tonRequestStart(request: TelemetryRequest): TelemetryContext;\n\tonRequestEnd(ctx: TelemetryContext, response: TelemetryResponse): void;\n\tonRequestError(ctx: TelemetryContext, error: Error): void;\n}\n\nimport {\n\tcreateHttpServerSpan,\n\tendHttpSpan,\n\textractTraceContext,\n\ttype HttpSpanAttributes,\n} from './http';\n\n/**\n * Options for OTelTelemetry\n */\nexport interface OTelTelemetryOptions {\n\t/**\n\t * Whether to record request body as span attribute\n\t * @default false\n\t */\n\trecordBody?: boolean;\n\n\t/**\n\t * Whether to record response body as span attribute\n\t * @default false\n\t */\n\trecordResponseBody?: boolean;\n\n\t/**\n\t * Custom function to extract user ID from event\n\t */\n\tgetUserId?: (event: any) => string | undefined;\n\n\t/**\n\t * Custom function to extract endpoint name from event\n\t */\n\tgetEndpointName?: (event: any) => string | undefined;\n\n\t/**\n\t * Custom function to extract operation ID from event\n\t */\n\tgetOperationId?: (event: any) => string | undefined;\n}\n\n/**\n * Telemetry context with span reference\n */\ninterface OTelContext extends TelemetryContext {\n\tspan: Span;\n\totelContext: any;\n}\n\n/**\n * OpenTelemetry implementation of the Telemetry interface\n *\n * @example\n * ```typescript\n * import { OTelTelemetry } from '@geekmidas/telescope/instrumentation';\n *\n * const adaptor = new AmazonApiGatewayV2Endpoint(endpoint, {\n * telemetry: new OTelTelemetry(),\n * });\n * ```\n *\n * @example With options\n * ```typescript\n * const adaptor = new AmazonApiGatewayV2Endpoint(endpoint, {\n * telemetry: new OTelTelemetry({\n * recordBody: true,\n * getUserId: (event) => event.requestContext?.authorizer?.userId,\n * }),\n * });\n * ```\n */\nexport class OTelTelemetry implements Telemetry {\n\tconstructor(private options: OTelTelemetryOptions = {}) {}\n\n\tonRequestStart(request: TelemetryRequest): TelemetryContext {\n\t\tconst { event, context: lambdaContext } = request;\n\n\t\t// Extract trace context from headers\n\t\tconst headers = normalizeHeaders(event.headers || {});\n\t\tconst parentContext = extractTraceContext(headers);\n\n\t\t// Build span attributes from event\n\t\tconst attrs = this.buildSpanAttributes(event, lambdaContext);\n\n\t\t// Create the span\n\t\tconst span = createHttpServerSpan(attrs, parentContext);\n\t\tconst otelContext = trace.setSpan(parentContext, span);\n\n\t\t// Add Lambda-specific attributes\n\t\tspan.setAttribute('faas.invocation_id', lambdaContext.awsRequestId);\n\t\tspan.setAttribute('faas.name', lambdaContext.functionName);\n\n\t\t// Record body if requested\n\t\tif (this.options.recordBody && event.body) {\n\t\t\tconst bodyStr =\n\t\t\t\ttypeof event.body === 'string'\n\t\t\t\t\t? event.body\n\t\t\t\t\t: JSON.stringify(event.body);\n\t\t\tspan.setAttribute(\n\t\t\t\t'http.request.body',\n\t\t\t\tbodyStr.length > 4096 ? `${bodyStr.slice(0, 4096)}...` : bodyStr,\n\t\t\t);\n\t\t}\n\n\t\treturn { span, otelContext } as OTelContext;\n\t}\n\n\tonRequestEnd(ctx: TelemetryContext, response: TelemetryResponse): void {\n\t\tconst { span } = ctx as OTelContext;\n\n\t\tif (this.options.recordResponseBody && response.body) {\n\t\t\tspan.setAttribute(\n\t\t\t\t'http.response.body',\n\t\t\t\tresponse.body.length > 4096\n\t\t\t\t\t? `${response.body.slice(0, 4096)}...`\n\t\t\t\t\t: response.body,\n\t\t\t);\n\t\t}\n\n\t\tendHttpSpan(span, { statusCode: response.statusCode });\n\t}\n\n\tonRequestError(ctx: TelemetryContext, error: Error): void {\n\t\tconst { span } = ctx as OTelContext;\n\t\tendHttpSpan(span, { statusCode: 500 }, error);\n\t}\n\n\t/**\n\t * Build span attributes from Lambda event\n\t */\n\tprivate buildSpanAttributes(\n\t\tevent: any,\n\t\tlambdaContext: any,\n\t): HttpSpanAttributes {\n\t\t// Detect event type (API Gateway v1, v2, ALB, or direct invoke)\n\t\tconst isV2 =\n\t\t\t'requestContext' in event && 'http' in (event.requestContext || {});\n\t\tconst isV1 =\n\t\t\t'requestContext' in event &&\n\t\t\t'httpMethod' in event &&\n\t\t\t!('http' in (event.requestContext || {}));\n\n\t\tlet method = 'INVOKE';\n\t\tlet path = '/';\n\t\tlet route: string | undefined;\n\t\tlet host: string | undefined;\n\t\tlet scheme: 'http' | 'https' | undefined;\n\t\tlet userAgent: string | undefined;\n\t\tlet clientIp: string | undefined;\n\t\tlet requestId: string | undefined;\n\n\t\tif (isV2) {\n\t\t\t// API Gateway v2 (HTTP API)\n\t\t\tconst http = event.requestContext.http;\n\t\t\tmethod = http.method;\n\t\t\tpath = event.rawPath || http.path;\n\t\t\troute = event.routeKey?.replace(/^[A-Z]+\\s+/, ''); // Remove HTTP method prefix\n\t\t\thost = event.headers?.host;\n\t\t\tscheme = 'https';\n\t\t\tuserAgent = http.userAgent;\n\t\t\tclientIp = http.sourceIp;\n\t\t\trequestId = event.requestContext.requestId;\n\t\t} else if (isV1) {\n\t\t\t// API Gateway v1 (REST API)\n\t\t\tmethod = event.httpMethod;\n\t\t\tpath = event.path;\n\t\t\troute = event.resource;\n\t\t\thost = event.headers?.Host || event.headers?.host;\n\t\t\tscheme = 'https';\n\t\t\tuserAgent =\n\t\t\t\tevent.headers?.['User-Agent'] || event.headers?.['user-agent'];\n\t\t\tclientIp = event.requestContext?.identity?.sourceIp;\n\t\t\trequestId = event.requestContext?.requestId;\n\t\t} else if ('httpMethod' in event) {\n\t\t\t// ALB event\n\t\t\tmethod = event.httpMethod;\n\t\t\tpath = event.path;\n\t\t\thost = event.headers?.host;\n\t\t\tuserAgent =\n\t\t\t\tevent.headers?.['user-agent'] || event.headers?.['User-Agent'];\n\t\t\tclientIp = event.headers?.['x-forwarded-for']?.split(',')[0]?.trim();\n\t\t}\n\n\t\tconst attrs: HttpSpanAttributes = {\n\t\t\tmethod,\n\t\t\tpath,\n\t\t\troute,\n\t\t\thost,\n\t\t\tscheme,\n\t\t\tuserAgent,\n\t\t\tclientIp,\n\t\t\trequestId: requestId || lambdaContext.awsRequestId,\n\t\t};\n\n\t\t// Add endpoint metadata if extractors provided\n\t\tif (this.options.getEndpointName || this.options.getOperationId) {\n\t\t\tattrs.endpoint = {\n\t\t\t\tname: this.options.getEndpointName?.(event),\n\t\t\t\toperationId: this.options.getOperationId?.(event),\n\t\t\t};\n\t\t}\n\n\t\t// Add user metadata if extractor provided\n\t\tif (this.options.getUserId) {\n\t\t\tconst userId = this.options.getUserId(event);\n\t\t\tif (userId) {\n\t\t\t\tattrs.user = { userId };\n\t\t\t}\n\t\t}\n\n\t\treturn attrs;\n\t}\n}\n\n/**\n * Normalize headers to lowercase keys\n */\nfunction normalizeHeaders(\n\theaders: Record<string, string | string[] | undefined>,\n): Record<string, string | string[] | undefined> {\n\tconst normalized: Record<string, string | string[] | undefined> = {};\n\tfor (const [key, value] of Object.entries(headers)) {\n\t\tnormalized[key.toLowerCase()] = value;\n\t}\n\treturn normalized;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAoHA,IAAa,gBAAb,MAAgD;CAC/C,YAAoBA,UAAgC,CAAE,GAAE;EAApC;CAAsC;CAE1D,eAAeC,SAA6C;EAC3D,MAAM,EAAE,OAAO,SAAS,eAAe,GAAG;EAG1C,MAAM,UAAU,iBAAiB,MAAM,WAAW,CAAE,EAAC;EACrD,MAAM,gBAAgB,iCAAoB,QAAQ;EAGlD,MAAM,QAAQ,KAAK,oBAAoB,OAAO,cAAc;EAG5D,MAAM,OAAO,kCAAqB,OAAO,cAAc;EACvD,MAAM,cAAc,0BAAM,QAAQ,eAAe,KAAK;AAGtD,OAAK,aAAa,sBAAsB,cAAc,aAAa;AACnE,OAAK,aAAa,aAAa,cAAc,aAAa;AAG1D,MAAI,KAAK,QAAQ,cAAc,MAAM,MAAM;GAC1C,MAAM,iBACE,MAAM,SAAS,WACnB,MAAM,OACN,KAAK,UAAU,MAAM,KAAK;AAC9B,QAAK,aACJ,qBACA,QAAQ,SAAS,QAAQ,EAAE,QAAQ,MAAM,GAAG,KAAK,CAAC,OAAO,QACzD;EACD;AAED,SAAO;GAAE;GAAM;EAAa;CAC5B;CAED,aAAaC,KAAuBC,UAAmC;EACtE,MAAM,EAAE,MAAM,GAAG;AAEjB,MAAI,KAAK,QAAQ,sBAAsB,SAAS,KAC/C,MAAK,aACJ,sBACA,SAAS,KAAK,SAAS,QACnB,EAAE,SAAS,KAAK,MAAM,GAAG,KAAK,CAAC,OAChC,SAAS,KACZ;AAGF,2BAAY,MAAM,EAAE,YAAY,SAAS,WAAY,EAAC;CACtD;CAED,eAAeD,KAAuBE,OAAoB;E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,QAAQ,iBAAiB,MAAM;EACjD;AAIF,MAAI,KAAK,QAAQ,WAAW;GAC3B,MAAM,SAAS,KAAK,QAAQ,UAAU,MAAM;AAC5C,OAAI,OACH,OAAM,OAAO,EAAE,OAAQ;EAExB;AAED,SAAO;CACP;AACD;;;;AAKD,SAAS,iBACRC,SACgD;CAChD,MAAMC,aAA4D,CAAE;AACpE,MAAK,MAAM,CAAC,KAAK,MAAM,IAAI,OAAO,QAAQ,QAAQ,CACjD,YAAW,IAAI,aAAa,IAAI;AAEjC,QAAO;AACP"}
|
|
@@ -69,14 +69,14 @@ interface OTelTelemetryOptions {
|
|
|
69
69
|
* ```typescript
|
|
70
70
|
* import { OTelTelemetry } from '@geekmidas/telescope/instrumentation';
|
|
71
71
|
*
|
|
72
|
-
* const adaptor = new AmazonApiGatewayV2Endpoint(
|
|
72
|
+
* const adaptor = new AmazonApiGatewayV2Endpoint(endpoint, {
|
|
73
73
|
* telemetry: new OTelTelemetry(),
|
|
74
74
|
* });
|
|
75
75
|
* ```
|
|
76
76
|
*
|
|
77
77
|
* @example With options
|
|
78
78
|
* ```typescript
|
|
79
|
-
* const adaptor = new AmazonApiGatewayV2Endpoint(
|
|
79
|
+
* const adaptor = new AmazonApiGatewayV2Endpoint(endpoint, {
|
|
80
80
|
* telemetry: new OTelTelemetry({
|
|
81
81
|
* recordBody: true,
|
|
82
82
|
* getUserId: (event) => event.requestContext?.authorizer?.userId,
|
|
@@ -98,4 +98,4 @@ declare class OTelTelemetry implements Telemetry {
|
|
|
98
98
|
//# sourceMappingURL=otel.d.ts.map
|
|
99
99
|
//#endregion
|
|
100
100
|
export { OTelTelemetry, OTelTelemetryOptions, Telemetry, TelemetryContext, TelemetryRequest, TelemetryResponse };
|
|
101
|
-
//# sourceMappingURL=otel-
|
|
101
|
+
//# sourceMappingURL=otel-lPMsM26e.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"otel-
|
|
1
|
+
{"version":3,"file":"otel-lPMsM26e.d.mts","names":[],"sources":["../src/instrumentation/otel.ts"],"sourcesContent":[],"mappings":";;;;;;AAcA;AAQA;AASiB,UAjBA,gBAAA,CAiBiB;EAUjB,CAAA,GAAA,EAAA,MAAS,CAAA,EAAA,OAAA;;;;;;AAGL,UAtBJ,gBAAA,CAsBI;EAAgB,KAAS,EAAA,GAAA;EAAK,OAAA,EApBzC,OAoByC;AAanD;AA2DA;;;;AAG4C,UAxF3B,iBAAA,CAwF2B;EAAgB,UAiCzC,EAAA,MAAA;EAAgB,IAAY,CAAA,EAAA,MAAA;EAAiB,OAe3C,CAAA,EArIV,MAqIU,CAAA,MAAA,EAAA,MAAA,CAAA;;;AAnD0B;;;UA3E9B,SAAA;0BACQ,mBAAmB;oBACzB,4BAA4B;sBAC1B,yBAAyB;;;;;UAa7B,oBAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cA2DJ,aAAA,YAAyB;;wBACR;0BAEL,mBAAmB;oBAiCzB,4BAA4B;sBAe1B,yBAAyB"}
|