@geekmidas/telescope 1.0.1 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (74) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/dist/adapters/lambda.cjs +1 -1
  3. package/dist/adapters/lambda.mjs +1 -1
  4. package/dist/adapters/middy.cjs +1 -1
  5. package/dist/adapters/middy.mjs +1 -1
  6. package/dist/{hono-DxhvnVbF.mjs → hono-Bz9PQQzj.mjs} +2 -2
  7. package/dist/{hono-DxhvnVbF.mjs.map → hono-Bz9PQQzj.mjs.map} +1 -1
  8. package/dist/{hono-C4EgpbKQ.cjs → hono-Z_JIICmt.cjs} +2 -2
  9. package/dist/{hono-C4EgpbKQ.cjs.map → hono-Z_JIICmt.cjs.map} +1 -1
  10. package/dist/{http-DQzgLczm.mjs → http-Crsriv32.mjs} +1 -1
  11. package/dist/{http-DQzgLczm.mjs.map → http-Crsriv32.mjs.map} +1 -1
  12. package/dist/{http-BiNtg85L.d.mts → http-D5kn3_Mt.d.mts} +3 -3
  13. package/dist/{http-BiNtg85L.d.mts.map → http-D5kn3_Mt.d.mts.map} +1 -1
  14. package/dist/{http-D_Z8sYXZ.cjs → http-JycFRfSe.cjs} +1 -1
  15. package/dist/{http-D_Z8sYXZ.cjs.map → http-JycFRfSe.cjs.map} +1 -1
  16. package/dist/instrumentation/hono.cjs +2 -2
  17. package/dist/instrumentation/hono.mjs +2 -2
  18. package/dist/instrumentation/http.cjs +1 -1
  19. package/dist/instrumentation/http.d.mts +1 -1
  20. package/dist/instrumentation/http.mjs +1 -1
  21. package/dist/instrumentation/index.cjs +5 -5
  22. package/dist/instrumentation/index.d.mts +1 -1
  23. package/dist/instrumentation/index.mjs +5 -5
  24. package/dist/instrumentation/middleware.cjs +2 -2
  25. package/dist/instrumentation/middleware.mjs +2 -2
  26. package/dist/instrumentation/otel.cjs +2 -2
  27. package/dist/instrumentation/otel.mjs +2 -2
  28. package/dist/instrumentation/setup.cjs +1 -1
  29. package/dist/instrumentation/setup.mjs +1 -1
  30. package/dist/logger/console.d.mts.map +1 -1
  31. package/dist/logger/pino.d.mts +2 -2
  32. package/dist/{middleware-B2jFUukM.cjs → middleware-D3v5SnSs.cjs} +2 -2
  33. package/dist/{middleware-B2jFUukM.cjs.map → middleware-D3v5SnSs.cjs.map} +1 -1
  34. package/dist/{middleware-BTDncHwm.mjs → middleware-Dy1ctr2N.mjs} +2 -2
  35. package/dist/{middleware-BTDncHwm.mjs.map → middleware-Dy1ctr2N.mjs.map} +1 -1
  36. package/dist/{middy-BTR3cyvk.mjs → middy-DHWLmUAD.mjs} +1 -1
  37. package/dist/{middy-BTR3cyvk.mjs.map → middy-DHWLmUAD.mjs.map} +1 -1
  38. package/dist/{middy-y5Zp27eG.cjs → middy-DlWnZilH.cjs} +1 -1
  39. package/dist/{middy-y5Zp27eG.cjs.map → middy-DlWnZilH.cjs.map} +1 -1
  40. package/dist/{otel-wulj5B-X.mjs → otel-DPKNyJ0t.mjs} +2 -2
  41. package/dist/{otel-wulj5B-X.mjs.map → otel-DPKNyJ0t.mjs.map} +1 -1
  42. package/dist/{otel-C1HqHA2O.cjs → otel-DuiBeBPU.cjs} +2 -2
  43. package/dist/{otel-C1HqHA2O.cjs.map → otel-DuiBeBPU.cjs.map} +1 -1
  44. package/dist/otlp/hono.cjs +3 -3
  45. package/dist/otlp/hono.mjs +3 -3
  46. package/dist/otlp/index.cjs +3 -3
  47. package/dist/otlp/index.mjs +3 -3
  48. package/dist/otlp/receiver.cjs +3 -3
  49. package/dist/otlp/receiver.mjs +3 -3
  50. package/dist/otlp/transformer.cjs +2 -2
  51. package/dist/otlp/transformer.mjs +2 -2
  52. package/dist/otlp/types.cjs +1 -1
  53. package/dist/otlp/types.mjs +1 -1
  54. package/dist/{receiver-Cj1lbAOO.cjs → receiver-BW_4go_X.cjs} +2 -2
  55. package/dist/{receiver-Cj1lbAOO.cjs.map → receiver-BW_4go_X.cjs.map} +1 -1
  56. package/dist/{receiver-CxVd_9CB.mjs → receiver-q4f7eirs.mjs} +2 -2
  57. package/dist/{receiver-CxVd_9CB.mjs.map → receiver-q4f7eirs.mjs.map} +1 -1
  58. package/dist/{setup-B9jM77Qk.mjs → setup-BhCp2LUp.mjs} +1 -1
  59. package/dist/{setup-B9jM77Qk.mjs.map → setup-BhCp2LUp.mjs.map} +1 -1
  60. package/dist/{setup-CYpff5B9.cjs → setup-_uT4L_x5.cjs} +1 -1
  61. package/dist/{setup-CYpff5B9.cjs.map → setup-_uT4L_x5.cjs.map} +1 -1
  62. package/dist/storage/kysely.d.cts.map +1 -1
  63. package/dist/tracing-BX8uY2nR.d.cts.map +1 -1
  64. package/dist/tracing-PnECEbEu.d.mts.map +1 -1
  65. package/dist/{transformer-BXQPhzql.mjs → transformer-CFrJQkUg.mjs} +2 -2
  66. package/dist/{transformer-BXQPhzql.mjs.map → transformer-CFrJQkUg.mjs.map} +1 -1
  67. package/dist/{transformer-CLGZ0EQc.cjs → transformer-DvDYyFRQ.cjs} +2 -2
  68. package/dist/{transformer-CLGZ0EQc.cjs.map → transformer-DvDYyFRQ.cjs.map} +1 -1
  69. package/dist/types-B1EIa_cQ.d.mts.map +1 -1
  70. package/dist/{types-Dsh-DIO_.cjs → types-BBeTDpHr.cjs} +1 -1
  71. package/dist/{types-Dsh-DIO_.cjs.map → types-BBeTDpHr.cjs.map} +1 -1
  72. package/dist/{types-Bwm_jNU7.mjs → types-CXYLhG_G.mjs} +1 -1
  73. package/dist/{types-Bwm_jNU7.mjs.map → types-CXYLhG_G.mjs.map} +1 -1
  74. package/package.json +3 -3
@@ -1 +1 @@
1
- {"version":3,"file":"setup-B9jM77Qk.mjs","names":["sdk: NodeSDK | null","options: TelemetryOptions","traceExporter: SpanExporter"],"sources":["../src/instrumentation/setup.ts"],"sourcesContent":["import { DiagConsoleLogger, DiagLogLevel, diag } from '@opentelemetry/api';\nimport { getNodeAutoInstrumentations } from '@opentelemetry/auto-instrumentations-node';\nimport { OTLPLogExporter } from '@opentelemetry/exporter-logs-otlp-http';\nimport { OTLPTraceExporter } from '@opentelemetry/exporter-trace-otlp-http';\nimport { PinoInstrumentation } from '@opentelemetry/instrumentation-pino';\nimport { Resource } from '@opentelemetry/resources';\nimport {\n\tBatchLogRecordProcessor,\n\tLoggerProvider,\n} from '@opentelemetry/sdk-logs';\nimport { NodeSDK } from '@opentelemetry/sdk-node';\nimport {\n\tConsoleSpanExporter,\n\ttype SpanExporter,\n} from '@opentelemetry/sdk-trace-node';\nimport {\n\tATTR_SERVICE_NAME,\n\tATTR_SERVICE_VERSION,\n} from '@opentelemetry/semantic-conventions';\nimport type { SpanProcessorStrategy } from '../adapters/types';\nimport {\n\tcreateSpanProcessor,\n\tgetRecommendedStrategy,\n\tsetGlobalLogProcessor,\n\tsetGlobalSpanProcessor,\n} from './core';\n\n/**\n * Options for configuring telemetry\n */\nexport interface TelemetryOptions {\n\t/**\n\t * Service name for resource identification\n\t */\n\tserviceName: string;\n\n\t/**\n\t * Service version\n\t */\n\tserviceVersion?: string;\n\n\t/**\n\t * OTLP endpoint URL (e.g., 'http://localhost:3000/__telescope/v1')\n\t * If not provided, traces will be logged to console\n\t */\n\tendpoint?: string;\n\n\t/**\n\t * Whether to instrument Pino for log correlation\n\t * @default true\n\t */\n\tinstrumentPino?: boolean;\n\n\t/**\n\t * Whether to enable auto-instrumentation for common libraries\n\t * (http, fetch, express, etc.)\n\t * @default true\n\t */\n\tautoInstrument?: boolean;\n\n\t/**\n\t * Enable debug logging for OTel SDK\n\t * @default false\n\t */\n\tdebug?: boolean;\n\n\t/**\n\t * Additional resource attributes\n\t */\n\tresourceAttributes?: Record<string, string>;\n\n\t/**\n\t * Headers to send with OTLP requests\n\t */\n\theaders?: Record<string, string>;\n\n\t/**\n\t * Span processor strategy.\n\t * - 'batch': Efficient batching for long-running servers (default)\n\t * - 'simple': Immediate export for serverless environments (Lambda, Edge)\n\t *\n\t * If not specified, automatically selected based on environment detection.\n\t */\n\tspanProcessorStrategy?: SpanProcessorStrategy;\n\n\t/**\n\t * Environment type for automatic configuration\n\t * @default 'server'\n\t */\n\tenvironment?: 'server' | 'lambda' | 'edge' | 'custom';\n}\n\nlet sdk: NodeSDK | null = null;\n\n/**\n * Set up OpenTelemetry instrumentation.\n * Call this BEFORE importing your application code.\n *\n * @example\n * ```typescript\n * // instrumentation.ts (create this file)\n * import { setupTelemetry } from '@geekmidas/telescope/instrumentation';\n *\n * setupTelemetry({\n * serviceName: 'my-api',\n * endpoint: 'http://localhost:3000/__telescope/v1',\n * });\n *\n * // Then in your entry point:\n * // import './instrumentation';\n * // import { app } from './app';\n * ```\n */\nexport function setupTelemetry(options: TelemetryOptions): void {\n\tif (sdk) {\n\t\treturn;\n\t}\n\n\tconst {\n\t\tserviceName,\n\t\tserviceVersion = '1.0.0',\n\t\tendpoint,\n\t\tinstrumentPino = true,\n\t\tautoInstrument = true,\n\t\tdebug = false,\n\t\tresourceAttributes = {},\n\t\theaders = {},\n\t\tspanProcessorStrategy,\n\t\tenvironment = 'server',\n\t} = options;\n\n\t// Enable debug logging if requested\n\tif (debug) {\n\t\tdiag.setLogger(new DiagConsoleLogger(), DiagLogLevel.DEBUG);\n\t}\n\n\t// Create resource\n\tconst resource = new Resource({\n\t\t[ATTR_SERVICE_NAME]: serviceName,\n\t\t[ATTR_SERVICE_VERSION]: serviceVersion,\n\t\t...resourceAttributes,\n\t});\n\n\t// Build instrumentations list\n\tconst instrumentations = [];\n\n\t// Add Pino instrumentation for log correlation\n\tif (instrumentPino) {\n\t\tinstrumentations.push(\n\t\t\tnew PinoInstrumentation({\n\t\t\t\t// Inject trace context into log records\n\t\t\t\tlogHook: (span, record) => {\n\t\t\t\t\trecord.trace_id = span.spanContext().traceId;\n\t\t\t\t\trecord.span_id = span.spanContext().spanId;\n\t\t\t\t\trecord.trace_flags = span.spanContext().traceFlags;\n\t\t\t\t},\n\t\t\t}),\n\t\t);\n\t}\n\n\t// Add auto-instrumentations for common libraries\n\tif (autoInstrument) {\n\t\tinstrumentations.push(\n\t\t\tgetNodeAutoInstrumentations({\n\t\t\t\t// Disable file system instrumentation (too noisy)\n\t\t\t\t'@opentelemetry/instrumentation-fs': { enabled: false },\n\t\t\t\t// Configure HTTP instrumentation\n\t\t\t\t'@opentelemetry/instrumentation-http': {\n\t\t\t\t\tignoreIncomingRequestHook: (request) => {\n\t\t\t\t\t\t// Ignore health checks and internal routes\n\t\t\t\t\t\tconst path = request.url || '';\n\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\tpath.includes('/__health') ||\n\t\t\t\t\t\t\tpath.includes('/__telescope') ||\n\t\t\t\t\t\t\tpath.includes('/favicon')\n\t\t\t\t\t\t);\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t}),\n\t\t);\n\t}\n\n\t// Create exporters\n\tlet traceExporter: SpanExporter;\n\tif (endpoint) {\n\t\ttraceExporter = new OTLPTraceExporter({\n\t\t\turl: `${endpoint}/traces`,\n\t\t\theaders,\n\t\t});\n\t} else {\n\t\t// Fall back to console exporter for debugging\n\t\ttraceExporter = new ConsoleSpanExporter();\n\t}\n\n\t// Determine span processor strategy\n\tconst strategy = spanProcessorStrategy ?? getRecommendedStrategy(environment);\n\tconst spanProcessor = createSpanProcessor(traceExporter, { strategy });\n\n\t// Register globally for flush operations\n\tsetGlobalSpanProcessor(spanProcessor);\n\n\t// Create and configure SDK\n\tsdk = new NodeSDK({\n\t\tresource,\n\t\ttraceExporter,\n\t\tspanProcessors: [spanProcessor],\n\t\tinstrumentations,\n\t});\n\n\t// Set up log exporter if endpoint is provided\n\tif (endpoint) {\n\t\tconst logExporter = new OTLPLogExporter({\n\t\t\turl: `${endpoint}/logs`,\n\t\t\theaders,\n\t\t});\n\n\t\tconst loggerProvider = new LoggerProvider({ resource });\n\t\tconst logProcessor = new BatchLogRecordProcessor(logExporter);\n\t\tloggerProvider.addLogRecordProcessor(logProcessor);\n\n\t\t// Register for flush operations\n\t\tsetGlobalLogProcessor(logProcessor);\n\t}\n\n\t// Start the SDK\n\tsdk.start();\n\n\t// Graceful shutdown\n\tprocess.on('SIGTERM', () => {\n\t\tsdk\n\t\t\t?.shutdown()\n\t\t\t.then(() => {})\n\t\t\t.catch((_error) => {})\n\t\t\t.finally(() => process.exit(0));\n\t});\n}\n\n/**\n * Shut down telemetry (for testing or graceful shutdown)\n */\nexport async function shutdownTelemetry(): Promise<void> {\n\tif (sdk) {\n\t\tawait sdk.shutdown();\n\t\tsdk = null;\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;AA4FA,IAAIA,MAAsB;;;;;;;;;;;;;;;;;;;;AAqB1B,SAAgB,eAAeC,SAAiC;AAC/D,KAAI,IACH;CAGD,MAAM,EACL,aACA,iBAAiB,SACjB,UACA,iBAAiB,MACjB,iBAAiB,MACjB,QAAQ,OACR,qBAAqB,CAAE,GACvB,UAAU,CAAE,GACZ,uBACA,cAAc,UACd,GAAG;AAGJ,KAAI,MACH,MAAK,UAAU,IAAI,qBAAqB,aAAa,MAAM;CAI5D,MAAM,WAAW,IAAI,SAAS;GAC5B,oBAAoB;GACpB,uBAAuB;EACxB,GAAG;CACH;CAGD,MAAM,mBAAmB,CAAE;AAG3B,KAAI,eACH,kBAAiB,KAChB,IAAI,oBAAoB,EAEvB,SAAS,CAAC,MAAM,WAAW;AAC1B,SAAO,WAAW,KAAK,aAAa,CAAC;AACrC,SAAO,UAAU,KAAK,aAAa,CAAC;AACpC,SAAO,cAAc,KAAK,aAAa,CAAC;CACxC,EACD,GACD;AAIF,KAAI,eACH,kBAAiB,KAChB,4BAA4B;EAE3B,qCAAqC,EAAE,SAAS,MAAO;EAEvD,uCAAuC,EACtC,2BAA2B,CAAC,YAAY;GAEvC,MAAM,OAAO,QAAQ,OAAO;AAC5B,UACC,KAAK,SAAS,YAAY,IAC1B,KAAK,SAAS,eAAe,IAC7B,KAAK,SAAS,WAAW;EAE1B,EACD;CACD,EAAC,CACF;CAIF,IAAIC;AACJ,KAAI,SACH,iBAAgB,IAAI,kBAAkB;EACrC,MAAM,EAAE,SAAS;EACjB;CACA;KAGD,iBAAgB,IAAI;CAIrB,MAAM,WAAW,yBAAyB,uBAAuB,YAAY;CAC7E,MAAM,gBAAgB,oBAAoB,eAAe,EAAE,SAAU,EAAC;AAGtE,wBAAuB,cAAc;AAGrC,OAAM,IAAI,QAAQ;EACjB;EACA;EACA,gBAAgB,CAAC,aAAc;EAC/B;CACA;AAGD,KAAI,UAAU;EACb,MAAM,cAAc,IAAI,gBAAgB;GACvC,MAAM,EAAE,SAAS;GACjB;EACA;EAED,MAAM,iBAAiB,IAAI,eAAe,EAAE,SAAU;EACtD,MAAM,eAAe,IAAI,wBAAwB;AACjD,iBAAe,sBAAsB,aAAa;AAGlD,wBAAsB,aAAa;CACnC;AAGD,KAAI,OAAO;AAGX,SAAQ,GAAG,WAAW,MAAM;AAC3B,OACG,UAAU,CACX,KAAK,MAAM,CAAE,EAAC,CACd,MAAM,CAAC,WAAW,CAAE,EAAC,CACrB,QAAQ,MAAM,QAAQ,KAAK,EAAE,CAAC;CAChC,EAAC;AACF;;;;AAKD,eAAsB,oBAAmC;AACxD,KAAI,KAAK;AACR,QAAM,IAAI,UAAU;AACpB,QAAM;CACN;AACD"}
1
+ {"version":3,"file":"setup-BhCp2LUp.mjs","names":["sdk: NodeSDK | null","options: TelemetryOptions","traceExporter: SpanExporter"],"sources":["../src/instrumentation/setup.ts"],"sourcesContent":["import { DiagConsoleLogger, DiagLogLevel, diag } from '@opentelemetry/api';\nimport { getNodeAutoInstrumentations } from '@opentelemetry/auto-instrumentations-node';\nimport { OTLPLogExporter } from '@opentelemetry/exporter-logs-otlp-http';\nimport { OTLPTraceExporter } from '@opentelemetry/exporter-trace-otlp-http';\nimport { PinoInstrumentation } from '@opentelemetry/instrumentation-pino';\nimport { Resource } from '@opentelemetry/resources';\nimport {\n\tBatchLogRecordProcessor,\n\tLoggerProvider,\n} from '@opentelemetry/sdk-logs';\nimport { NodeSDK } from '@opentelemetry/sdk-node';\nimport {\n\tConsoleSpanExporter,\n\ttype SpanExporter,\n} from '@opentelemetry/sdk-trace-node';\nimport {\n\tATTR_SERVICE_NAME,\n\tATTR_SERVICE_VERSION,\n} from '@opentelemetry/semantic-conventions';\nimport type { SpanProcessorStrategy } from '../adapters/types';\nimport {\n\tcreateSpanProcessor,\n\tgetRecommendedStrategy,\n\tsetGlobalLogProcessor,\n\tsetGlobalSpanProcessor,\n} from './core';\n\n/**\n * Options for configuring telemetry\n */\nexport interface TelemetryOptions {\n\t/**\n\t * Service name for resource identification\n\t */\n\tserviceName: string;\n\n\t/**\n\t * Service version\n\t */\n\tserviceVersion?: string;\n\n\t/**\n\t * OTLP endpoint URL (e.g., 'http://localhost:3000/__telescope/v1')\n\t * If not provided, traces will be logged to console\n\t */\n\tendpoint?: string;\n\n\t/**\n\t * Whether to instrument Pino for log correlation\n\t * @default true\n\t */\n\tinstrumentPino?: boolean;\n\n\t/**\n\t * Whether to enable auto-instrumentation for common libraries\n\t * (http, fetch, express, etc.)\n\t * @default true\n\t */\n\tautoInstrument?: boolean;\n\n\t/**\n\t * Enable debug logging for OTel SDK\n\t * @default false\n\t */\n\tdebug?: boolean;\n\n\t/**\n\t * Additional resource attributes\n\t */\n\tresourceAttributes?: Record<string, string>;\n\n\t/**\n\t * Headers to send with OTLP requests\n\t */\n\theaders?: Record<string, string>;\n\n\t/**\n\t * Span processor strategy.\n\t * - 'batch': Efficient batching for long-running servers (default)\n\t * - 'simple': Immediate export for serverless environments (Lambda, Edge)\n\t *\n\t * If not specified, automatically selected based on environment detection.\n\t */\n\tspanProcessorStrategy?: SpanProcessorStrategy;\n\n\t/**\n\t * Environment type for automatic configuration\n\t * @default 'server'\n\t */\n\tenvironment?: 'server' | 'lambda' | 'edge' | 'custom';\n}\n\nlet sdk: NodeSDK | null = null;\n\n/**\n * Set up OpenTelemetry instrumentation.\n * Call this BEFORE importing your application code.\n *\n * @example\n * ```typescript\n * // instrumentation.ts (create this file)\n * import { setupTelemetry } from '@geekmidas/telescope/instrumentation';\n *\n * setupTelemetry({\n * serviceName: 'my-api',\n * endpoint: 'http://localhost:3000/__telescope/v1',\n * });\n *\n * // Then in your entry point:\n * // import './instrumentation';\n * // import { app } from './app';\n * ```\n */\nexport function setupTelemetry(options: TelemetryOptions): void {\n\tif (sdk) {\n\t\treturn;\n\t}\n\n\tconst {\n\t\tserviceName,\n\t\tserviceVersion = '1.0.0',\n\t\tendpoint,\n\t\tinstrumentPino = true,\n\t\tautoInstrument = true,\n\t\tdebug = false,\n\t\tresourceAttributes = {},\n\t\theaders = {},\n\t\tspanProcessorStrategy,\n\t\tenvironment = 'server',\n\t} = options;\n\n\t// Enable debug logging if requested\n\tif (debug) {\n\t\tdiag.setLogger(new DiagConsoleLogger(), DiagLogLevel.DEBUG);\n\t}\n\n\t// Create resource\n\tconst resource = new Resource({\n\t\t[ATTR_SERVICE_NAME]: serviceName,\n\t\t[ATTR_SERVICE_VERSION]: serviceVersion,\n\t\t...resourceAttributes,\n\t});\n\n\t// Build instrumentations list\n\tconst instrumentations = [];\n\n\t// Add Pino instrumentation for log correlation\n\tif (instrumentPino) {\n\t\tinstrumentations.push(\n\t\t\tnew PinoInstrumentation({\n\t\t\t\t// Inject trace context into log records\n\t\t\t\tlogHook: (span, record) => {\n\t\t\t\t\trecord.trace_id = span.spanContext().traceId;\n\t\t\t\t\trecord.span_id = span.spanContext().spanId;\n\t\t\t\t\trecord.trace_flags = span.spanContext().traceFlags;\n\t\t\t\t},\n\t\t\t}),\n\t\t);\n\t}\n\n\t// Add auto-instrumentations for common libraries\n\tif (autoInstrument) {\n\t\tinstrumentations.push(\n\t\t\tgetNodeAutoInstrumentations({\n\t\t\t\t// Disable file system instrumentation (too noisy)\n\t\t\t\t'@opentelemetry/instrumentation-fs': { enabled: false },\n\t\t\t\t// Configure HTTP instrumentation\n\t\t\t\t'@opentelemetry/instrumentation-http': {\n\t\t\t\t\tignoreIncomingRequestHook: (request) => {\n\t\t\t\t\t\t// Ignore health checks and internal routes\n\t\t\t\t\t\tconst path = request.url || '';\n\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\tpath.includes('/__health') ||\n\t\t\t\t\t\t\tpath.includes('/__telescope') ||\n\t\t\t\t\t\t\tpath.includes('/favicon')\n\t\t\t\t\t\t);\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t}),\n\t\t);\n\t}\n\n\t// Create exporters\n\tlet traceExporter: SpanExporter;\n\tif (endpoint) {\n\t\ttraceExporter = new OTLPTraceExporter({\n\t\t\turl: `${endpoint}/traces`,\n\t\t\theaders,\n\t\t});\n\t} else {\n\t\t// Fall back to console exporter for debugging\n\t\ttraceExporter = new ConsoleSpanExporter();\n\t}\n\n\t// Determine span processor strategy\n\tconst strategy = spanProcessorStrategy ?? getRecommendedStrategy(environment);\n\tconst spanProcessor = createSpanProcessor(traceExporter, { strategy });\n\n\t// Register globally for flush operations\n\tsetGlobalSpanProcessor(spanProcessor);\n\n\t// Create and configure SDK\n\tsdk = new NodeSDK({\n\t\tresource,\n\t\ttraceExporter,\n\t\tspanProcessors: [spanProcessor],\n\t\tinstrumentations,\n\t});\n\n\t// Set up log exporter if endpoint is provided\n\tif (endpoint) {\n\t\tconst logExporter = new OTLPLogExporter({\n\t\t\turl: `${endpoint}/logs`,\n\t\t\theaders,\n\t\t});\n\n\t\tconst loggerProvider = new LoggerProvider({ resource });\n\t\tconst logProcessor = new BatchLogRecordProcessor(logExporter);\n\t\tloggerProvider.addLogRecordProcessor(logProcessor);\n\n\t\t// Register for flush operations\n\t\tsetGlobalLogProcessor(logProcessor);\n\t}\n\n\t// Start the SDK\n\tsdk.start();\n\n\t// Graceful shutdown\n\tprocess.on('SIGTERM', () => {\n\t\tsdk\n\t\t\t?.shutdown()\n\t\t\t.then(() => {})\n\t\t\t.catch((_error) => {})\n\t\t\t.finally(() => process.exit(0));\n\t});\n}\n\n/**\n * Shut down telemetry (for testing or graceful shutdown)\n */\nexport async function shutdownTelemetry(): Promise<void> {\n\tif (sdk) {\n\t\tawait sd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U;EACb,MAAM,cAAc,IAAI,gBAAgB;GACvC,MAAM,EAAE,SAAS;GACjB;EACA;EAED,MAAM,iBAAiB,IAAI,eAAe,EAAE,SAAU;EACtD,MAAM,eAAe,IAAI,wBAAwB;AACjD,iBAAe,sBAAsB,aAAa;AAGlD,wBAAsB,aAAa;CACnC;AAGD,KAAI,OAAO;AAGX,SAAQ,GAAG,WAAW,MAAM;AAC3B,OACG,UAAU,CACX,KAAK,MAAM,CAAE,EAAC,CACd,MAAM,CAAC,WAAW,CAAE,EAAC,CACrB,QAAQ,MAAM,QAAQ,KAAK,EAAE,CAAC;CAChC,EAAC;AACF;;;;AAKD,eAAsB,oBAAmC;AACxD,KAAI,KAAK;AACR,QAAM,IAAI,UAAU;AACpB,QAAM;CACN;AACD"}
@@ -107,4 +107,4 @@ Object.defineProperty(exports, 'shutdownTelemetry', {
107
107
  return shutdownTelemetry;
108
108
  }
109
109
  });
110
- //# sourceMappingURL=setup-CYpff5B9.cjs.map
110
+ //# sourceMappingURL=setup-_uT4L_x5.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"setup-CYpff5B9.cjs","names":["sdk: NodeSDK | null","options: TelemetryOptions","DiagConsoleLogger","DiagLogLevel","Resource","ATTR_SERVICE_NAME","ATTR_SERVICE_VERSION","PinoInstrumentation","traceExporter: SpanExporter","OTLPTraceExporter","ConsoleSpanExporter","NodeSDK","OTLPLogExporter","LoggerProvider","BatchLogRecordProcessor"],"sources":["../src/instrumentation/setup.ts"],"sourcesContent":["import { DiagConsoleLogger, DiagLogLevel, diag } from '@opentelemetry/api';\nimport { getNodeAutoInstrumentations } from '@opentelemetry/auto-instrumentations-node';\nimport { OTLPLogExporter } from '@opentelemetry/exporter-logs-otlp-http';\nimport { OTLPTraceExporter } from '@opentelemetry/exporter-trace-otlp-http';\nimport { PinoInstrumentation } from '@opentelemetry/instrumentation-pino';\nimport { Resource } from '@opentelemetry/resources';\nimport {\n\tBatchLogRecordProcessor,\n\tLoggerProvider,\n} from '@opentelemetry/sdk-logs';\nimport { NodeSDK } from '@opentelemetry/sdk-node';\nimport {\n\tConsoleSpanExporter,\n\ttype SpanExporter,\n} from '@opentelemetry/sdk-trace-node';\nimport {\n\tATTR_SERVICE_NAME,\n\tATTR_SERVICE_VERSION,\n} from '@opentelemetry/semantic-conventions';\nimport type { SpanProcessorStrategy } from '../adapters/types';\nimport {\n\tcreateSpanProcessor,\n\tgetRecommendedStrategy,\n\tsetGlobalLogProcessor,\n\tsetGlobalSpanProcessor,\n} from './core';\n\n/**\n * Options for configuring telemetry\n */\nexport interface TelemetryOptions {\n\t/**\n\t * Service name for resource identification\n\t */\n\tserviceName: string;\n\n\t/**\n\t * Service version\n\t */\n\tserviceVersion?: string;\n\n\t/**\n\t * OTLP endpoint URL (e.g., 'http://localhost:3000/__telescope/v1')\n\t * If not provided, traces will be logged to console\n\t */\n\tendpoint?: string;\n\n\t/**\n\t * Whether to instrument Pino for log correlation\n\t * @default true\n\t */\n\tinstrumentPino?: boolean;\n\n\t/**\n\t * Whether to enable auto-instrumentation for common libraries\n\t * (http, fetch, express, etc.)\n\t * @default true\n\t */\n\tautoInstrument?: boolean;\n\n\t/**\n\t * Enable debug logging for OTel SDK\n\t * @default false\n\t */\n\tdebug?: boolean;\n\n\t/**\n\t * Additional resource attributes\n\t */\n\tresourceAttributes?: Record<string, string>;\n\n\t/**\n\t * Headers to send with OTLP requests\n\t */\n\theaders?: Record<string, string>;\n\n\t/**\n\t * Span processor strategy.\n\t * - 'batch': Efficient batching for long-running servers (default)\n\t * - 'simple': Immediate export for serverless environments (Lambda, Edge)\n\t *\n\t * If not specified, automatically selected based on environment detection.\n\t */\n\tspanProcessorStrategy?: SpanProcessorStrategy;\n\n\t/**\n\t * Environment type for automatic configuration\n\t * @default 'server'\n\t */\n\tenvironment?: 'server' | 'lambda' | 'edge' | 'custom';\n}\n\nlet sdk: NodeSDK | null = null;\n\n/**\n * Set up OpenTelemetry instrumentation.\n * Call this BEFORE importing your application code.\n *\n * @example\n * ```typescript\n * // instrumentation.ts (create this file)\n * import { setupTelemetry } from '@geekmidas/telescope/instrumentation';\n *\n * setupTelemetry({\n * serviceName: 'my-api',\n * endpoint: 'http://localhost:3000/__telescope/v1',\n * });\n *\n * // Then in your entry point:\n * // import './instrumentation';\n * // import { app } from './app';\n * ```\n */\nexport function setupTelemetry(options: TelemetryOptions): void {\n\tif (sdk) {\n\t\treturn;\n\t}\n\n\tconst {\n\t\tserviceName,\n\t\tserviceVersion = '1.0.0',\n\t\tendpoint,\n\t\tinstrumentPino = true,\n\t\tautoInstrument = true,\n\t\tdebug = false,\n\t\tresourceAttributes = {},\n\t\theaders = {},\n\t\tspanProcessorStrategy,\n\t\tenvironment = 'server',\n\t} = options;\n\n\t// Enable debug logging if requested\n\tif (debug) {\n\t\tdiag.setLogger(new DiagConsoleLogger(), DiagLogLevel.DEBUG);\n\t}\n\n\t// Create resource\n\tconst resource = new Resource({\n\t\t[ATTR_SERVICE_NAME]: serviceName,\n\t\t[ATTR_SERVICE_VERSION]: serviceVersion,\n\t\t...resourceAttributes,\n\t});\n\n\t// Build instrumentations list\n\tconst instrumentations = [];\n\n\t// Add Pino instrumentation for log correlation\n\tif (instrumentPino) {\n\t\tinstrumentations.push(\n\t\t\tnew PinoInstrumentation({\n\t\t\t\t// Inject trace context into log records\n\t\t\t\tlogHook: (span, record) => {\n\t\t\t\t\trecord.trace_id = span.spanContext().traceId;\n\t\t\t\t\trecord.span_id = span.spanContext().spanId;\n\t\t\t\t\trecord.trace_flags = span.spanContext().traceFlags;\n\t\t\t\t},\n\t\t\t}),\n\t\t);\n\t}\n\n\t// Add auto-instrumentations for common libraries\n\tif (autoInstrument) {\n\t\tinstrumentations.push(\n\t\t\tgetNodeAutoInstrumentations({\n\t\t\t\t// Disable file system instrumentation (too noisy)\n\t\t\t\t'@opentelemetry/instrumentation-fs': { enabled: false },\n\t\t\t\t// Configure HTTP instrumentation\n\t\t\t\t'@opentelemetry/instrumentation-http': {\n\t\t\t\t\tignoreIncomingRequestHook: (request) => {\n\t\t\t\t\t\t// Ignore health checks and internal routes\n\t\t\t\t\t\tconst path = request.url || '';\n\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\tpath.includes('/__health') ||\n\t\t\t\t\t\t\tpath.includes('/__telescope') ||\n\t\t\t\t\t\t\tpath.includes('/favicon')\n\t\t\t\t\t\t);\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t}),\n\t\t);\n\t}\n\n\t// Create exporters\n\tlet traceExporter: SpanExporter;\n\tif (endpoint) {\n\t\ttraceExporter = new OTLPTraceExporter({\n\t\t\turl: `${endpoint}/traces`,\n\t\t\theaders,\n\t\t});\n\t} else {\n\t\t// Fall back to console exporter for debugging\n\t\ttraceExporter = new ConsoleSpanExporter();\n\t}\n\n\t// Determine span processor strategy\n\tconst strategy = spanProcessorStrategy ?? getRecommendedStrategy(environment);\n\tconst spanProcessor = createSpanProcessor(traceExporter, { strategy });\n\n\t// Register globally for flush operations\n\tsetGlobalSpanProcessor(spanProcessor);\n\n\t// Create and configure SDK\n\tsdk = new NodeSDK({\n\t\tresource,\n\t\ttraceExporter,\n\t\tspanProcessors: [spanProcessor],\n\t\tinstrumentations,\n\t});\n\n\t// Set up log exporter if endpoint is provided\n\tif (endpoint) {\n\t\tconst logExporter = new OTLPLogExporter({\n\t\t\turl: `${endpoint}/logs`,\n\t\t\theaders,\n\t\t});\n\n\t\tconst loggerProvider = new LoggerProvider({ resource });\n\t\tconst logProcessor = new BatchLogRecordProcessor(logExporter);\n\t\tloggerProvider.addLogRecordProcessor(logProcessor);\n\n\t\t// Register for flush operations\n\t\tsetGlobalLogProcessor(logProcessor);\n\t}\n\n\t// Start the SDK\n\tsdk.start();\n\n\t// Graceful shutdown\n\tprocess.on('SIGTERM', () => {\n\t\tsdk\n\t\t\t?.shutdown()\n\t\t\t.then(() => {})\n\t\t\t.catch((_error) => {})\n\t\t\t.finally(() => process.exit(0));\n\t});\n}\n\n/**\n * Shut down telemetry (for testing or graceful sh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IAAIC,iCAAQ;EACjB;EACA;EACA,gBAAgB,CAAC,aAAc;EAC/B;CACA;AAGD,KAAI,UAAU;EACb,MAAM,cAAc,IAAIC,wDAAgB;GACvC,MAAM,EAAE,SAAS;GACjB;EACA;EAED,MAAM,iBAAiB,IAAIC,wCAAe,EAAE,SAAU;EACtD,MAAM,eAAe,IAAIC,iDAAwB;AACjD,iBAAe,sBAAsB,aAAa;AAGlD,qCAAsB,aAAa;CACnC;AAGD,KAAI,OAAO;AAGX,SAAQ,GAAG,WAAW,MAAM;AAC3B,OACG,UAAU,CACX,KAAK,MAAM,CAAE,EAAC,CACd,MAAM,CAAC,WAAW,CAAE,EAAC,CACrB,QAAQ,MAAM,QAAQ,KAAK,EAAE,CAAC;CAChC,EAAC;AACF;;;;AAKD,eAAsB,oBAAmC;AACxD,KAAI,KAAK;AACR,QAAM,IAAI,UAAU;AACpB,QAAM;CACN;AACD"}
1
+ {"version":3,"file":"setup-_uT4L_x5.cjs","names":["sdk: NodeSDK | null","options: TelemetryOptions","DiagConsoleLogger","DiagLogLevel","Resource","ATTR_SERVICE_NAME","ATTR_SERVICE_VERSION","PinoInstrumentation","traceExporter: SpanExporter","OTLPTraceExporter","ConsoleSpanExporter","NodeSDK","OTLPLogExporter","LoggerProvider","BatchLogRecordProcessor"],"sources":["../src/instrumentation/setup.ts"],"sourcesContent":["import { DiagConsoleLogger, DiagLogLevel, diag } from '@opentelemetry/api';\nimport { getNodeAutoInstrumentations } from '@opentelemetry/auto-instrumentations-node';\nimport { OTLPLogExporter } from '@opentelemetry/exporter-logs-otlp-http';\nimport { OTLPTraceExporter } from '@opentelemetry/exporter-trace-otlp-http';\nimport { PinoInstrumentation } from '@opentelemetry/instrumentation-pino';\nimport { Resource } from '@opentelemetry/resources';\nimport {\n\tBatchLogRecordProcessor,\n\tLoggerProvider,\n} from '@opentelemetry/sdk-logs';\nimport { NodeSDK } from '@opentelemetry/sdk-node';\nimport {\n\tConsoleSpanExporter,\n\ttype SpanExporter,\n} from '@opentelemetry/sdk-trace-node';\nimport {\n\tATTR_SERVICE_NAME,\n\tATTR_SERVICE_VERSION,\n} from '@opentelemetry/semantic-conventions';\nimport type { SpanProcessorStrategy } from '../adapters/types';\nimport {\n\tcreateSpanProcessor,\n\tgetRecommendedStrategy,\n\tsetGlobalLogProcessor,\n\tsetGlobalSpanProcessor,\n} from './core';\n\n/**\n * Options for configuring telemetry\n */\nexport interface TelemetryOptions {\n\t/**\n\t * Service name for resource identification\n\t */\n\tserviceName: string;\n\n\t/**\n\t * Service version\n\t */\n\tserviceVersion?: string;\n\n\t/**\n\t * OTLP endpoint URL (e.g., 'http://localhost:3000/__telescope/v1')\n\t * If not provided, traces will be logged to console\n\t */\n\tendpoint?: string;\n\n\t/**\n\t * Whether to instrument Pino for log correlation\n\t * @default true\n\t */\n\tinstrumentPino?: boolean;\n\n\t/**\n\t * Whether to enable auto-instrumentation for common libraries\n\t * (http, fetch, express, etc.)\n\t * @default true\n\t */\n\tautoInstrument?: boolean;\n\n\t/**\n\t * Enable debug logging for OTel SDK\n\t * @default false\n\t */\n\tdebug?: boolean;\n\n\t/**\n\t * Additional resource attributes\n\t */\n\tresourceAttributes?: Record<string, string>;\n\n\t/**\n\t * Headers to send with OTLP requests\n\t */\n\theaders?: Record<string, string>;\n\n\t/**\n\t * Span processor strategy.\n\t * - 'batch': Efficient batching for long-running servers (default)\n\t * - 'simple': Immediate export for serverless environments (Lambda, Edge)\n\t *\n\t * If not specified, automatically selected based on environment detection.\n\t */\n\tspanProcessorStrategy?: SpanProcessorStrategy;\n\n\t/**\n\t * Environment type for automatic configuration\n\t * @default 'server'\n\t */\n\tenvironment?: 'server' | 'lambda' | 'edge' | 'custom';\n}\n\nlet sdk: NodeSDK | null = null;\n\n/**\n * Set up OpenTelemetry instrumentation.\n * Call this BEFORE importing your application code.\n *\n * @example\n * ```typescript\n * // instrumentation.ts (create this file)\n * import { setupTelemetry } from '@geekmidas/telescope/instrumentation';\n *\n * setupTelemetry({\n * serviceName: 'my-api',\n * endpoint: 'http://localhost:3000/__telescope/v1',\n * });\n *\n * // Then in your entry point:\n * // import './instrumentation';\n * // import { app } from './app';\n * ```\n */\nexport function setupTelemetry(options: TelemetryOptions): void {\n\tif (sdk) {\n\t\treturn;\n\t}\n\n\tconst {\n\t\tserviceName,\n\t\tserviceVersion = '1.0.0',\n\t\tendpoint,\n\t\tinstrumentPino = true,\n\t\tautoInstrument = true,\n\t\tdebug = false,\n\t\tresourceAttributes = {},\n\t\theaders = {},\n\t\tspanProcessorStrategy,\n\t\tenvironment = 'server',\n\t} = options;\n\n\t// Enable debug logging if requested\n\tif (debug) {\n\t\tdiag.setLogger(new DiagConsoleLogger(), DiagLogLevel.DEBUG);\n\t}\n\n\t// Create resource\n\tconst resource = new Resource({\n\t\t[ATTR_SERVICE_NAME]: serviceName,\n\t\t[ATTR_SERVICE_VERSION]: serviceVersion,\n\t\t...resourceAttributes,\n\t});\n\n\t// Build instrumentations list\n\tconst instrumentations = [];\n\n\t// Add Pino instrumentation for log correlation\n\tif (instrumentPino) {\n\t\tinstrumentations.push(\n\t\t\tnew PinoInstrumentation({\n\t\t\t\t// Inject trace context into log records\n\t\t\t\tlogHook: (span, record) => {\n\t\t\t\t\trecord.trace_id = span.spanContext().traceId;\n\t\t\t\t\trecord.span_id = span.spanContext().spanId;\n\t\t\t\t\trecord.trace_flags = span.spanContext().traceFlags;\n\t\t\t\t},\n\t\t\t}),\n\t\t);\n\t}\n\n\t// Add auto-instrumentations for common libraries\n\tif (autoInstrument) {\n\t\tinstrumentations.push(\n\t\t\tgetNodeAutoInstrumentations({\n\t\t\t\t// Disable file system instrumentation (too noisy)\n\t\t\t\t'@opentelemetry/instrumentation-fs': { enabled: false },\n\t\t\t\t// Configure HTTP instrumentation\n\t\t\t\t'@opentelemetry/instrumentation-http': {\n\t\t\t\t\tignoreIncomingRequestHook: (request) => {\n\t\t\t\t\t\t// Ignore health checks and internal routes\n\t\t\t\t\t\tconst path = request.url || '';\n\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\tpath.includes('/__health') ||\n\t\t\t\t\t\t\tpath.includes('/__telescope') ||\n\t\t\t\t\t\t\tpath.includes('/favicon')\n\t\t\t\t\t\t);\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t}),\n\t\t);\n\t}\n\n\t// Create exporters\n\tlet traceExporter: SpanExporter;\n\tif (endpoint) {\n\t\ttraceExporter = new OTLPTraceExporter({\n\t\t\turl: `${endpoint}/traces`,\n\t\t\theaders,\n\t\t});\n\t} else {\n\t\t// Fall back to console exporter for debugging\n\t\ttraceExporter = new ConsoleSpanExporter();\n\t}\n\n\t// Determine span processor strategy\n\tconst strategy = spanProcessorStrategy ?? getRecommendedStrategy(environment);\n\tconst spanProcessor = createSpanProcessor(traceExporter, { strategy });\n\n\t// Register globally for flush operations\n\tsetGlobalSpanProcessor(spanProcessor);\n\n\t// Create and configure SDK\n\tsdk = new NodeSDK({\n\t\tresource,\n\t\ttraceExporter,\n\t\tspanProcessors: [spanProcessor],\n\t\tinstrumentations,\n\t});\n\n\t// Set up log exporter if endpoint is provided\n\tif (endpoint) {\n\t\tconst logExporter = new OTLPLogExporter({\n\t\t\turl: `${endpoint}/logs`,\n\t\t\theaders,\n\t\t});\n\n\t\tconst loggerProvider = new LoggerProvider({ resource });\n\t\tconst logProcessor = new BatchLogRecordProcessor(logExporter);\n\t\tloggerProvider.addLogRecordProcessor(logProcessor);\n\n\t\t// Register for flush operations\n\t\tsetGlobalLogProcessor(logProcessor);\n\t}\n\n\t// Start the SDK\n\tsdk.start();\n\n\t// Graceful shutdown\n\tprocess.on('SIGTERM', () => {\n\t\tsdk\n\t\t\t?.shutdown()\n\t\t\t.then(() => {})\n\t\t\t.catch((_error) => {})\n\t\t\t.finally(() => process.exit(0));\n\t});\n}\n\n/**\n * Shut down telemetry (for testing or graceful shutdown)\n */\nexport async function shutdownTelemetry(): Promise<void> {\n\tif (sdk) {\n\t\tawait sdk.shutdown();\n\t\tsdk = null;\n\t}\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A,EA1DpD,UA0DoD,CAAA,EAzD/D,CAyD+D;;;;iBA9BlD,UAAA,CAAA;;;;iBAQA,SAAA,CAAA;;;;iBAQA,eAAA,QAAuB;;;;iBAcvB,YAAA,4BAAwC"}
1
+ {"version":3,"file":"tracing-PnECEbEu.d.mts","names":[],"sources":["../src/instrumentation/tracing.ts"],"sourcesContent":[],"mappings":";;;;;;AAWA;AAOgB,iBAPA,aAAA,CAAA,CAO8B,EAPb,IAOuB,GAAA,SAAA;AAUxD;;;AAAmE,iBAVnD,iBAAA,CAUmD,UAAA,EAVrB,UAUqB,CAAA,EAAA,IAAA;AAAI;AAkBvE;;AAEY,iBApBI,UAAA,CAoBJ,IAAA,EAAA,MAAA,EAAA,UAAA,CAAA,EApB0C,UAoB1C,CAAA,EApBuD,IAoBvD;;;;;;AAEF;AA4BV;;;;;;AAII,iBApCkB,QAoClB,CAAA,CAAA,CAAA,CAAA,IAAA,EAAA,MAAA,EAAA,EAAA,EAAA,CAAA,IAAA,EAlCQ,IAkCR,EAAA,GAlCiB,OAkCjB,CAlCyB,CAkCzB,CAAA,EAAA,UAAA,CAAA,EAjCU,UAiCV,CAAA,EAhCD,OAgCC,CAhCO,CAgCP,CAAA;AA2BJ;AAQA;AAQA;AAcgB,iBA7DA,YA6DwC,CAAA,CAAA,CAAA,CAAU,IAAA,EAAA,MAAA,EAAA,EAAA,EAAA,CAAA,IAAA,EA3DtD,IA2DsD,EAAA,GA3D7C,CA2D6C,EAAA,UAAA,CAAA,EA1DpD,UA0DoD,CAAA,EAzD/D,CAyD+D;;;;iBA9BlD,UAAA,CAAA;;;;iBAQA,SAAA,CAAA;;;;iBAQA,eAAA,QAAuB;;;;iBAcvB,YAAA,4BAAwC"}
@@ -1,4 +1,4 @@
1
- import { SeverityNumber, SpanKind, SpanStatusCode } from "./types-Bwm_jNU7.mjs";
1
+ import { SeverityNumber, SpanKind, SpanStatusCode } from "./types-CXYLhG_G.mjs";
2
2
 
3
3
  //#region src/otlp/transformer.ts
4
4
  /**
@@ -212,4 +212,4 @@ function transformMetrics(request) {
212
212
 
213
213
  //#endregion
214
214
  export { transformLogs, transformMetrics, transformTraces };
215
- //# sourceMappingURL=transformer-BXQPhzql.mjs.map
215
+ //# sourceMappingURL=transformer-CFrJQkUg.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"transformer-BXQPhzql.mjs","names":["value?: AnyValue","attrs?: KeyValue[]","result: Record<string, unknown>","nanoStr: string","severity?: SeverityNumber","span: Span","resourceAttrs: Record<string, unknown>","headers: Record<string, string>","request: ExportTraceServiceRequest","entries: Array<Omit<RequestEntry, 'id' | 'timestamp'>>","record: LogRecord","scopeName?: string","context: Record<string, unknown>","request: ExportLogsServiceRequest","entries: Array<Omit<LogEntry, 'id' | 'timestamp'>>","request: ExportMetricsServiceRequest","points: MetricDataPoint[]"],"sources":["../src/otlp/transformer.ts"],"sourcesContent":["import type { LogEntry, RequestEntry } from '../types';\nimport {\n\ttype AnyValue,\n\ttype ExportLogsServiceRequest,\n\ttype ExportMetricsServiceRequest,\n\ttype ExportTraceServiceRequest,\n\ttype KeyValue,\n\ttype LogRecord,\n\tSeverityNumber,\n\ttype Span,\n\tSpanKind,\n\tSpanStatusCode,\n} from './types';\n\n/**\n * Extract a primitive value from an AnyValue\n */\nfunction extractValue(value?: AnyValue): unknown {\n\tif (!value) return undefined;\n\tif (value.stringValue !== undefined) return value.stringValue;\n\tif (value.boolValue !== undefined) return value.boolValue;\n\tif (value.intValue !== undefined) return parseInt(value.intValue, 10);\n\tif (value.doubleValue !== undefined) return value.doubleValue;\n\tif (value.bytesValue !== undefined) return value.bytesValue;\n\tif (value.arrayValue) return value.arrayValue.values.map(extractValue);\n\tif (value.kvlistValue) return attributesToObject(value.kvlistValue.values);\n\treturn undefined;\n}\n\n/**\n * Convert KeyValue array to a plain object\n */\nfunction attributesToObject(attrs?: KeyValue[]): Record<string, unknown> {\n\tif (!attrs) return {};\n\tconst result: Record<string, unknown> = {};\n\tfor (const attr of attrs) {\n\t\tresult[attr.key] = extractValue(attr.value);\n\t}\n\treturn result;\n}\n\n/**\n * Convert nanoseconds string to Date\n */\nfunction nanoToDate(nanoStr: string): Date {\n\tconst nano = BigInt(nanoStr);\n\tconst ms = Number(nano / BigInt(1_000_000));\n\treturn new Date(ms);\n}\n\n/**\n * Convert nanoseconds string to milliseconds number\n */\nfunction nanoToMs(nanoStr: string): number {\n\tconst nano = BigInt(nanoStr);\n\treturn Number(nano / BigInt(1_000_000));\n}\n\n/**\n * Map OTLP severity number to Telescope log level\n */\nfunction mapSeverity(\n\tseverity?: SeverityNumber,\n): 'debug' | 'info' | 'warn' | 'error' {\n\tif (severity === undefined) return 'info';\n\tif (severity <= SeverityNumber.SEVERITY_NUMBER_DEBUG4) return 'debug';\n\tif (severity <= SeverityNumber.SEVERITY_NUMBER_INFO4) return 'info';\n\tif (severity <= SeverityNumber.SEVERITY_NUMBER_WARN4) return 'warn';\n\treturn 'error';\n}\n\n/**\n * Determine HTTP status from span attributes and status\n */\nfunction getHttpStatus(span: Span): number {\n\tconst attrs = attributesToObject(span.attributes);\n\n\t// Look for HTTP status code in various attribute names\n\tconst statusCode =\n\t\tattrs['http.status_code'] ??\n\t\tattrs['http.response.status_code'] ??\n\t\tattrs['http.response_status_code'];\n\n\tif (typeof statusCode === 'number') return statusCode;\n\tif (typeof statusCode === 'string') return parseInt(statusCode, 10) || 200;\n\n\t// Fall back to span status\n\tif (span.status?.code === SpanStatusCode.STATUS_CODE_ERROR) return 500;\n\tif (span.status?.code === SpanStatusCode.STATUS_CODE_OK) return 200;\n\n\treturn 200;\n}\n\n/**\n * Check if a span represents an HTTP server request\n */\nfunction isHttpServerSpan(span: Span): boolean {\n\tif (span.kind !== SpanKind.SPAN_KIND_SERVER) return false;\n\n\tconst attrs = attributesToObject(span.attributes);\n\treturn !!(\n\t\tattrs['http.method'] ||\n\t\tattrs['http.request.method'] ||\n\t\tattrs['http.url'] ||\n\t\tattrs['http.target'] ||\n\t\tattrs['url.path']\n\t);\n}\n\n/**\n * Transform HTTP-related span attributes to RequestEntry format\n */\nfunction transformHttpSpan(\n\tspan: Span,\n\tresourceAttrs: Record<string, unknown>,\n): Omit<RequestEntry, 'id' | 'timestamp'> {\n\tconst attrs = attributesToObject(span.attributes);\n\n\t// Extract HTTP method\n\tconst method = String(\n\t\tattrs['http.method'] ?? attrs['http.request.method'] ?? 'GET',\n\t).toUpperCase();\n\n\t// Extract path\n\tconst path = String(\n\t\tattrs['http.target'] ?? attrs['url.path'] ?? attrs['http.route'] ?? '/',\n\t);\n\n\t// Extract full URL\n\tconst url = String(\n\t\tattrs['http.url'] ?? attrs['url.full'] ?? `http://localhost${path}`,\n\t);\n\n\t// Extract headers (if available)\n\tconst headers: Record<string, string> = {};\n\tconst userAgent = attrs['http.user_agent'] ?? attrs['user_agent.original'];\n\tif (userAgent) headers['user-agent'] = String(userAgent);\n\n\tconst contentType = attrs['http.request.header.content_type'];\n\tif (contentType) headers['content-type'] = String(contentType);\n\n\t// Calculate duration\n\tconst startTime = nanoToMs(span.startTimeUnixNano);\n\tconst endTime = nanoToMs(span.endTimeUnixNano);\n\tconst duration = endTime - startTime;\n\n\t// Get status code\n\tconst status = getHttpStatus(span);\n\n\t// Extract client IP\n\tconst ip =\n\t\tattrs['net.peer.ip'] ?? attrs['client.address'] ?? attrs['http.client_ip'];\n\n\treturn {\n\t\tmethod,\n\t\tpath,\n\t\turl,\n\t\theaders,\n\t\tquery: {},\n\t\tstatus,\n\t\tresponseHeaders: {},\n\t\tduration,\n\t\tip: ip ? String(ip) : undefined,\n\t\ttags: [\n\t\t\t`trace:${span.traceId}`,\n\t\t\t`span:${span.spanId}`,\n\t\t\t...(resourceAttrs['service.name']\n\t\t\t\t? [`service:${resourceAttrs['service.name']}`]\n\t\t\t\t: []),\n\t\t],\n\t};\n}\n\n/**\n * Transform OTLP traces to Telescope RequestEntries\n * Only transforms HTTP server spans to request entries\n */\nexport function transformTraces(\n\trequest: ExportTraceServiceRequest,\n): Array<Omit<RequestEntry, 'id' | 'timestamp'>> {\n\tconst entries: Array<Omit<RequestEntry, 'id' | 'timestamp'>> = [];\n\n\tfor (const resourceSpans of request.resourceSpans ?? []) {\n\t\tconst resourceAttrs = attributesToObject(\n\t\t\tresourceSpans.resource?.attributes,\n\t\t);\n\n\t\tfor (const scopeSpans of resourceSpans.scopeSpans ?? []) {\n\t\t\tfor (const span of scopeSpans.spans ?? []) {\n\t\t\t\t// Only transform HTTP server spans\n\t\t\t\tif (isHttpServerSpan(span)) {\n\t\t\t\t\tentries.push(transformHttpSpan(span, resourceAttrs));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn entries;\n}\n\n/**\n * Transform a single OTLP log record to Telescope LogEntry\n */\nfunction transformLogRecord(\n\trecord: LogRecord,\n\tresourceAttrs: Record<string, unknown>,\n\tscopeName?: string,\n): Omit<LogEntry, 'id' | 'timestamp'> {\n\tconst attrs = attributesToObject(record.attributes);\n\n\t// Extract message from body\n\tlet message = '';\n\tif (record.body) {\n\t\tconst bodyValue = extractValue(record.body);\n\t\tmessage =\n\t\t\ttypeof bodyValue === 'string' ? bodyValue : JSON.stringify(bodyValue);\n\t}\n\n\t// Build context from attributes\n\tconst context: Record<string, unknown> = {\n\t\t...attrs,\n\t\t...resourceAttrs,\n\t};\n\n\tif (scopeName) {\n\t\tcontext['instrumentation.scope'] = scopeName;\n\t}\n\n\t// Add severity text if present\n\tif (record.severityText) {\n\t\tcontext['severity.text'] = record.severityText;\n\t}\n\n\treturn {\n\t\tlevel: mapSeverity(record.severityNumber),\n\t\tmessage,\n\t\tcontext: Object.keys(context).length > 0 ? context : undefined,\n\t\trequestId: record.spanId ? `span:${record.spanId}` : undefined,\n\t};\n}\n\n/**\n * Transform OTLP logs to Telescope LogEntries\n */\nexport function transformLogs(\n\trequest: ExportLogsServiceRequest,\n): Array<Omit<LogEntry, 'id' | 'timestamp'>> {\n\tconst entries: Array<Omit<LogEntry, 'id' | 'timestamp'>> = [];\n\n\tfor (const resourceLogs of request.resourceLogs ?? []) {\n\t\tconst resourceAttrs = attributesToObject(resourceLogs.resource?.attributes);\n\n\t\tfor (const scopeLogs of resourceLogs.scopeLogs ?? []) {\n\t\t\tconst scopeName = scopeLogs.scope?.name;\n\n\t\t\tfor (const record of scopeLogs.logRecords ?? []) {\n\t\t\t\tentries.push(transformLogRecord(record, resourceAttrs, scopeName));\n\t\t\t}\n\t\t}\n\t}\n\n\treturn entries;\n}\n\n/**\n * Extracted metric data point for recording\n */\nexport interface MetricDataPoint {\n\tname: string;\n\tdescription?: string;\n\tunit?: string;\n\tvalue: number;\n\ttimestamp: Date;\n\tattributes: Record<string, unknown>;\n\tresourceAttributes: Record<string, unknown>;\n\ttype: 'gauge' | 'sum' | 'histogram' | 'summary';\n}\n\n/**\n * Transform OTLP metrics to normalized data points\n * These can be used for custom metrics processing or forwarding\n */\nexport function transformMetrics(\n\trequest: ExportMetricsServiceRequest,\n): MetricDataPoint[] {\n\tconst points: MetricDataPoint[] = [];\n\n\tfor (const resourceMetrics of request.resourceMetrics ?? []) {\n\t\tconst resourceAttrs = attributesToObject(\n\t\t\tresourceMetrics.resource?.attributes,\n\t\t);\n\n\t\tfor (const scopeMetrics of resourceMetrics.scopeMetrics ?? []) {\n\t\t\tfor (const metric of scopeMetrics.metrics ?? []) {\n\t\t\t\tconst baseMeta = {\n\t\t\t\t\tname: metric.name,\n\t\t\t\t\tdescription: metric.description,\n\t\t\t\t\tunit: metric.unit,\n\t\t\t\t\tresourceAttributes: resourceAttrs,\n\t\t\t\t};\n\n\t\t\t\t// Handle gauge\n\t\t\t\tif (metric.gauge) {\n\t\t\t\t\tfor (const dp of metric.gauge.dataPoints) {\n\t\t\t\t\t\tpoints.push({\n\t\t\t\t\t\t\t...baseMeta,\n\t\t\t\t\t\t\tvalue: dp.asDouble ?? (dp.asInt ? parseInt(dp.asInt, 10) : 0),\n\t\t\t\t\t\t\ttimestamp: nanoToDate(dp.timeUnixNano),\n\t\t\t\t\t\t\tattributes: attributesToObject(dp.attributes),\n\t\t\t\t\t\t\ttype: 'gauge',\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Handle sum (counter)\n\t\t\t\tif (metric.sum) {\n\t\t\t\t\tfor (const dp of metric.sum.dataPoints) {\n\t\t\t\t\t\tpoints.push({\n\t\t\t\t\t\t\t...baseMeta,\n\t\t\t\t\t\t\tvalue: dp.asDouble ?? (dp.asInt ? parseInt(dp.asInt, 10) : 0),\n\t\t\t\t\t\t\ttimestamp: nanoToDate(dp.timeUnixNano),\n\t\t\t\t\t\t\tattributes: attributesToObject(dp.attributes),\n\t\t\t\t\t\t\ttype: 'sum',\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Handle histogram (extract sum as the value)\n\t\t\t\tif (metric.histogram) {\n\t\t\t\t\tfor (const dp of metric.histogram.dataPoints) {\n\t\t\t\t\t\tpoints.push({\n\t\t\t\t\t\t\t...baseMeta,\n\t\t\t\t\t\t\tvalue: dp.sum ?? 0,\n\t\t\t\t\t\t\ttimestamp: nanoToDate(dp.timeUnixNano),\n\t\t\t\t\t\t\tattributes: {\n\t\t\t\t\t\t\t\t...attributesToObject(dp.attributes),\n\t\t\t\t\t\t\t\tcount: parseInt(dp.count, 10),\n\t\t\t\t\t\t\t\tmin: dp.min,\n\t\t\t\t\t\t\t\tmax: dp.max,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\ttype: 'histogram',\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Handle summary\n\t\t\t\tif (metric.summary) {\n\t\t\t\t\tfor (const dp of metric.summary.dataPoints) {\n\t\t\t\t\t\tpoints.push({\n\t\t\t\t\t\t\t...baseMeta,\n\t\t\t\t\t\t\tvalue: dp.sum ?? 0,\n\t\t\t\t\t\t\ttimestamp: nanoToDate(dp.timeUnixNano),\n\t\t\t\t\t\t\tattributes: {\n\t\t\t\t\t\t\t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7B,KAAK,GAAG;KACR,KAAK,GAAG;IACR;IACD,MAAM;GACN,EAAC;AAKJ,OAAI,OAAO,QACV,MAAK,MAAM,MAAM,OAAO,QAAQ,WAC/B,QAAO,KAAK;IACX,GAAG;IACH,OAAO,GAAG,OAAO;IACjB,WAAW,WAAW,GAAG,aAAa;IACtC,YAAY;KACX,GAAG,mBAAmB,GAAG,WAAW;KACpC,OAAO,SAAS,GAAG,OAAO,GAAG;KAC7B,WAAW,GAAG;IACd;IACD,MAAM;GACN,EAAC;EAGJ;CAEF;AAED,QAAO;AACP"}
1
+ {"version":3,"file":"transformer-CFrJQkUg.mjs","names":["value?: AnyValue","attrs?: KeyValue[]","result: Record<string, unknown>","nanoStr: string","severity?: SeverityNumber","span: Span","resourceAttrs: Record<string, unknown>","headers: Record<string, string>","request: ExportTraceServiceRequest","entries: Array<Omit<RequestEntry, 'id' | 'timestamp'>>","record: LogRecord","scopeName?: string","context: Record<string, unknown>","request: ExportLogsServiceRequest","entries: Array<Omit<LogEntry, 'id' | 'timestamp'>>","request: ExportMetricsServiceRequest","points: MetricDataPoint[]"],"sources":["../src/otlp/transformer.ts"],"sourcesContent":["import type { LogEntry, RequestEntry } from '../types';\nimport {\n\ttype AnyValue,\n\ttype ExportLogsServiceRequest,\n\ttype ExportMetricsServiceRequest,\n\ttype ExportTraceServiceRequest,\n\ttype KeyValue,\n\ttype LogRecord,\n\tSeverityNumber,\n\ttype Span,\n\tSpanKind,\n\tSpanStatusCode,\n} from './types';\n\n/**\n * Extract a primitive value from an AnyValue\n */\nfunction extractValue(value?: AnyValue): unknown {\n\tif (!value) return undefined;\n\tif (value.stringValue !== undefined) return value.stringValue;\n\tif (value.boolValue !== undefined) return value.boolValue;\n\tif (value.intValue !== undefined) return parseInt(value.intValue, 10);\n\tif (value.doubleValue !== undefined) return value.doubleValue;\n\tif (value.bytesValue !== undefined) return value.bytesValue;\n\tif (value.arrayValue) return value.arrayValue.values.map(extractValue);\n\tif (value.kvlistValue) return attributesToObject(value.kvlistValue.values);\n\treturn undefined;\n}\n\n/**\n * Convert KeyValue array to a plain object\n */\nfunction attributesToObject(attrs?: KeyValue[]): Record<string, unknown> {\n\tif (!attrs) return {};\n\tconst result: Record<string, unknown> = {};\n\tfor (const attr of attrs) {\n\t\tresult[attr.key] = extractValue(attr.value);\n\t}\n\treturn result;\n}\n\n/**\n * Convert nanoseconds string to Date\n */\nfunction nanoToDate(nanoStr: string): Date {\n\tconst nano = BigInt(nanoStr);\n\tconst ms = Number(nano / BigInt(1_000_000));\n\treturn new Date(ms);\n}\n\n/**\n * Convert nanoseconds string to milliseconds number\n */\nfunction nanoToMs(nanoStr: string): number {\n\tconst nano = BigInt(nanoStr);\n\treturn Number(nano / BigInt(1_000_000));\n}\n\n/**\n * Map OTLP severity number to Telescope log level\n */\nfunction mapSeverity(\n\tseverity?: SeverityNumber,\n): 'debug' | 'info' | 'warn' | 'error' {\n\tif (severity === undefined) return 'info';\n\tif (severity <= SeverityNumber.SEVERITY_NUMBER_DEBUG4) return 'debug';\n\tif (severity <= SeverityNumber.SEVERITY_NUMBER_INFO4) return 'info';\n\tif (severity <= SeverityNumber.SEVERITY_NUMBER_WARN4) return 'warn';\n\treturn 'error';\n}\n\n/**\n * Determine HTTP status from span attributes and status\n */\nfunction getHttpStatus(span: Span): number {\n\tconst attrs = attributesToObject(span.attributes);\n\n\t// Look for HTTP status code in various attribute names\n\tconst statusCode =\n\t\tattrs['http.status_code'] ??\n\t\tattrs['http.response.status_code'] ??\n\t\tattrs['http.response_status_code'];\n\n\tif (typeof statusCode === 'number') return statusCode;\n\tif (typeof statusCode === 'string') return parseInt(statusCode, 10) || 200;\n\n\t// Fall back to span status\n\tif (span.status?.code === SpanStatusCode.STATUS_CODE_ERROR) return 500;\n\tif (span.status?.code === SpanStatusCode.STATUS_CODE_OK) return 200;\n\n\treturn 200;\n}\n\n/**\n * Check if a span represents an HTTP server request\n */\nfunction isHttpServerSpan(span: Span): boolean {\n\tif (span.kind !== SpanKind.SPAN_KIND_SERVER) return false;\n\n\tconst attrs = attributesToObject(span.attributes);\n\treturn !!(\n\t\tattrs['http.method'] ||\n\t\tattrs['http.request.method'] ||\n\t\tattrs['http.url'] ||\n\t\tattrs['http.target'] ||\n\t\tattrs['url.path']\n\t);\n}\n\n/**\n * Transform HTTP-related span attributes to RequestEntry format\n */\nfunction transformHttpSpan(\n\tspan: Span,\n\tresourceAttrs: Record<string, unknown>,\n): Omit<RequestEntry, 'id' | 'timestamp'> {\n\tconst attrs = attributesToObject(span.attributes);\n\n\t// Extract HTTP method\n\tconst method = String(\n\t\tattrs['http.method'] ?? attrs['http.request.method'] ?? 'GET',\n\t).toUpperCase();\n\n\t// Extract path\n\tconst path = String(\n\t\tattrs['http.target'] ?? attrs['url.path'] ?? attrs['http.route'] ?? '/',\n\t);\n\n\t// Extract full URL\n\tconst url = String(\n\t\tattrs['http.url'] ?? attrs['url.full'] ?? `http://localhost${path}`,\n\t);\n\n\t// Extract headers (if available)\n\tconst headers: Record<string, string> = {};\n\tconst userAgent = attrs['http.user_agent'] ?? attrs['user_agent.original'];\n\tif (userAgent) headers['user-agent'] = String(userAgent);\n\n\tconst contentType = attrs['http.request.header.content_type'];\n\tif (contentType) headers['content-type'] = String(contentType);\n\n\t// Calculate duration\n\tconst startTime = nanoToMs(span.startTimeUnixNano);\n\tconst endTime = nanoToMs(span.endTimeUnixNano);\n\tconst duration = endTime - startTime;\n\n\t// Get status code\n\tconst status = getHttpStatus(span);\n\n\t// Extract client IP\n\tconst ip =\n\t\tattrs['net.peer.ip'] ?? attrs['client.address'] ?? attrs['http.client_ip'];\n\n\treturn {\n\t\tmethod,\n\t\tpath,\n\t\turl,\n\t\theaders,\n\t\tquery: {},\n\t\tstatus,\n\t\tresponseHeaders: {},\n\t\tduration,\n\t\tip: ip ? String(ip) : undefined,\n\t\ttags: [\n\t\t\t`trace:${span.traceId}`,\n\t\t\t`span:${span.spanId}`,\n\t\t\t...(resourceAttrs['service.name']\n\t\t\t\t? [`service:${resourceAttrs['service.name']}`]\n\t\t\t\t: []),\n\t\t],\n\t};\n}\n\n/**\n * Transform OTLP traces to Telescope RequestEntries\n * Only transforms HTTP server spans to request entries\n */\nexport function transformTraces(\n\trequest: ExportTraceServiceRequest,\n): Array<Omit<RequestEntry, 'id' | 'timestamp'>> {\n\tconst entries: Array<Omit<RequestEntry, 'id' | 'timestamp'>> = [];\n\n\tfor (const resourceSpans of request.resourceSpans ?? []) {\n\t\tconst resourceAttrs = attributesToObject(\n\t\t\tresourceSpans.resource?.attributes,\n\t\t);\n\n\t\tfor (const scopeSpans of resourceSpans.scopeSpans ?? []) {\n\t\t\tfor (const span of scopeSpans.spans ?? []) {\n\t\t\t\t// Only transform HTTP server spans\n\t\t\t\tif (isHttpServerSpan(span)) {\n\t\t\t\t\tentries.push(transformHttpSpan(span, resourceAttrs));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn entries;\n}\n\n/**\n * Transform a single OTLP log record to Telescope LogEntry\n */\nfunction transformLogRecord(\n\trecord: LogRecord,\n\tresourceAttrs: Record<string, unknown>,\n\tscopeName?: string,\n): Omit<LogEntry, 'id' | 'timestamp'> {\n\tconst attrs = attributesToObject(record.attributes);\n\n\t// Extract message from body\n\tlet message = '';\n\tif (record.body) {\n\t\tconst bodyValue = extractValue(record.body);\n\t\tmessage =\n\t\t\ttypeof bodyValue === 'string' ? bodyValue : JSON.stringify(bodyValue);\n\t}\n\n\t// Build context from attributes\n\tconst context: Record<string, unknown> = {\n\t\t...attrs,\n\t\t...resourceAttrs,\n\t};\n\n\tif (scopeName) {\n\t\tcontext['instrumentation.scope'] = scopeName;\n\t}\n\n\t// Add severity text if present\n\tif (record.severityText) {\n\t\tcontext['severity.text'] = record.severityText;\n\t}\n\n\treturn {\n\t\tlevel: mapSeverity(record.severityNumber),\n\t\tmessage,\n\t\tcontext: Object.keys(context).length > 0 ? context : undefined,\n\t\trequestId: record.spanId ? `span:${record.spanId}` : undefined,\n\t};\n}\n\n/**\n * Transform OTLP logs to Telescope LogEntries\n */\nexport function transformLogs(\n\trequest: ExportLogsServiceRequest,\n): Array<Omit<LogEntry, 'id' | 'timestamp'>> {\n\tconst entries: Array<Omit<LogEntry, 'id' | 'timestamp'>> = [];\n\n\tfor (const resourceLogs of request.resourceLogs ?? []) {\n\t\tconst resourceAttrs = attributesToObject(resourceLogs.resource?.attributes);\n\n\t\tfor (const scopeLogs of resourceLogs.scopeLogs ?? []) {\n\t\t\tconst scopeName = scopeLogs.scope?.name;\n\n\t\t\tfor (const record of scopeLogs.logRecords ?? []) {\n\t\t\t\tentries.push(transformLogRecord(record, resourceAttrs, scopeName));\n\t\t\t}\n\t\t}\n\t}\n\n\treturn entries;\n}\n\n/**\n * Extracted metric data point for recording\n */\nexport interface MetricDataPoint {\n\tname: string;\n\tdescription?: string;\n\tunit?: string;\n\tvalue: number;\n\ttimestamp: Date;\n\tattributes: Record<string, unknown>;\n\tresourceAttributes: Record<string, unknown>;\n\ttype: 'gauge' | 'sum' | 'histogram' | 'summary';\n}\n\n/**\n * Transform OTLP metrics to normalized data points\n * These can be used for custom metrics processing or forwarding\n */\nexport function transformMetrics(\n\trequest: ExportMetricsServiceRequest,\n): MetricDataPoint[] {\n\tconst points: MetricDataPoint[] = [];\n\n\tfor (const resourceMetrics of request.resourceMetrics ?? []) {\n\t\tconst resourceAttrs = attributesToObject(\n\t\t\tresourceMetrics.resource?.attributes,\n\t\t);\n\n\t\tfor (const scopeMetrics of resourceMetrics.scopeMetrics ?? []) {\n\t\t\tfor (const metric of scopeMetrics.metrics ?? []) {\n\t\t\t\tconst baseMeta = {\n\t\t\t\t\tname: metric.name,\n\t\t\t\t\tdescription: metric.description,\n\t\t\t\t\tunit: metric.unit,\n\t\t\t\t\tresourceAttributes: resourceAttrs,\n\t\t\t\t};\n\n\t\t\t\t// Handle gauge\n\t\t\t\tif (metric.gauge) {\n\t\t\t\t\tfor (const dp of metric.gauge.dataPoints) {\n\t\t\t\t\t\tpoints.push({\n\t\t\t\t\t\t\t...baseMeta,\n\t\t\t\t\t\t\tvalue: dp.asDouble ?? (dp.asInt ? parseInt(dp.asInt, 10) : 0),\n\t\t\t\t\t\t\ttimestamp: nanoToDate(dp.timeUnixNano),\n\t\t\t\t\t\t\tattributes: attributesToObject(dp.attributes),\n\t\t\t\t\t\t\ttype: 'gauge',\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Handle sum (counter)\n\t\t\t\tif (metric.sum) {\n\t\t\t\t\tfor (const dp of metric.sum.dataPoints) {\n\t\t\t\t\t\tpoints.push({\n\t\t\t\t\t\t\t...baseMeta,\n\t\t\t\t\t\t\tvalue: dp.asDouble ?? (dp.asInt ? parseInt(dp.asInt, 10) : 0),\n\t\t\t\t\t\t\ttimestamp: nanoToDate(dp.timeUnixNano),\n\t\t\t\t\t\t\tattributes: attributesToObject(dp.attributes),\n\t\t\t\t\t\t\ttype: 'sum',\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Handle histogram (extract sum as the value)\n\t\t\t\tif (metric.histogram) {\n\t\t\t\t\tfor (const dp of metric.histogram.dataPoints) {\n\t\t\t\t\t\tpoints.push({\n\t\t\t\t\t\t\t...baseMeta,\n\t\t\t\t\t\t\tvalue: dp.sum ?? 0,\n\t\t\t\t\t\t\ttimestamp: nanoToDate(dp.timeUnixNano),\n\t\t\t\t\t\t\tattributes: {\n\t\t\t\t\t\t\t\t...attributesToObject(dp.attributes),\n\t\t\t\t\t\t\t\tcount: parseInt(dp.count, 10),\n\t\t\t\t\t\t\t\tmin: dp.min,\n\t\t\t\t\t\t\t\tmax: dp.max,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\ttype: 'histogram',\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Handle summary\n\t\t\t\tif (metric.summary) {\n\t\t\t\t\tfor (const dp of metric.summary.dataPoints) {\n\t\t\t\t\t\tpoints.push({\n\t\t\t\t\t\t\t...baseMeta,\n\t\t\t\t\t\t\tvalue: dp.sum ?? 0,\n\t\t\t\t\t\t\ttimestamp: nanoToDate(dp.timeUnixNano),\n\t\t\t\t\t\t\tattributes: {\n\t\t\t\t\t\t\t\t...attributesToObject(dp.attributes),\n\t\t\t\t\t\t\t\tcount: parseInt(dp.count, 10),\n\t\t\t\t\t\t\t\tquantiles: dp.quantileValues,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\ttype: 'summary',\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn points;\n}\n"],"mappings":";;;;;;AAiBA,SAAS,aAAaA,OAA2B;AAChD,MAAK,MAAO;AACZ,KAAI,MAAM,uBAA2B,QAAO,MAAM;AAClD,KAAI,MAAM,qBAAyB,QAAO,MAAM;AAChD,KAAI,MAAM,oBAAwB,QAAO,SAAS,MAAM,UAAU,GAAG;AACrE,KAAI,MAAM,uBAA2B,QAAO,MAAM;AAClD,KAAI,MAAM,sBAA0B,QAAO,MAAM;AACjD,KAAI,MAAM,WAAY,QAAO,MAAM,WAAW,OAAO,IAAI,aAAa;AACtE,KAAI,MAAM,YAAa,QAAO,mBAAmB,MAAM,YAAY,OAAO;AAC1E;AACA;;;;AAKD,SAAS,mBAAmBC,OAA6C;AACxE,MAAK,MAAO,QAAO,CAAE;CACrB,MAAMC,SAAkC,CAAE;AAC1C,MAAK,MAAM,QAAQ,MAClB,QAAO,KAAK,OAAO,aAAa,KAAK,MAAM;AAE5C,QAAO;AACP;;;;AAKD,SAAS,WAAWC,SAAuB;CAC1C,MAAM,OAAO,OAAO,QAAQ;CAC5B,MAAM,KAAK,OAAO,OAAO,OAAO,IAAU,CAAC;AAC3C,QAAO,IAAI,KAAK;AAChB;;;;AAKD,SAAS,SAASA,SAAyB;CAC1C,MAAM,OAAO,OAAO,QAAQ;AAC5B,QAAO,OAAO,OAAO,OAAO,IAAU,CAAC;AAC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,WACjC,QAAO,KAAK;IACX,GAAG;IACH,OAAO,GAAG,OAAO;IACjB,WAAW,WAAW,GAAG,aAAa;IACtC,YAAY;KACX,GAAG,mBAAmB,GAAG,WAAW;KACpC,OAAO,SAAS,GAAG,OAAO,GAAG;KAC7B,KAAK,GAAG;KACR,KAAK,GAAG;IACR;IACD,MAAM;GACN,EAAC;AAKJ,OAAI,OAAO,QACV,MAAK,MAAM,MAAM,OAAO,QAAQ,WAC/B,QAAO,KAAK;IACX,GAAG;IACH,OAAO,GAAG,OAAO;IACjB,WAAW,WAAW,GAAG,aAAa;IACtC,YAAY;KACX,GAAG,mBAAmB,GAAG,WAAW;KACpC,OAAO,SAAS,GAAG,OAAO,GAAG;KAC7B,WAAW,GAAG;IACd;IACD,MAAM;GACN,EAAC;EAGJ;CAEF;AAED,QAAO;AACP"}
@@ -1,4 +1,4 @@
1
- const require_types = require('./types-Dsh-DIO_.cjs');
1
+ const require_types = require('./types-BBeTDpHr.cjs');
2
2
 
3
3
  //#region src/otlp/transformer.ts
4
4
  /**
@@ -229,4 +229,4 @@ Object.defineProperty(exports, 'transformTraces', {
229
229
  return transformTraces;
230
230
  }
231
231
  });
232
- //# sourceMappingURL=transformer-CLGZ0EQc.cjs.map
232
+ //# sourceMappingURL=transformer-DvDYyFRQ.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"transformer-CLGZ0EQc.cjs","names":["value?: AnyValue","attrs?: KeyValue[]","result: Record<string, unknown>","nanoStr: string","severity?: SeverityNumber","SeverityNumber","span: Span","SpanStatusCode","SpanKind","resourceAttrs: Record<string, unknown>","headers: Record<string, string>","request: ExportTraceServiceRequest","entries: Array<Omit<RequestEntry, 'id' | 'timestamp'>>","record: LogRecord","scopeName?: string","context: Record<string, unknown>","request: ExportLogsServiceRequest","entries: Array<Omit<LogEntry, 'id' | 'timestamp'>>","request: ExportMetricsServiceRequest","points: MetricDataPoint[]"],"sources":["../src/otlp/transformer.ts"],"sourcesContent":["import type { LogEntry, RequestEntry } from '../types';\nimport {\n\ttype AnyValue,\n\ttype ExportLogsServiceRequest,\n\ttype ExportMetricsServiceRequest,\n\ttype ExportTraceServiceRequest,\n\ttype KeyValue,\n\ttype LogRecord,\n\tSeverityNumber,\n\ttype Span,\n\tSpanKind,\n\tSpanStatusCode,\n} from './types';\n\n/**\n * Extract a primitive value from an AnyValue\n */\nfunction extractValue(value?: AnyValue): unknown {\n\tif (!value) return undefined;\n\tif (value.stringValue !== undefined) return value.stringValue;\n\tif (value.boolValue !== undefined) return value.boolValue;\n\tif (value.intValue !== undefined) return parseInt(value.intValue, 10);\n\tif (value.doubleValue !== undefined) return value.doubleValue;\n\tif (value.bytesValue !== undefined) return value.bytesValue;\n\tif (value.arrayValue) return value.arrayValue.values.map(extractValue);\n\tif (value.kvlistValue) return attributesToObject(value.kvlistValue.values);\n\treturn undefined;\n}\n\n/**\n * Convert KeyValue array to a plain object\n */\nfunction attributesToObject(attrs?: KeyValue[]): Record<string, unknown> {\n\tif (!attrs) return {};\n\tconst result: Record<string, unknown> = {};\n\tfor (const attr of attrs) {\n\t\tresult[attr.key] = extractValue(attr.value);\n\t}\n\treturn result;\n}\n\n/**\n * Convert nanoseconds string to Date\n */\nfunction nanoToDate(nanoStr: string): Date {\n\tconst nano = BigInt(nanoStr);\n\tconst ms = Number(nano / BigInt(1_000_000));\n\treturn new Date(ms);\n}\n\n/**\n * Convert nanoseconds string to milliseconds number\n */\nfunction nanoToMs(nanoStr: string): number {\n\tconst nano = BigInt(nanoStr);\n\treturn Number(nano / BigInt(1_000_000));\n}\n\n/**\n * Map OTLP severity number to Telescope log level\n */\nfunction mapSeverity(\n\tseverity?: SeverityNumber,\n): 'debug' | 'info' | 'warn' | 'error' {\n\tif (severity === undefined) return 'info';\n\tif (severity <= SeverityNumber.SEVERITY_NUMBER_DEBUG4) return 'debug';\n\tif (severity <= SeverityNumber.SEVERITY_NUMBER_INFO4) return 'info';\n\tif (severity <= SeverityNumber.SEVERITY_NUMBER_WARN4) return 'warn';\n\treturn 'error';\n}\n\n/**\n * Determine HTTP status from span attributes and status\n */\nfunction getHttpStatus(span: Span): number {\n\tconst attrs = attributesToObject(span.attributes);\n\n\t// Look for HTTP status code in various attribute names\n\tconst statusCode =\n\t\tattrs['http.status_code'] ??\n\t\tattrs['http.response.status_code'] ??\n\t\tattrs['http.response_status_code'];\n\n\tif (typeof statusCode === 'number') return statusCode;\n\tif (typeof statusCode === 'string') return parseInt(statusCode, 10) || 200;\n\n\t// Fall back to span status\n\tif (span.status?.code === SpanStatusCode.STATUS_CODE_ERROR) return 500;\n\tif (span.status?.code === SpanStatusCode.STATUS_CODE_OK) return 200;\n\n\treturn 200;\n}\n\n/**\n * Check if a span represents an HTTP server request\n */\nfunction isHttpServerSpan(span: Span): boolean {\n\tif (span.kind !== SpanKind.SPAN_KIND_SERVER) return false;\n\n\tconst attrs = attributesToObject(span.attributes);\n\treturn !!(\n\t\tattrs['http.method'] ||\n\t\tattrs['http.request.method'] ||\n\t\tattrs['http.url'] ||\n\t\tattrs['http.target'] ||\n\t\tattrs['url.path']\n\t);\n}\n\n/**\n * Transform HTTP-related span attributes to RequestEntry format\n */\nfunction transformHttpSpan(\n\tspan: Span,\n\tresourceAttrs: Record<string, unknown>,\n): Omit<RequestEntry, 'id' | 'timestamp'> {\n\tconst attrs = attributesToObject(span.attributes);\n\n\t// Extract HTTP method\n\tconst method = String(\n\t\tattrs['http.method'] ?? attrs['http.request.method'] ?? 'GET',\n\t).toUpperCase();\n\n\t// Extract path\n\tconst path = String(\n\t\tattrs['http.target'] ?? attrs['url.path'] ?? attrs['http.route'] ?? '/',\n\t);\n\n\t// Extract full URL\n\tconst url = String(\n\t\tattrs['http.url'] ?? attrs['url.full'] ?? `http://localhost${path}`,\n\t);\n\n\t// Extract headers (if available)\n\tconst headers: Record<string, string> = {};\n\tconst userAgent = attrs['http.user_agent'] ?? attrs['user_agent.original'];\n\tif (userAgent) headers['user-agent'] = String(userAgent);\n\n\tconst contentType = attrs['http.request.header.content_type'];\n\tif (contentType) headers['content-type'] = String(contentType);\n\n\t// Calculate duration\n\tconst startTime = nanoToMs(span.startTimeUnixNano);\n\tconst endTime = nanoToMs(span.endTimeUnixNano);\n\tconst duration = endTime - startTime;\n\n\t// Get status code\n\tconst status = getHttpStatus(span);\n\n\t// Extract client IP\n\tconst ip =\n\t\tattrs['net.peer.ip'] ?? attrs['client.address'] ?? attrs['http.client_ip'];\n\n\treturn {\n\t\tmethod,\n\t\tpath,\n\t\turl,\n\t\theaders,\n\t\tquery: {},\n\t\tstatus,\n\t\tresponseHeaders: {},\n\t\tduration,\n\t\tip: ip ? String(ip) : undefined,\n\t\ttags: [\n\t\t\t`trace:${span.traceId}`,\n\t\t\t`span:${span.spanId}`,\n\t\t\t...(resourceAttrs['service.name']\n\t\t\t\t? [`service:${resourceAttrs['service.name']}`]\n\t\t\t\t: []),\n\t\t],\n\t};\n}\n\n/**\n * Transform OTLP traces to Telescope RequestEntries\n * Only transforms HTTP server spans to request entries\n */\nexport function transformTraces(\n\trequest: ExportTraceServiceRequest,\n): Array<Omit<RequestEntry, 'id' | 'timestamp'>> {\n\tconst entries: Array<Omit<RequestEntry, 'id' | 'timestamp'>> = [];\n\n\tfor (const resourceSpans of request.resourceSpans ?? []) {\n\t\tconst resourceAttrs = attributesToObject(\n\t\t\tresourceSpans.resource?.attributes,\n\t\t);\n\n\t\tfor (const scopeSpans of resourceSpans.scopeSpans ?? []) {\n\t\t\tfor (const span of scopeSpans.spans ?? []) {\n\t\t\t\t// Only transform HTTP server spans\n\t\t\t\tif (isHttpServerSpan(span)) {\n\t\t\t\t\tentries.push(transformHttpSpan(span, resourceAttrs));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn entries;\n}\n\n/**\n * Transform a single OTLP log record to Telescope LogEntry\n */\nfunction transformLogRecord(\n\trecord: LogRecord,\n\tresourceAttrs: Record<string, unknown>,\n\tscopeName?: string,\n): Omit<LogEntry, 'id' | 'timestamp'> {\n\tconst attrs = attributesToObject(record.attributes);\n\n\t// Extract message from body\n\tlet message = '';\n\tif (record.body) {\n\t\tconst bodyValue = extractValue(record.body);\n\t\tmessage =\n\t\t\ttypeof bodyValue === 'string' ? bodyValue : JSON.stringify(bodyValue);\n\t}\n\n\t// Build context from attributes\n\tconst context: Record<string, unknown> = {\n\t\t...attrs,\n\t\t...resourceAttrs,\n\t};\n\n\tif (scopeName) {\n\t\tcontext['instrumentation.scope'] = scopeName;\n\t}\n\n\t// Add severity text if present\n\tif (record.severityText) {\n\t\tcontext['severity.text'] = record.severityText;\n\t}\n\n\treturn {\n\t\tlevel: mapSeverity(record.severityNumber),\n\t\tmessage,\n\t\tcontext: Object.keys(context).length > 0 ? context : undefined,\n\t\trequestId: record.spanId ? `span:${record.spanId}` : undefined,\n\t};\n}\n\n/**\n * Transform OTLP logs to Telescope LogEntries\n */\nexport function transformLogs(\n\trequest: ExportLogsServiceRequest,\n): Array<Omit<LogEntry, 'id' | 'timestamp'>> {\n\tconst entries: Array<Omit<LogEntry, 'id' | 'timestamp'>> = [];\n\n\tfor (const resourceLogs of request.resourceLogs ?? []) {\n\t\tconst resourceAttrs = attributesToObject(resourceLogs.resource?.attributes);\n\n\t\tfor (const scopeLogs of resourceLogs.scopeLogs ?? []) {\n\t\t\tconst scopeName = scopeLogs.scope?.name;\n\n\t\t\tfor (const record of scopeLogs.logRecords ?? []) {\n\t\t\t\tentries.push(transformLogRecord(record, resourceAttrs, scopeName));\n\t\t\t}\n\t\t}\n\t}\n\n\treturn entries;\n}\n\n/**\n * Extracted metric data point for recording\n */\nexport interface MetricDataPoint {\n\tname: string;\n\tdescription?: string;\n\tunit?: string;\n\tvalue: number;\n\ttimestamp: Date;\n\tattributes: Record<string, unknown>;\n\tresourceAttributes: Record<string, unknown>;\n\ttype: 'gauge' | 'sum' | 'histogram' | 'summary';\n}\n\n/**\n * Transform OTLP metrics to normalized data points\n * These can be used for custom metrics processing or forwarding\n */\nexport function transformMetrics(\n\trequest: ExportMetricsServiceRequest,\n): MetricDataPoint[] {\n\tconst points: MetricDataPoint[] = [];\n\n\tfor (const resourceMetrics of request.resourceMetrics ?? []) {\n\t\tconst resourceAttrs = attributesToObject(\n\t\t\tresourceMetrics.resource?.attributes,\n\t\t);\n\n\t\tfor (const scopeMetrics of resourceMetrics.scopeMetrics ?? []) {\n\t\t\tfor (const metric of scopeMetrics.metrics ?? []) {\n\t\t\t\tconst baseMeta = {\n\t\t\t\t\tname: metric.name,\n\t\t\t\t\tdescription: metric.description,\n\t\t\t\t\tunit: metric.unit,\n\t\t\t\t\tresourceAttributes: resourceAttrs,\n\t\t\t\t};\n\n\t\t\t\t// Handle gauge\n\t\t\t\tif (metric.gauge) {\n\t\t\t\t\tfor (const dp of metric.gauge.dataPoints) {\n\t\t\t\t\t\tpoints.push({\n\t\t\t\t\t\t\t...baseMeta,\n\t\t\t\t\t\t\tvalue: dp.asDouble ?? (dp.asInt ? parseInt(dp.asInt, 10) : 0),\n\t\t\t\t\t\t\ttimestamp: nanoToDate(dp.timeUnixNano),\n\t\t\t\t\t\t\tattributes: attributesToObject(dp.attributes),\n\t\t\t\t\t\t\ttype: 'gauge',\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Handle sum (counter)\n\t\t\t\tif (metric.sum) {\n\t\t\t\t\tfor (const dp of metric.sum.dataPoints) {\n\t\t\t\t\t\tpoints.push({\n\t\t\t\t\t\t\t...baseMeta,\n\t\t\t\t\t\t\tvalue: dp.asDouble ?? (dp.asInt ? parseInt(dp.asInt, 10) : 0),\n\t\t\t\t\t\t\ttimestamp: nanoToDate(dp.timeUnixNano),\n\t\t\t\t\t\t\tattributes: attributesToObject(dp.attributes),\n\t\t\t\t\t\t\ttype: 'sum',\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Handle histogram (extract sum as the value)\n\t\t\t\tif (metric.histogram) {\n\t\t\t\t\tfor (const dp of metric.histogram.dataPoints) {\n\t\t\t\t\t\tpoints.push({\n\t\t\t\t\t\t\t...baseMeta,\n\t\t\t\t\t\t\tvalue: dp.sum ?? 0,\n\t\t\t\t\t\t\ttimestamp: nanoToDate(dp.timeUnixNano),\n\t\t\t\t\t\t\tattributes: {\n\t\t\t\t\t\t\t\t...attributesToObject(dp.attributes),\n\t\t\t\t\t\t\t\tcount: parseInt(dp.count, 10),\n\t\t\t\t\t\t\t\tmin: dp.min,\n\t\t\t\t\t\t\t\tmax: dp.max,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\ttype: 'histogram',\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Handle summary\n\t\t\t\tif (metric.summary) {\n\t\t\t\t\tfor (const dp of metric.summary.dataPoints) {\n\t\t\t\t\t\tpoints.push({\n\t\t\t\t\t\t\t...baseMeta,\n\t\t\t\t\t\t\tvalue: dp.sum ?? 0,\n\t\t\t\t\t\t\ttimestamp: nanoToDate(dp.timeUnixNano),\n\t\t\t\t\t\t\tattributes: {\n\t\t\t\t\t\t\t\t...attributesToObject(dp.attributes),\n\t\t\t\t\t\t\t\tcount: parseInt(dp.count, 10),\n\t\t\t\t\t\t\t\tquantiles: dp.quantileValues,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\ttype: 'summary',\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn points;\n}\n"],"mappings":";;;;;;AAiBA,SAAS,aAAaA,OAA2B;AAChD,MAAK,MAAO;AACZ,KAAI,MAAM,uBAA2B,QAAO,MAAM;AAClD,KAAI,MAAM,qBAAyB,QAAO,MAAM;AAChD,KAAI,MAAM,oBAAwB,QAAO,SAAS,MAAM,UAAU,GAAG;AACrE,KAAI,MAAM,uBAA2B,QAAO,MAAM;AAClD,KAAI,MAAM,sBAA0B,QAAO,MAAM;AACjD,KAAI,MAAM,WAAY,QAAO,MAAM,WAAW,OAAO,IAAI,aA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ACV,MAAK,MAAM,MAAM,OAAO,MAAM,WAC7B,QAAO,KAAK;IACX,GAAG;IACH,OAAO,GAAG,aAAa,GAAG,QAAQ,SAAS,GAAG,OAAO,GAAG,GAAG;IAC3D,WAAW,WAAW,GAAG,aAAa;IACtC,YAAY,mBAAmB,GAAG,WAAW;IAC7C,MAAM;GACN,EAAC;AAKJ,OAAI,OAAO,IACV,MAAK,MAAM,MAAM,OAAO,IAAI,WAC3B,QAAO,KAAK;IACX,GAAG;IACH,OAAO,GAAG,aAAa,GAAG,QAAQ,SAAS,GAAG,OAAO,GAAG,GAAG;IAC3D,WAAW,WAAW,GAAG,aAAa;IACtC,YAAY,mBAAmB,GAAG,WAAW;IAC7C,MAAM;GACN,EAAC;AAKJ,OAAI,OAAO,UACV,MAAK,MAAM,MAAM,OAAO,UAAU,WACjC,QAAO,KAAK;IACX,GAAG;IACH,OAAO,GAAG,OAAO;IACjB,WAAW,WAAW,GAAG,aAAa;IACtC,YAAY;KACX,GAAG,mBAAmB,GAAG,WAAW;KACpC,OAAO,SAAS,GAAG,OAAO,GAAG;KAC7B,KAAK,GAAG;KACR,KAAK,GAAG;IACR;IACD,MAAM;GACN,EAAC;AAKJ,OAAI,OAAO,QACV,MAAK,MAAM,MAAM,OAAO,QAAQ,WAC/B,QAAO,KAAK;IACX,GAAG;IACH,OAAO,GAAG,OAAO;IACjB,WAAW,WAAW,GAAG,aAAa;IACtC,YAAY;KACX,GAAG,mBAAmB,GAAG,WAAW;KACpC,OAAO,SAAS,GAAG,OAAO,GAAG;KAC7B,WAAW,GAAG;IACd;IACD,MAAM;GACN,EAAC;EAGJ;CAEF;AAED,QAAO;AACP"}
1
+ {"version":3,"file":"transformer-DvDYyFRQ.cjs","names":["value?: AnyValue","attrs?: KeyValue[]","result: Record<string, unknown>","nanoStr: string","severity?: SeverityNumber","SeverityNumber","span: Span","SpanStatusCode","SpanKind","resourceAttrs: Record<string, unknown>","headers: Record<string, string>","request: ExportTraceServiceRequest","entries: Array<Omit<RequestEntry, 'id' | 'timestamp'>>","record: LogRecord","scopeName?: string","context: Record<string, unknown>","request: ExportLogsServiceRequest","entries: Array<Omit<LogEntry, 'id' | 'timestamp'>>","request: ExportMetricsServiceRequest","points: MetricDataPoint[]"],"sources":["../src/otlp/transformer.ts"],"sourcesContent":["import type { LogEntry, RequestEntry } from '../types';\nimport {\n\ttype AnyValue,\n\ttype ExportLogsServiceRequest,\n\ttype ExportMetricsServiceRequest,\n\ttype ExportTraceServiceRequest,\n\ttype KeyValue,\n\ttype LogRecord,\n\tSeverityNumber,\n\ttype Span,\n\tSpanKind,\n\tSpanStatusCode,\n} from './types';\n\n/**\n * Extract a primitive value from an AnyValue\n */\nfunction extractValue(value?: AnyValue): unknown {\n\tif (!value) return undefined;\n\tif (value.stringValue !== undefined) return value.stringValue;\n\tif (value.boolValue !== undefined) return value.boolValue;\n\tif (value.intValue !== undefined) return parseInt(value.intValue, 10);\n\tif (value.doubleValue !== undefined) return value.doubleValue;\n\tif (value.bytesValue !== undefined) return value.bytesValue;\n\tif (value.arrayValue) return value.arrayValue.values.map(extractValue);\n\tif (value.kvlistValue) return attributesToObject(value.kvlistValue.values);\n\treturn undefined;\n}\n\n/**\n * Convert KeyValue array to a plain object\n */\nfunction attributesToObject(attrs?: KeyValue[]): Record<string, unknown> {\n\tif (!attrs) return {};\n\tconst result: Record<string, unknown> = {};\n\tfor (const attr of attrs) {\n\t\tresult[attr.key] = extractValue(attr.value);\n\t}\n\treturn result;\n}\n\n/**\n * Convert nanoseconds string to Date\n */\nfunction nanoToDate(nanoStr: string): Date {\n\tconst nano = BigInt(nanoStr);\n\tconst ms = Number(nano / BigInt(1_000_000));\n\treturn new Date(ms);\n}\n\n/**\n * Convert nanoseconds string to milliseconds number\n */\nfunction nanoToMs(nanoStr: string): number {\n\tconst nano = BigInt(nanoStr);\n\treturn Number(nano / BigInt(1_000_000));\n}\n\n/**\n * Map OTLP severity number to Telescope log level\n */\nfunction mapSeverity(\n\tseverity?: SeverityNumber,\n): 'debug' | 'info' | 'warn' | 'error' {\n\tif (severity === undefined) return 'info';\n\tif (severity <= SeverityNumber.SEVERITY_NUMBER_DEBUG4) return 'debug';\n\tif (severity <= SeverityNumber.SEVERITY_NUMBER_INFO4) return 'info';\n\tif (severity <= SeverityNumber.SEVERITY_NUMBER_WARN4) return 'warn';\n\treturn 'error';\n}\n\n/**\n * Determine HTTP status from span attributes and status\n */\nfunction getHttpStatus(span: Span): number {\n\tconst attrs = attributesToObject(span.attributes);\n\n\t// Look for HTTP status code in various attribute names\n\tconst statusCode =\n\t\tattrs['http.status_code'] ??\n\t\tattrs['http.response.status_code'] ??\n\t\tattrs['http.response_status_code'];\n\n\tif (typeof statusCode === 'number') return statusCode;\n\tif (typeof statusCode === 'string') return parseInt(statusCode, 10) || 200;\n\n\t// Fall back to span status\n\tif (span.status?.code === SpanStatusCode.STATUS_CODE_ERROR) return 500;\n\tif (span.status?.code === SpanStatusCode.STATUS_CODE_OK) return 200;\n\n\treturn 200;\n}\n\n/**\n * Check if a span represents an HTTP server request\n */\nfunction isHttpServerSpan(span: Span): boolean {\n\tif (span.kind !== SpanKind.SPAN_KIND_SERVER) return false;\n\n\tconst attrs = attributesToObject(span.attributes);\n\treturn !!(\n\t\tattrs['http.method'] ||\n\t\tattrs['http.request.method'] ||\n\t\tattrs['http.url'] ||\n\t\tattrs['http.target'] ||\n\t\tattrs['url.path']\n\t);\n}\n\n/**\n * Transform HTTP-related span attributes to RequestEntry format\n */\nfunction transformHttpSpan(\n\tspan: Span,\n\tresourceAttrs: Record<string, unknown>,\n): Omit<RequestEntry, 'id' | 'timestamp'> {\n\tconst attrs = attributesToObject(span.attributes);\n\n\t// Extract HTTP method\n\tconst method = String(\n\t\tattrs['http.method'] ?? attrs['http.request.method'] ?? 'GET',\n\t).toUpperCase();\n\n\t// Extract path\n\tconst path = String(\n\t\tattrs['http.target'] ?? attrs['url.path'] ?? attrs['http.route'] ?? '/',\n\t);\n\n\t// Extract full URL\n\tconst url = String(\n\t\tattrs['http.url'] ?? attrs['url.full'] ?? `http://localhost${path}`,\n\t);\n\n\t// Extract headers (if available)\n\tconst headers: Record<string, string> = {};\n\tconst userAgent = attrs['http.user_agent'] ?? attrs['user_agent.original'];\n\tif (userAgent) headers['user-agent'] = String(userAgent);\n\n\tconst contentType = attrs['http.request.header.content_type'];\n\tif (contentType) headers['content-type'] = String(contentType);\n\n\t// Calculate duration\n\tconst startTime = nanoToMs(span.startTimeUnixNano);\n\tconst endTime = nanoToMs(span.endTimeUnixNano);\n\tconst duration = endTime - startTime;\n\n\t// Get status code\n\tconst status = getHttpStatus(span);\n\n\t// Extract client IP\n\tconst ip =\n\t\tattrs['net.peer.ip'] ?? attrs['client.address'] ?? attrs['http.client_ip'];\n\n\treturn {\n\t\tmethod,\n\t\tpath,\n\t\turl,\n\t\theaders,\n\t\tquery: {},\n\t\tstatus,\n\t\tresponseHeaders: {},\n\t\tduration,\n\t\tip: ip ? String(ip) : undefined,\n\t\ttags: [\n\t\t\t`trace:${span.traceId}`,\n\t\t\t`span:${span.spanId}`,\n\t\t\t...(resourceAttrs['service.name']\n\t\t\t\t? [`service:${resourceAttrs['service.name']}`]\n\t\t\t\t: []),\n\t\t],\n\t};\n}\n\n/**\n * Transform OTLP traces to Telescope RequestEntries\n * Only transforms HTTP server spans to request entries\n */\nexport function transformTraces(\n\trequest: ExportTraceServiceRequest,\n): Array<Omit<RequestEntry, 'id' | 'timestamp'>> {\n\tconst entries: Array<Omit<RequestEntry, 'id' | 'timestamp'>> = [];\n\n\tfor (const resourceSpans of request.resourceSpans ?? []) {\n\t\tconst resourceAttrs = attributesToObject(\n\t\t\tresourceSpans.resource?.attributes,\n\t\t);\n\n\t\tfor (const scopeSpans of resourceSpans.scopeSpans ?? []) {\n\t\t\tfor (const span of scopeSpans.spans ?? []) {\n\t\t\t\t// Only transform HTTP server spans\n\t\t\t\tif (isHttpServerSpan(span)) {\n\t\t\t\t\tentries.push(transformHttpSpan(span, resourceAttrs));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn entries;\n}\n\n/**\n * Transform a single OTLP log record to Telescope LogEntry\n */\nfunction transformLogRecord(\n\trecord: LogRecord,\n\tresourceAttrs: Record<string, unknown>,\n\tscopeName?: string,\n): Omit<LogEntry, 'id' | 'timestamp'> {\n\tconst attrs = attributesToObject(record.attributes);\n\n\t// Extract message from body\n\tlet message = '';\n\tif (record.body) {\n\t\tconst bodyValue = extractValue(record.body);\n\t\tmessage =\n\t\t\ttypeof bodyValue === 'string' ? bodyValue : JSON.stringify(bodyValue);\n\t}\n\n\t// Build context from attributes\n\tconst context: Record<string, unknown> = {\n\t\t...attrs,\n\t\t...resourceAttrs,\n\t};\n\n\tif (scopeName) {\n\t\tcontext['instrumentation.scope'] = scopeName;\n\t}\n\n\t// Add severity text if present\n\tif (record.severityText) {\n\t\tcontext['severity.text'] = record.severityText;\n\t}\n\n\treturn {\n\t\tlevel: mapSeverity(record.severityNumber),\n\t\tmessage,\n\t\tcontext: Object.keys(context).length > 0 ? context : undefined,\n\t\trequestId: record.spanId ? `span:${record.spanId}` : undefined,\n\t};\n}\n\n/**\n * Transform OTLP logs to Telescope LogEntries\n */\nexport function transformLogs(\n\trequest: ExportLogsServiceRequest,\n): Array<Omit<LogEntry, 'id' | 'timestamp'>> {\n\tconst entries: Array<Omit<LogEntry, 'id' | 'timestamp'>> = [];\n\n\tfor (const resourceLogs of request.resourceLogs ?? []) {\n\t\tconst resourceAttrs = attributesToObject(resourceLogs.resource?.attributes);\n\n\t\tfor (const scopeLogs of resourceLogs.scopeLogs ?? []) {\n\t\t\tconst scopeName = scopeLogs.scope?.name;\n\n\t\t\tfor (const record of scopeLogs.logRecords ?? []) {\n\t\t\t\tentries.push(transformLogRecord(record, resourceAttrs, scopeName));\n\t\t\t}\n\t\t}\n\t}\n\n\treturn entries;\n}\n\n/**\n * Extracted metric data point for recording\n */\nexport interface MetricDataPoint {\n\tname: string;\n\tdescription?: string;\n\tunit?: string;\n\tvalue: number;\n\ttimestamp: Date;\n\tattributes: Record<string, unknown>;\n\tresourceAttributes: Record<string, unknown>;\n\ttype: 'gauge' | 'sum' | 'histogram' | 'summary';\n}\n\n/**\n * Transform OTLP metrics to normalized data points\n * These can be used for custom metrics processing or forwarding\n */\nexport function transformMetrics(\n\trequest: ExportMetricsServiceRequest,\n): MetricDataPoint[] {\n\tconst points: MetricDataPoint[] = [];\n\n\tfor (const resourceMetrics of request.resourceMetrics ?? []) {\n\t\tconst resourceAttrs = attributesToObject(\n\t\t\tresourceMetrics.resource?.attributes,\n\t\t);\n\n\t\tfor (const scopeMetrics of resourceMetrics.scopeMetrics ?? []) {\n\t\t\tfor (const metric of scopeMetrics.metrics ?? []) {\n\t\t\t\tconst baseMeta = {\n\t\t\t\t\tname: metric.name,\n\t\t\t\t\tdescription: metric.description,\n\t\t\t\t\tunit: metric.unit,\n\t\t\t\t\tresourceAttributes: resourceAttrs,\n\t\t\t\t};\n\n\t\t\t\t// Handle gauge\n\t\t\t\tif (metric.gauge) {\n\t\t\t\t\tfor (const dp of metric.gauge.dataPoints) {\n\t\t\t\t\t\tpoints.push({\n\t\t\t\t\t\t\t...baseMeta,\n\t\t\t\t\t\t\tvalue: dp.asDouble ?? (dp.asInt ? parseInt(dp.asInt, 10) : 0),\n\t\t\t\t\t\t\ttimestamp: nanoToDate(dp.timeUnixNano),\n\t\t\t\t\t\t\tattributes: attributesToObject(dp.attributes),\n\t\t\t\t\t\t\ttype: 'gauge',\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Handle sum (counter)\n\t\t\t\tif (metric.sum) {\n\t\t\t\t\tfor (const dp of metric.sum.dataPoints) {\n\t\t\t\t\t\tpoints.push({\n\t\t\t\t\t\t\t...baseMeta,\n\t\t\t\t\t\t\tvalue: dp.asDouble ?? (dp.asInt ? parseInt(dp.asInt, 10) : 0),\n\t\t\t\t\t\t\ttimestamp: nanoToDate(dp.timeUnixNano),\n\t\t\t\t\t\t\tattributes: attributesToObject(dp.attributes),\n\t\t\t\t\t\t\ttype: 'sum',\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Handle histogram (extract sum as the value)\n\t\t\t\tif (metric.histogram) {\n\t\t\t\t\tfor (const dp of metric.histogram.dataPoints) {\n\t\t\t\t\t\tpoints.push({\n\t\t\t\t\t\t\t...baseMeta,\n\t\t\t\t\t\t\tvalue: dp.sum ?? 0,\n\t\t\t\t\t\t\ttimestamp: nanoToDate(dp.timeUnixNano),\n\t\t\t\t\t\t\tattributes: {\n\t\t\t\t\t\t\t\t...attributesToObject(dp.attributes),\n\t\t\t\t\t\t\t\tcount: parseInt(dp.count, 10),\n\t\t\t\t\t\t\t\tmin: dp.min,\n\t\t\t\t\t\t\t\tmax: dp.max,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\ttype: 'histogram',\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Handle summary\n\t\t\t\tif (metric.summary) {\n\t\t\t\t\tfor (const dp of metric.summary.dataPoints) {\n\t\t\t\t\t\tpoints.push({\n\t\t\t\t\t\t\t...baseMeta,\n\t\t\t\t\t\t\tvalue: dp.sum ?? 0,\n\t\t\t\t\t\t\ttimestamp: nanoToDate(dp.timeUnixNano),\n\t\t\t\t\t\t\tattributes: {\n\t\t\t\t\t\t\t\t...attributesToObject(dp.attributes),\n\t\t\t\t\t\t\t\tcount: parseInt(dp.count, 10),\n\t\t\t\t\t\t\t\tquantiles: dp.quantileValues,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\ttype: 'summary',\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn points;\n}\n"],"mappings":";;;;;;AAiBA,SAAS,aAAaA,OAA2B;AAChD,MAAK,MAAO;AACZ,KAAI,MAAM,uBAA2B,QAAO,MAAM;AAClD,KAAI,MAAM,qBAA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WAMP;SACF;;;;;;;UAYS,SAAA;;SAET;;OAEF;;;;;UAMW,eAAA;;;;;;;;;;;;;UAcA,cAAA;;;;;;;;;;;;;;;;;;cAkBJ;;;;;UAMI,eAAA;;;;;;;;;;;;;;;;;;;UAoBA,kBAAA;;;;;;;;;;;;;UAcA,mBAAA;;UAER;;;;;;;;;UAUQ,aAAA;;;;;;;;;;;;;;;;;;sBAkBI;;;;;UAMJ,cAAA;;;;;;;;;;;;;;;;;;;UAoBA,eAAA;;;;;;;;;;;;;;;;;;;;;;sBAsBI;;cAER"}
@@ -75,4 +75,4 @@ Object.defineProperty(exports, 'SpanStatusCode', {
75
75
  return SpanStatusCode;
76
76
  }
77
77
  });
78
- //# sourceMappingURL=types-Dsh-DIO_.cjs.map
78
+ //# sourceMappingURL=types-BBeTDpHr.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"types-Dsh-DIO_.cjs","names":[],"sources":["../src/otlp/types.ts"],"sourcesContent":["/**\n * OTLP JSON types based on OpenTelemetry Protocol specification.\n * These types represent the JSON encoding of OTLP protobuf messages.\n * @see https://opentelemetry.io/docs/specs/otlp/\n */\n\n// ============================================\n// Common Types\n// ============================================\n\n/**\n * Key-value pair for attributes\n */\nexport interface KeyValue {\n\tkey: string;\n\tvalue: AnyValue;\n}\n\n/**\n * Any value type (string, bool, int, double, array, kvlist, bytes)\n */\nexport interface AnyValue {\n\tstringValue?: string;\n\tboolValue?: boolean;\n\tintValue?: string; // int64 as string\n\tdoubleValue?: number;\n\tarrayValue?: ArrayValue;\n\tkvlistValue?: KeyValueList;\n\tbytesValue?: string; // base64 encoded\n}\n\nexport interface ArrayValue {\n\tvalues: AnyValue[];\n}\n\nexport interface KeyValueList {\n\tvalues: KeyValue[];\n}\n\n/**\n * Resource represents the entity producing telemetry\n */\nexport interface Resource {\n\tattributes?: KeyValue[];\n\tdroppedAttributesCount?: number;\n}\n\n/**\n * InstrumentationScope represents the instrumentation library\n */\nexport interface InstrumentationScope {\n\tname: string;\n\tversion?: string;\n\tattributes?: KeyValue[];\n\tdroppedAttributesCount?: number;\n}\n\n// ============================================\n// Trace Types\n// ============================================\n\n/**\n * Root message for trace export\n */\nexport interface ExportTraceServiceRequest {\n\tresourceSpans?: ResourceSpans[];\n}\n\nexport interface ResourceSpans {\n\tresource?: Resource;\n\tscopeSpans?: ScopeSpans[];\n\tschemaUrl?: string;\n}\n\nexport interface ScopeSpans {\n\tscope?: InstrumentationScope;\n\tspans?: Span[];\n\tschemaUrl?: string;\n}\n\nexport interface Span {\n\ttraceId: string; // hex encoded 16 bytes\n\tspanId: string; // hex encoded 8 bytes\n\ttraceState?: string;\n\tparentSpanId?: string; // hex encoded 8 bytes\n\tflags?: number;\n\tname: string;\n\tkind?: SpanKind;\n\tstartTimeUnixNano: string; // uint64 as string\n\tendTimeUnixNano: string; // uint64 as string\n\tattributes?: KeyValue[];\n\tdroppedAttributesCount?: number;\n\tevents?: SpanEvent[];\n\tdroppedEventsCount?: number;\n\tlinks?: SpanLink[];\n\tdroppedLinksCount?: number;\n\tstatus?: SpanStatus;\n}\n\nexport enum SpanKind {\n\tSPAN_KIND_UNSPECIFIED = 0,\n\tSPAN_KIND_INTERNAL = 1,\n\tSPAN_KIND_SERVER = 2,\n\tSPAN_KIND_CLIENT = 3,\n\tSPAN_KIND_PRODUCER = 4,\n\tSPAN_KIND_CONSUMER = 5,\n}\n\nexport interface SpanEvent {\n\ttimeUnixNano: string;\n\tname: string;\n\tattributes?: KeyValue[];\n\tdroppedAttributesCount?: number;\n}\n\nexport interface SpanLink {\n\ttraceId: string;\n\tspanId: string;\n\ttraceState?: string;\n\tattributes?: KeyValue[];\n\tdroppedAttributesCount?: number;\n\tflags?: number;\n}\n\nexport interface SpanStatus {\n\tmessage?: string;\n\tcode?: SpanStatusCode;\n}\n\nexport enum SpanStatusCode {\n\tSTATUS_CODE_UNSET = 0,\n\tSTATUS_CODE_OK = 1,\n\tSTATUS_CODE_ERROR = 2,\n}\n\n// ============================================\n// Log Types\n// ============================================\n\n/**\n * Root message for log export\n */\nexport interface ExportLogsServiceRequest {\n\tresourceLogs?: ResourceLogs[];\n}\n\nexport interface ResourceLogs {\n\tresource?: Resource;\n\tscopeLogs?: ScopeLogs[];\n\tschemaUrl?: string;\n}\n\nexport interface ScopeLogs {\n\tscope?: InstrumentationScope;\n\tlogRecords?: LogRecord[];\n\tschemaUrl?: string;\n}\n\nexport interface LogRecord {\n\ttimeUnixNano?: string;\n\tobservedTimeUnixNano: string;\n\tseverityNumber?: SeverityNumber;\n\tseverityText?: string;\n\tbody?: AnyValue;\n\tattributes?: KeyValue[];\n\tdroppedAttributesCount?: number;\n\tflags?: number;\n\ttraceId?: string;\n\tspanId?: string;\n}\n\nexport enum SeverityNumber {\n\tSEVERITY_NUMBER_UNSPECIFIED = 0,\n\tSEVERITY_NUMBER_TRACE = 1,\n\tSEVERITY_NUMBER_TRACE2 = 2,\n\tSEVERITY_NUMBER_TRACE3 = 3,\n\tSEVERITY_NUMBER_TRACE4 = 4,\n\tSEVERITY_NUMBER_DEBUG = 5,\n\tSEVERITY_NUMBER_DEBUG2 = 6,\n\tSEVERITY_NUMBER_DEBUG3 = 7,\n\tSEVERITY_NUMBER_DEBUG4 = 8,\n\tSEVERITY_NUMBER_INFO = 9,\n\tSEVERITY_NUMBER_INFO2 = 10,\n\tSEVERITY_NUMBER_INFO3 = 11,\n\tSEVERITY_NUMBER_INFO4 = 12,\n\tSEVERITY_NUMBER_WARN = 13,\n\tSEVERITY_NUMBER_WARN2 = 14,\n\tSEVERITY_NUMBER_WARN3 = 15,\n\tSEVERITY_NUMBER_WARN4 = 16,\n\tSEVERITY_NUMBER_ERROR = 17,\n\tSEVERITY_NUMBER_ERROR2 = 18,\n\tSEVERITY_NUMBER_ERROR3 = 19,\n\tSEVERITY_NUMBER_ERROR4 = 20,\n\tSEVERITY_NUMBER_FATAL = 21,\n\tSEVERITY_NUMBER_FATAL2 = 22,\n\tSEVERITY_NUMBER_FATAL3 = 23,\n\tSEVERITY_NUMBER_FATAL4 = 24,\n}\n\n// ============================================\n// Metrics Types\n// ============================================\n\n/**\n * Root message for metrics export\n */\nexport interface ExportMetricsServiceRequest {\n\tresourceMetrics?: ResourceMetrics[];\n}\n\nexport interface ResourceMetrics {\n\tresource?: Resource;\n\tscopeMetrics?: ScopeMetrics[];\n\tschemaUrl?: string;\n}\n\nexport interface ScopeMetrics {\n\tscope?: InstrumentationScope;\n\tmetrics?: Metric[];\n\tschemaUrl?: string;\n}\n\nexport interface Metric {\n\tname: string;\n\tdescription?: string;\n\tunit?: string;\n\tmetadata?: KeyValue[];\n\tgauge?: Gauge;\n\tsum?: Sum;\n\thistogram?: Histogram;\n\texponentialHistogram?: ExponentialHistogram;\n\tsummary?: Summary;\n}\n\nexport interface Gauge {\n\tdataPoints: NumberDataPoint[];\n}\n\nexport interface Sum {\n\tdataPoints: NumberDataPoint[];\n\taggregationTemporality: AggregationTemporality;\n\tisMonotonic?: boolean;\n}\n\nexport interface Histogram {\n\tdataPoints: HistogramDataPoint[];\n\taggregationTemporality: AggregationTemporality;\n}\n\nexport interface ExponentialHistogram {\n\tdataPoints: ExponentialHistogramDataPoint[];\n\taggregationTemporality: AggregationTemporality;\n}\n\nexport interface Summary {\n\tdataPoints: SummaryDataPoint[];\n}\n\nexport enum AggregationTemporality {\n\tAGGREGATION_TEMPORALITY_UNSPECIFIED = 0,\n\tAGGREGATION_TEMPORALITY_DELTA = 1,\n\tAGGREGATION_TEMPORALITY_CUMULATIVE = 2,\n}\n\nexport interface NumberDataPoint {\n\tattributes?: KeyValue[];\n\tstartTimeUnixNano?: string;\n\ttimeUnixNano: string;\n\tasDouble?: number;\n\tasInt?: string;\n\texemplars?: Exemplar[];\n\tflags?: number;\n}\n\nexport interface HistogramDataPoint {\n\tattributes?: KeyValue[];\n\tstartTimeUnixNano?: string;\n\ttimeUnixNano: string;\n\tcount: string;\n\tsum?: number;\n\tbucketCounts?: string[];\n\texplicitBounds?: number[];\n\texemplars?: Exemplar[];\n\tflags?: number;\n\tmin?: number;\n\tmax?: number;\n}\n\nexport interface ExponentialHistogramDataPoint {\n\tattributes?: KeyValue[];\n\tstartTimeUnixNano?: string;\n\ttimeUnixNano: string;\n\tcount: string;\n\tsum?: number;\n\tscale?: number;\n\tzeroCount?: string;\n\tpositive?: Buckets;\n\tnegative?: Buckets;\n\tflags?: number;\n\texemplars?: Exemplar[];\n\tmin?: number;\n\tmax?: number;\n\tzeroThreshold?: number;\n}\n\nexport interface Buckets {\n\toffset?: number;\n\tbucketCounts?: string[];\n}\n\nexport interface SummaryDataPoint {\n\tattributes?: KeyValue[];\n\tstartTimeUnixNano?: string;\n\ttimeUnixNano: string;\n\tcount: string;\n\tsum?: number;\n\tquantileValues?: ValueAtQuantile[];\n\tflags?: number;\n}\n\nexport interface ValueAtQuantile {\n\tquantile: number;\n\tvalue: number;\n}\n\nexport interface Exemplar {\n\tfilteredAttributes?: KeyValue[];\n\ttimeUnixNano: string;\n\tasDouble?: number;\n\tasInt?: string;\n\tspanId?: string;\n\ttraceId?: string;\n}\n\n// ============================================\n// Response Types\n// ============================================\n\nexport interface ExportTraceServiceResponse {\n\tpartialSuccess?: ExportTracePartialSuccess;\n}\n\nexport interface ExportTracePartialSuccess {\n\trejectedSpans?: string;\n\terrorMessage?: string;\n}\n\nexport interface ExportLogsServiceResponse {\n\tpartialSuccess?: ExportLogsPartialSuccess;\n}\n\nexport interface ExportLogsPartialSuccess {\n\trejectedLogRecords?: string;\n\terrorMessage?: string;\n}\n\nexport interface ExportMetricsServiceResponse {\n\tpartialSuccess?: ExportMetricsPartialSuccess;\n}\n\nexport interface ExportMetricsPartialSuccess {\n\trejectedDataPoints?: string;\n\terrorMessage?: string;\n}\n"],"mappings":";;AAmGA,IAAY,gDAAL;AACN;AACA;AACA;AACA;AACA;AACA;;AACA;AAuBD,IAAY,4DAAL;AACN;AACA;AACA;;AACA;AAsCD,IAAY,4DAAL;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA;AA6DD,IAAY,4EAAL;AACN;AACA;AACA;;AACA"}
1
+ {"version":3,"file":"types-BBeTDpHr.cjs","names":[],"sources":["../src/otlp/types.ts"],"sourcesContent":["/**\n * OTLP JSON types based on OpenTelemetry Protocol specification.\n * These types represent the JSON encoding of OTLP protobuf messages.\n * @see https://opentelemetry.io/docs/specs/otlp/\n */\n\n// ============================================\n// Common Types\n// ============================================\n\n/**\n * Key-value pair for attributes\n */\nexport interface KeyValue {\n\tkey: string;\n\tvalue: AnyValue;\n}\n\n/**\n * Any value type (string, bool, int, double, array, kvlist, bytes)\n */\nexport interface AnyValue {\n\tstringValue?: string;\n\tboolValue?: boolean;\n\tintValue?: string; // int64 as string\n\tdoubleValue?: number;\n\tarrayValue?: ArrayValue;\n\tkvlistValue?: KeyValueList;\n\tbytesValue?: string; // base64 encoded\n}\n\nexport interface ArrayValue {\n\tvalues: AnyValue[];\n}\n\nexport interface KeyValueList {\n\tvalues: KeyValue[];\n}\n\n/**\n * Resource represents the entity producing telemetry\n */\nexport interface Resource {\n\tattributes?: KeyValue[];\n\tdroppedAttributesCount?: number;\n}\n\n/**\n * InstrumentationScope represents the instrumentation library\n */\nexport interface InstrumentationScope {\n\tname: string;\n\tversion?: string;\n\tattributes?: KeyValue[];\n\tdroppedAttributesCount?: number;\n}\n\n// ============================================\n// Trace Types\n// ============================================\n\n/**\n * Root message for trace export\n */\nexport interface ExportTraceServiceRequest {\n\tresourceSpans?: ResourceSpans[];\n}\n\nexport interface ResourceSpans {\n\tresource?: Resource;\n\tscopeSpans?: ScopeSpans[];\n\tschemaUrl?: string;\n}\n\nexport interface ScopeSpans {\n\tscope?: InstrumentationScope;\n\tspans?: Span[];\n\tschemaUrl?: string;\n}\n\nexport interface Span {\n\ttraceId: string; // hex encoded 16 bytes\n\tspanId: string; // hex encoded 8 bytes\n\ttraceState?: string;\n\tparentSpanId?: string; // hex encoded 8 bytes\n\tflags?: number;\n\tname: string;\n\tkind?: SpanKind;\n\tstartTimeUnixNano: string; // uint64 as string\n\tendTimeUnixNano: string; // uint64 as string\n\tattributes?: KeyValue[];\n\tdroppedAttributesCount?: number;\n\tevents?: SpanEvent[];\n\tdroppedEventsCount?: number;\n\tlinks?: SpanLink[];\n\tdroppedLinksCount?: number;\n\tstatus?: SpanStatus;\n}\n\nexport enum SpanKind {\n\tSPAN_KIND_UNSPECIFIED = 0,\n\tSPAN_KIND_INTERNAL = 1,\n\tSPAN_KIND_SERVER = 2,\n\tSPAN_KIND_CLIENT = 3,\n\tSPAN_KIND_PRODUCER = 4,\n\tSPAN_KIND_CONSUMER = 5,\n}\n\nexport interface SpanEvent {\n\ttimeUnixNano: string;\n\tname: string;\n\tattributes?: KeyValue[];\n\tdroppedAttributesCount?: number;\n}\n\nexport interface SpanLink {\n\ttraceId: string;\n\tspanId: string;\n\ttraceState?: string;\n\tattributes?: KeyValue[];\n\tdroppedAttributesCount?: number;\n\tflags?: number;\n}\n\nexport interface SpanStatus {\n\tmessage?: string;\n\tcode?: SpanStatusCode;\n}\n\nexport enum SpanStatusCode {\n\tSTATUS_CODE_UNSET = 0,\n\tSTATUS_CODE_OK = 1,\n\tSTATUS_CODE_ERROR = 2,\n}\n\n// ============================================\n// Log Types\n// ============================================\n\n/**\n * Root message for log export\n */\nexport interface ExportLogsServiceRequest {\n\tresourceLogs?: ResourceLogs[];\n}\n\nexport interface ResourceLogs {\n\tresource?: Resource;\n\tscopeLogs?: ScopeLogs[];\n\tschemaUrl?: string;\n}\n\nexport interface ScopeLogs {\n\tscope?: InstrumentationScope;\n\tlogRecords?: LogRecord[];\n\tschemaUrl?: string;\n}\n\nexport interface LogRecord {\n\ttimeUnixNano?: string;\n\tobservedTimeUnixNano: string;\n\tseverityNumber?: SeverityNumber;\n\tseverityText?: string;\n\tbody?: AnyValue;\n\tattributes?: KeyValue[];\n\tdroppedAttributesCount?: number;\n\tflags?: number;\n\ttraceId?: string;\n\tspanId?: string;\n}\n\nexport enum SeverityNumber {\n\tSEVERITY_NUMBER_UNSPECIFIED = 0,\n\tSEVERITY_NUMBER_TRACE = 1,\n\tSEVERITY_NUMBER_TRACE2 = 2,\n\tSEVERITY_NUMBER_TRACE3 = 3,\n\tSEVERITY_NUMBER_TRACE4 = 4,\n\tSEVERITY_NUMBER_DEBUG = 5,\n\tSEVERITY_NUMBER_DEBUG2 = 6,\n\tSEVERITY_NUMBER_DEBUG3 = 7,\n\tSEVERITY_NUMBER_DEBUG4 = 8,\n\tSEVERITY_NUMBER_INFO = 9,\n\tSEVERITY_NUMBER_INFO2 = 10,\n\tSEVERITY_NUMBER_INFO3 = 11,\n\tSEVERITY_NUMBER_INFO4 = 12,\n\tSEVERITY_NUMBER_WARN = 13,\n\tSEVERITY_NUMBER_WARN2 = 14,\n\tSEVERITY_NUMBER_WARN3 = 15,\n\tSEVERITY_NUMBER_WARN4 = 16,\n\tSEVERITY_NUMBER_ERROR = 17,\n\tSEVERITY_NUMBER_ERROR2 = 18,\n\tSEVERITY_NUMBER_ERROR3 = 19,\n\tSEVERITY_NUMBER_ERROR4 = 20,\n\tSEVERITY_NUMBER_FATAL = 21,\n\tSEVERITY_NUMBER_FATAL2 = 22,\n\tSEVERITY_NUMBER_FATAL3 = 23,\n\tSEVERITY_NUMBER_FATAL4 = 24,\n}\n\n// ============================================\n// Metrics Types\n// ============================================\n\n/**\n * Root message for metrics export\n */\nexport interface ExportMetricsServiceRequest {\n\tresourceMetrics?: ResourceMetrics[];\n}\n\nexport interface ResourceMetrics {\n\tresource?: Resource;\n\tscopeMetrics?: ScopeMetrics[];\n\tschemaUrl?: string;\n}\n\nexport interface ScopeMetrics {\n\tscope?: InstrumentationScope;\n\tmetrics?: Metric[];\n\tschemaUrl?: string;\n}\n\nexport interface Metric {\n\tname: string;\n\tdescription?: string;\n\tunit?: string;\n\tmetadata?: KeyValue[];\n\tgauge?: Gauge;\n\tsum?: Sum;\n\thistogram?: Histogram;\n\texponentialHistogram?: ExponentialHistogram;\n\tsummary?: Summary;\n}\n\nexport interface Gauge {\n\tdataPoints: NumberDataPoint[];\n}\n\nexport interface Sum {\n\tdataPoints: NumberDataPoint[];\n\taggregationTemporality: AggregationTemporality;\n\tisMonotonic?: boolean;\n}\n\nexport interface Histogram {\n\tdataPoints: HistogramDataPoint[];\n\taggregationTemporality: AggregationTemporality;\n}\n\nexport interface ExponentialHistogram {\n\tdataPoints: ExponentialHistogramDataPoint[];\n\taggregationTemporality: AggregationTemporality;\n}\n\nexport interface Summary {\n\tdataPoints: SummaryDataPoint[];\n}\n\nexport enum AggregationTemporality {\n\tAGGREGATION_TEMPORALITY_UNSPECIFIED = 0,\n\tAGGREGATION_TEMPORALITY_DELTA = 1,\n\tAGGREGATION_TEMPORALITY_CUMULATIVE = 2,\n}\n\nexport interface NumberDataPoint {\n\tattributes?: KeyValue[];\n\tstartTimeUnixNano?: string;\n\ttimeUnixNano: string;\n\tasDouble?: number;\n\tasInt?: string;\n\texemplars?: Exemplar[];\n\tflags?: number;\n}\n\nexport interface HistogramDataPoint {\n\tattributes?: KeyValue[];\n\tstartTimeUnixNano?: string;\n\ttimeUnixNano: string;\n\tcount: string;\n\tsum?: number;\n\tbucketCounts?: string[];\n\texplicitBounds?: number[];\n\texemplars?: Exemplar[];\n\tflags?: number;\n\tmin?: number;\n\tmax?: number;\n}\n\nexport interface ExponentialHistogramDataPoint {\n\tattributes?: KeyValue[];\n\tstartTimeUnixNano?: string;\n\ttimeUnixNano: string;\n\tcount: string;\n\tsum?: number;\n\tscale?: number;\n\tzeroCount?: string;\n\tpositive?: Buckets;\n\tnegative?: Buckets;\n\tflags?: number;\n\texemplars?: Exemplar[];\n\tmin?: number;\n\tmax?: number;\n\tzeroThreshold?: number;\n}\n\nexport interface Buckets {\n\toffset?: number;\n\tbucketCounts?: string[];\n}\n\nexport interface SummaryDataPoint {\n\tattributes?: KeyValue[];\n\tstartTimeUnixNano?: string;\n\ttimeUnixNano: string;\n\tcount: string;\n\tsum?: number;\n\tquantileValues?: ValueAtQuantile[];\n\tflags?: number;\n}\n\nexport interface ValueAtQuantile {\n\tquantile: number;\n\tvalue: number;\n}\n\nexport interface Exemplar {\n\tfilteredAttributes?: KeyValue[];\n\ttimeUnixNano: string;\n\tasDouble?: number;\n\tasInt?: string;\n\tspanId?: string;\n\ttraceId?: string;\n}\n\n// ============================================\n// Response Types\n// ============================================\n\nexport interface ExportTraceServiceResponse {\n\tpartialSuccess?: ExportTracePartialSuccess;\n}\n\nexport interface ExportTracePartialSuccess {\n\trejectedSpans?: string;\n\terrorMessage?: string;\n}\n\nexport interface ExportLogsServiceResponse {\n\tpartialSuccess?: ExportLogsPartialSuccess;\n}\n\nexport interface ExportLogsPartialSuccess {\n\trejectedLogRecords?: string;\n\terrorMessage?: string;\n}\n\nexport interface ExportMetricsServiceResponse {\n\tpartialSuccess?: ExportMetricsPartialSuccess;\n}\n\nexport interface ExportMetricsPartialSuccess {\n\trejectedDataPoints?: string;\n\terrorMessage?: string;\n}\n"],"mappings":";;AAmGA,IAAY,gDAAL;AACN;AACA;AACA;AACA;AACA;AACA;;AACA;AAuBD,IAAY,4DAAL;AACN;AACA;AACA;;AACA;AAsCD,IAAY,4DAAL;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA;AA6DD,IAAY,4EAAL;AACN;AACA;AACA;;AACA"}
@@ -51,4 +51,4 @@ let AggregationTemporality = /* @__PURE__ */ function(AggregationTemporality$1)
51
51
 
52
52
  //#endregion
53
53
  export { AggregationTemporality, SeverityNumber, SpanKind, SpanStatusCode };
54
- //# sourceMappingURL=types-Bwm_jNU7.mjs.map
54
+ //# sourceMappingURL=types-CXYLhG_G.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"types-Bwm_jNU7.mjs","names":[],"sources":["../src/otlp/types.ts"],"sourcesContent":["/**\n * OTLP JSON types based on OpenTelemetry Protocol specification.\n * These types represent the JSON encoding of OTLP protobuf messages.\n * @see https://opentelemetry.io/docs/specs/otlp/\n */\n\n// ============================================\n// Common Types\n// ============================================\n\n/**\n * Key-value pair for attributes\n */\nexport interface KeyValue {\n\tkey: string;\n\tvalue: AnyValue;\n}\n\n/**\n * Any value type (string, bool, int, double, array, kvlist, bytes)\n */\nexport interface AnyValue {\n\tstringValue?: string;\n\tboolValue?: boolean;\n\tintValue?: string; // int64 as string\n\tdoubleValue?: number;\n\tarrayValue?: ArrayValue;\n\tkvlistValue?: KeyValueList;\n\tbytesValue?: string; // base64 encoded\n}\n\nexport interface ArrayValue {\n\tvalues: AnyValue[];\n}\n\nexport interface KeyValueList {\n\tvalues: KeyValue[];\n}\n\n/**\n * Resource represents the entity producing telemetry\n */\nexport interface Resource {\n\tattributes?: KeyValue[];\n\tdroppedAttributesCount?: number;\n}\n\n/**\n * InstrumentationScope represents the instrumentation library\n */\nexport interface InstrumentationScope {\n\tname: string;\n\tversion?: string;\n\tattributes?: KeyValue[];\n\tdroppedAttributesCount?: number;\n}\n\n// ============================================\n// Trace Types\n// ============================================\n\n/**\n * Root message for trace export\n */\nexport interface ExportTraceServiceRequest {\n\tresourceSpans?: ResourceSpans[];\n}\n\nexport interface ResourceSpans {\n\tresource?: Resource;\n\tscopeSpans?: ScopeSpans[];\n\tschemaUrl?: string;\n}\n\nexport interface ScopeSpans {\n\tscope?: InstrumentationScope;\n\tspans?: Span[];\n\tschemaUrl?: string;\n}\n\nexport interface Span {\n\ttraceId: string; // hex encoded 16 bytes\n\tspanId: string; // hex encoded 8 bytes\n\ttraceState?: string;\n\tparentSpanId?: string; // hex encoded 8 bytes\n\tflags?: number;\n\tname: string;\n\tkind?: SpanKind;\n\tstartTimeUnixNano: string; // uint64 as string\n\tendTimeUnixNano: string; // uint64 as string\n\tattributes?: KeyValue[];\n\tdroppedAttributesCount?: number;\n\tevents?: SpanEvent[];\n\tdroppedEventsCount?: number;\n\tlinks?: SpanLink[];\n\tdroppedLinksCount?: number;\n\tstatus?: SpanStatus;\n}\n\nexport enum SpanKind {\n\tSPAN_KIND_UNSPECIFIED = 0,\n\tSPAN_KIND_INTERNAL = 1,\n\tSPAN_KIND_SERVER = 2,\n\tSPAN_KIND_CLIENT = 3,\n\tSPAN_KIND_PRODUCER = 4,\n\tSPAN_KIND_CONSUMER = 5,\n}\n\nexport interface SpanEvent {\n\ttimeUnixNano: string;\n\tname: string;\n\tattributes?: KeyValue[];\n\tdroppedAttributesCount?: number;\n}\n\nexport interface SpanLink {\n\ttraceId: string;\n\tspanId: string;\n\ttraceState?: string;\n\tattributes?: KeyValue[];\n\tdroppedAttributesCount?: number;\n\tflags?: number;\n}\n\nexport interface SpanStatus {\n\tmessage?: string;\n\tcode?: SpanStatusCode;\n}\n\nexport enum SpanStatusCode {\n\tSTATUS_CODE_UNSET = 0,\n\tSTATUS_CODE_OK = 1,\n\tSTATUS_CODE_ERROR = 2,\n}\n\n// ============================================\n// Log Types\n// ============================================\n\n/**\n * Root message for log export\n */\nexport interface ExportLogsServiceRequest {\n\tresourceLogs?: ResourceLogs[];\n}\n\nexport interface ResourceLogs {\n\tresource?: Resource;\n\tscopeLogs?: ScopeLogs[];\n\tschemaUrl?: string;\n}\n\nexport interface ScopeLogs {\n\tscope?: InstrumentationScope;\n\tlogRecords?: LogRecord[];\n\tschemaUrl?: string;\n}\n\nexport interface LogRecord {\n\ttimeUnixNano?: string;\n\tobservedTimeUnixNano: string;\n\tseverityNumber?: SeverityNumber;\n\tseverityText?: string;\n\tbody?: AnyValue;\n\tattributes?: KeyValue[];\n\tdroppedAttributesCount?: number;\n\tflags?: number;\n\ttraceId?: string;\n\tspanId?: string;\n}\n\nexport enum SeverityNumber {\n\tSEVERITY_NUMBER_UNSPECIFIED = 0,\n\tSEVERITY_NUMBER_TRACE = 1,\n\tSEVERITY_NUMBER_TRACE2 = 2,\n\tSEVERITY_NUMBER_TRACE3 = 3,\n\tSEVERITY_NUMBER_TRACE4 = 4,\n\tSEVERITY_NUMBER_DEBUG = 5,\n\tSEVERITY_NUMBER_DEBUG2 = 6,\n\tSEVERITY_NUMBER_DEBUG3 = 7,\n\tSEVERITY_NUMBER_DEBUG4 = 8,\n\tSEVERITY_NUMBER_INFO = 9,\n\tSEVERITY_NUMBER_INFO2 = 10,\n\tSEVERITY_NUMBER_INFO3 = 11,\n\tSEVERITY_NUMBER_INFO4 = 12,\n\tSEVERITY_NUMBER_WARN = 13,\n\tSEVERITY_NUMBER_WARN2 = 14,\n\tSEVERITY_NUMBER_WARN3 = 15,\n\tSEVERITY_NUMBER_WARN4 = 16,\n\tSEVERITY_NUMBER_ERROR = 17,\n\tSEVERITY_NUMBER_ERROR2 = 18,\n\tSEVERITY_NUMBER_ERROR3 = 19,\n\tSEVERITY_NUMBER_ERROR4 = 20,\n\tSEVERITY_NUMBER_FATAL = 21,\n\tSEVERITY_NUMBER_FATAL2 = 22,\n\tSEVERITY_NUMBER_FATAL3 = 23,\n\tSEVERITY_NUMBER_FATAL4 = 24,\n}\n\n// ============================================\n// Metrics Types\n// ============================================\n\n/**\n * Root message for metrics export\n */\nexport interface ExportMetricsServiceRequest {\n\tresourceMetrics?: ResourceMetrics[];\n}\n\nexport interface ResourceMetrics {\n\tresource?: Resource;\n\tscopeMetrics?: ScopeMetrics[];\n\tschemaUrl?: string;\n}\n\nexport interface ScopeMetrics {\n\tscope?: InstrumentationScope;\n\tmetrics?: Metric[];\n\tschemaUrl?: string;\n}\n\nexport interface Metric {\n\tname: string;\n\tdescription?: string;\n\tunit?: string;\n\tmetadata?: KeyValue[];\n\tgauge?: Gauge;\n\tsum?: Sum;\n\thistogram?: Histogram;\n\texponentialHistogram?: ExponentialHistogram;\n\tsummary?: Summary;\n}\n\nexport interface Gauge {\n\tdataPoints: NumberDataPoint[];\n}\n\nexport interface Sum {\n\tdataPoints: NumberDataPoint[];\n\taggregationTemporality: AggregationTemporality;\n\tisMonotonic?: boolean;\n}\n\nexport interface Histogram {\n\tdataPoints: HistogramDataPoint[];\n\taggregationTemporality: AggregationTemporality;\n}\n\nexport interface ExponentialHistogram {\n\tdataPoints: ExponentialHistogramDataPoint[];\n\taggregationTemporality: AggregationTemporality;\n}\n\nexport interface Summary {\n\tdataPoints: SummaryDataPoint[];\n}\n\nexport enum AggregationTemporality {\n\tAGGREGATION_TEMPORALITY_UNSPECIFIED = 0,\n\tAGGREGATION_TEMPORALITY_DELTA = 1,\n\tAGGREGATION_TEMPORALITY_CUMULATIVE = 2,\n}\n\nexport interface NumberDataPoint {\n\tattributes?: KeyValue[];\n\tstartTimeUnixNano?: string;\n\ttimeUnixNano: string;\n\tasDouble?: number;\n\tasInt?: string;\n\texemplars?: Exemplar[];\n\tflags?: number;\n}\n\nexport interface HistogramDataPoint {\n\tattributes?: KeyValue[];\n\tstartTimeUnixNano?: string;\n\ttimeUnixNano: string;\n\tcount: string;\n\tsum?: number;\n\tbucketCounts?: string[];\n\texplicitBounds?: number[];\n\texemplars?: Exemplar[];\n\tflags?: number;\n\tmin?: number;\n\tmax?: number;\n}\n\nexport interface ExponentialHistogramDataPoint {\n\tattributes?: KeyValue[];\n\tstartTimeUnixNano?: string;\n\ttimeUnixNano: string;\n\tcount: string;\n\tsum?: number;\n\tscale?: number;\n\tzeroCount?: string;\n\tpositive?: Buckets;\n\tnegative?: Buckets;\n\tflags?: number;\n\texemplars?: Exemplar[];\n\tmin?: number;\n\tmax?: number;\n\tzeroThreshold?: number;\n}\n\nexport interface Buckets {\n\toffset?: number;\n\tbucketCounts?: string[];\n}\n\nexport interface SummaryDataPoint {\n\tattributes?: KeyValue[];\n\tstartTimeUnixNano?: string;\n\ttimeUnixNano: string;\n\tcount: string;\n\tsum?: number;\n\tquantileValues?: ValueAtQuantile[];\n\tflags?: number;\n}\n\nexport interface ValueAtQuantile {\n\tquantile: number;\n\tvalue: number;\n}\n\nexport interface Exemplar {\n\tfilteredAttributes?: KeyValue[];\n\ttimeUnixNano: string;\n\tasDouble?: number;\n\tasInt?: string;\n\tspanId?: string;\n\ttraceId?: string;\n}\n\n// ============================================\n// Response Types\n// ============================================\n\nexport interface ExportTraceServiceResponse {\n\tpartialSuccess?: ExportTracePartialSuccess;\n}\n\nexport interface ExportTracePartialSuccess {\n\trejectedSpans?: string;\n\terrorMessage?: string;\n}\n\nexport interface ExportLogsServiceResponse {\n\tpartialSuccess?: ExportLogsPartialSuccess;\n}\n\nexport interface ExportLogsPartialSuccess {\n\trejectedLogRecords?: string;\n\terrorMessage?: string;\n}\n\nexport interface ExportMetricsServiceResponse {\n\tpartialSuccess?: ExportMetricsPartialSuccess;\n}\n\nexport interface ExportMetricsPartialSuccess {\n\trejectedDataPoints?: string;\n\terrorMessage?: string;\n}\n"],"mappings":";AAmGA,IAAY,gDAAL;AACN;AACA;AACA;AACA;AACA;AACA;;AACA;AAuBD,IAAY,4DAAL;AACN;AACA;AACA;;AACA;AAsCD,IAAY,4DAAL;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA;AA6DD,IAAY,4EAAL;AACN;AACA;AACA;;AACA"}
1
+ {"version":3,"file":"types-CXYLhG_G.mjs","names":[],"sources":["../src/otlp/types.ts"],"sourcesContent":["/**\n * OTLP JSON types based on OpenTelemetry Protocol specification.\n * These types represent the JSON encoding of OTLP protobuf messages.\n * @see https://opentelemetry.io/docs/specs/otlp/\n */\n\n// ============================================\n// Common Types\n// ============================================\n\n/**\n * Key-value pair for attributes\n */\nexport interface KeyValue {\n\tkey: string;\n\tvalue: AnyValue;\n}\n\n/**\n * Any value type (string, bool, int, double, array, kvlist, bytes)\n */\nexport interface AnyValue {\n\tstringValue?: string;\n\tboolValue?: boolean;\n\tintValue?: string; // int64 as string\n\tdoubleValue?: number;\n\tarrayValue?: ArrayValue;\n\tkvlistValue?: KeyValueList;\n\tbytesValue?: string; // base64 encoded\n}\n\nexport interface ArrayValue {\n\tvalues: AnyValue[];\n}\n\nexport interface KeyValueList {\n\tvalues: KeyValue[];\n}\n\n/**\n * Resource represents the entity producing telemetry\n */\nexport interface Resource {\n\tattributes?: KeyValue[];\n\tdroppedAttributesCount?: number;\n}\n\n/**\n * InstrumentationScope represents the instrumentation library\n */\nexport interface InstrumentationScope {\n\tname: string;\n\tversion?: string;\n\tattributes?: KeyValue[];\n\tdroppedAttributesCount?: number;\n}\n\n// ============================================\n// Trace Types\n// ============================================\n\n/**\n * Root message for trace export\n */\nexport interface ExportTraceServiceRequest {\n\tresourceSpans?: ResourceSpans[];\n}\n\nexport interface ResourceSpans {\n\tresource?: Resource;\n\tscopeSpans?: ScopeSpans[];\n\tschemaUrl?: string;\n}\n\nexport interface ScopeSpans {\n\tscope?: InstrumentationScope;\n\tspans?: Span[];\n\tschemaUrl?: string;\n}\n\nexport interface Span {\n\ttraceId: string; // hex encoded 16 bytes\n\tspanId: string; // hex encoded 8 bytes\n\ttraceState?: string;\n\tparentSpanId?: string; // hex encoded 8 bytes\n\tflags?: number;\n\tname: string;\n\tkind?: SpanKind;\n\tstartTimeUnixNano: string; // uint64 as string\n\tendTimeUnixNano: string; // uint64 as string\n\tattributes?: KeyValue[];\n\tdroppedAttributesCount?: number;\n\tevents?: SpanEvent[];\n\tdroppedEventsCount?: number;\n\tlinks?: SpanLink[];\n\tdroppedLinksCount?: number;\n\tstatus?: SpanStatus;\n}\n\nexport enum SpanKind {\n\tSPAN_KIND_UNSPECIFIED = 0,\n\tSPAN_KIND_INTERNAL = 1,\n\tSPAN_KIND_SERVER = 2,\n\tSPAN_KIND_CLIENT = 3,\n\tSPAN_KIND_PRODUCER = 4,\n\tSPAN_KIND_CONSUMER = 5,\n}\n\nexport interface SpanEvent {\n\ttimeUnixNano: string;\n\tname: string;\n\tattributes?: KeyValue[];\n\tdroppedAttributesCount?: number;\n}\n\nexport interface SpanLink {\n\ttraceId: string;\n\tspanId: string;\n\ttraceState?: string;\n\tattributes?: KeyValue[];\n\tdroppedAttributesCount?: number;\n\tflags?: number;\n}\n\nexport interface SpanStatus {\n\tmessage?: string;\n\tcode?: SpanStatusCode;\n}\n\nexport enum SpanStatusCode {\n\tSTATUS_CODE_UNSET = 0,\n\tSTATUS_CODE_OK = 1,\n\tSTATUS_CODE_ERROR = 2,\n}\n\n// ============================================\n// Log Types\n// ============================================\n\n/**\n * Root message for log export\n */\nexport interface ExportLogsServiceRequest {\n\tresourceLogs?: ResourceLogs[];\n}\n\nexport interface ResourceLogs {\n\tresource?: Resource;\n\tscopeLogs?: ScopeLogs[];\n\tschemaUrl?: string;\n}\n\nexport interface ScopeLogs {\n\tscope?: InstrumentationScope;\n\tlogRecords?: LogRecord[];\n\tschemaUrl?: string;\n}\n\nexport interface LogRecord {\n\ttimeUnixNano?: string;\n\tobservedTimeUnixNano: string;\n\tseverityNumber?: SeverityNumber;\n\tseverityText?: string;\n\tbody?: AnyValue;\n\tattributes?: KeyValue[];\n\tdroppedAttributesCount?: number;\n\tflags?: number;\n\ttraceId?: string;\n\tspanId?: string;\n}\n\nexport enum SeverityNumber {\n\tSEVERITY_NUMBER_UNSPECIFIED = 0,\n\tSEVERITY_NUMBER_TRACE = 1,\n\tSEVERITY_NUMBER_TRACE2 = 2,\n\tSEVERITY_NUMBER_TRACE3 = 3,\n\tSEVERITY_NUMBER_TRACE4 = 4,\n\tSEVERITY_NUMBER_DEBUG = 5,\n\tSEVERITY_NUMBER_DEBUG2 = 6,\n\tSEVERITY_NUMBER_DEBUG3 = 7,\n\tSEVERITY_NUMBER_DEBUG4 = 8,\n\tSEVERITY_NUMBER_INFO = 9,\n\tSEVERITY_NUMBER_INFO2 = 10,\n\tSEVERITY_NUMBER_INFO3 = 11,\n\tSEVERITY_NUMBER_INFO4 = 12,\n\tSEVERITY_NUMBER_WARN = 13,\n\tSEVERITY_NUMBER_WARN2 = 14,\n\tSEVERITY_NUMBER_WARN3 = 15,\n\tSEVERITY_NUMBER_WARN4 = 16,\n\tSEVERITY_NUMBER_ERROR = 17,\n\tSEVERITY_NUMBER_ERROR2 = 18,\n\tSEVERITY_NUMBER_ERROR3 = 19,\n\tSEVERITY_NUMBER_ERROR4 = 20,\n\tSEVERITY_NUMBER_FATAL = 21,\n\tSEVERITY_NUMBER_FATAL2 = 22,\n\tSEVERITY_NUMBER_FATAL3 = 23,\n\tSEVERITY_NUMBER_FATAL4 = 24,\n}\n\n// ============================================\n// Metrics Types\n// ============================================\n\n/**\n * Root message for metrics export\n */\nexport interface ExportMetricsServiceRequest {\n\tresourceMetrics?: ResourceMetrics[];\n}\n\nexport interface ResourceMetrics {\n\tresource?: Resource;\n\tscopeMetrics?: ScopeMetrics[];\n\tschemaUrl?: string;\n}\n\nexport interface ScopeMetrics {\n\tscope?: InstrumentationScope;\n\tmetrics?: Metric[];\n\tschemaUrl?: string;\n}\n\nexport interface Metric {\n\tname: string;\n\tdescription?: string;\n\tunit?: string;\n\tmetadata?: KeyValue[];\n\tgauge?: Gauge;\n\tsum?: Sum;\n\thistogram?: Histogram;\n\texponentialHistogram?: ExponentialHistogram;\n\tsummary?: Summary;\n}\n\nexport interface Gauge {\n\tdataPoints: NumberDataPoint[];\n}\n\nexport interface Sum {\n\tdataPoints: NumberDataPoint[];\n\taggregationTemporality: AggregationTemporality;\n\tisMonotonic?: boolean;\n}\n\nexport interface Histogram {\n\tdataPoints: HistogramDataPoint[];\n\taggregationTemporality: AggregationTemporality;\n}\n\nexport interface ExponentialHistogram {\n\tdataPoints: ExponentialHistogramDataPoint[];\n\taggregationTemporality: AggregationTemporality;\n}\n\nexport interface Summary {\n\tdataPoints: SummaryDataPoint[];\n}\n\nexport enum AggregationTemporality {\n\tAGGREGATION_TEMPORALITY_UNSPECIFIED = 0,\n\tAGGREGATION_TEMPORALITY_DELTA = 1,\n\tAGGREGATION_TEMPORALITY_CUMULATIVE = 2,\n}\n\nexport interface NumberDataPoint {\n\tattributes?: KeyValue[];\n\tstartTimeUnixNano?: string;\n\ttimeUnixNano: string;\n\tasDouble?: number;\n\tasInt?: string;\n\texemplars?: Exemplar[];\n\tflags?: number;\n}\n\nexport interface HistogramDataPoint {\n\tattributes?: KeyValue[];\n\tstartTimeUnixNano?: string;\n\ttimeUnixNano: string;\n\tcount: string;\n\tsum?: number;\n\tbucketCounts?: string[];\n\texplicitBounds?: number[];\n\texemplars?: Exemplar[];\n\tflags?: number;\n\tmin?: number;\n\tmax?: number;\n}\n\nexport interface ExponentialHistogramDataPoint {\n\tattributes?: KeyValue[];\n\tstartTimeUnixNano?: string;\n\ttimeUnixNano: string;\n\tcount: string;\n\tsum?: number;\n\tscale?: number;\n\tzeroCount?: string;\n\tpositive?: Buckets;\n\tnegative?: Buckets;\n\tflags?: number;\n\texemplars?: Exemplar[];\n\tmin?: number;\n\tmax?: number;\n\tzeroThreshold?: number;\n}\n\nexport interface Buckets {\n\toffset?: number;\n\tbucketCounts?: string[];\n}\n\nexport interface SummaryDataPoint {\n\tattributes?: KeyValue[];\n\tstartTimeUnixNano?: string;\n\ttimeUnixNano: string;\n\tcount: string;\n\tsum?: number;\n\tquantileValues?: ValueAtQuantile[];\n\tflags?: number;\n}\n\nexport interface ValueAtQuantile {\n\tquantile: number;\n\tvalue: number;\n}\n\nexport interface Exemplar {\n\tfilteredAttributes?: KeyValue[];\n\ttimeUnixNano: string;\n\tasDouble?: number;\n\tasInt?: string;\n\tspanId?: string;\n\ttraceId?: string;\n}\n\n// ============================================\n// Response Types\n// ============================================\n\nexport interface ExportTraceServiceResponse {\n\tpartialSuccess?: ExportTracePartialSuccess;\n}\n\nexport interface ExportTracePartialSuccess {\n\trejectedSpans?: string;\n\terrorMessage?: string;\n}\n\nexport interface ExportLogsServiceResponse {\n\tpartialSuccess?: ExportLogsPartialSuccess;\n}\n\nexport interface ExportLogsPartialSuccess {\n\trejectedLogRecords?: string;\n\terrorMessage?: string;\n}\n\nexport interface ExportMetricsServiceResponse {\n\tpartialSuccess?: ExportMetricsPartialSuccess;\n}\n\nexport interface ExportMetricsPartialSuccess {\n\trejectedDataPoints?: string;\n\terrorMessage?: string;\n}\n"],"mappings":";AAmGA,IAAY,gDAAL;AACN;AACA;AACA;AACA;AACA;AACA;;AACA;AAuBD,IAAY,4DAAL;AACN;AACA;AACA;;AACA;AAsCD,IAAY,4DAAL;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA;AA6DD,IAAY,4EAAL;AACN;AACA;AACA;;AACA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@geekmidas/telescope",
3
- "version": "1.0.1",
3
+ "version": "1.1.0",
4
4
  "description": "Laravel Telescope-style debugging and monitoring for web applications",
5
5
  "type": "module",
6
6
  "exports": {
@@ -172,7 +172,7 @@
172
172
  "@opentelemetry/semantic-conventions": "^1.28.0",
173
173
  "@types/aws-lambda": "^8.10.0",
174
174
  "hono": "^4.0.0",
175
- "kysely": "^0.28.0",
175
+ "kysely": ">=0.28.2 <0.30.0",
176
176
  "pino": "^9.0.0",
177
177
  "pino-abstract-transport": "^2.0.0 || ^3.0.0",
178
178
  "@geekmidas/logger": "^1.0.2"
@@ -248,7 +248,7 @@
248
248
  "@opentelemetry/semantic-conventions": "^1.28.0",
249
249
  "@types/aws-lambda": "^8.10.149",
250
250
  "hono": "^4.7.0",
251
- "kysely": "~0.28.2",
251
+ "kysely": "~0.29.4",
252
252
  "pino": "^9.6.0",
253
253
  "pino-abstract-transport": "~3.0.0",
254
254
  "@geekmidas/logger": "^1.0.2"