@geekmidas/telescope 0.6.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +21 -0
- package/dist/adapters/lambda.cjs +1 -1
- package/dist/adapters/lambda.mjs +1 -1
- package/dist/adapters/middy.cjs +1 -1
- package/dist/adapters/middy.mjs +1 -1
- package/dist/{http-D5kn3_Mt.d.mts → http-BiNtg85L.d.mts} +3 -3
- package/dist/{http-D5kn3_Mt.d.mts.map → http-BiNtg85L.d.mts.map} +1 -1
- package/dist/instrumentation/http.d.mts +1 -1
- package/dist/instrumentation/index.d.mts +1 -1
- package/dist/logger/console.d.cts.map +1 -1
- package/dist/logger/pino.d.mts +2 -2
- package/dist/{middy-BIpTCy9H.mjs → middy-BTR3cyvk.mjs} +1 -1
- package/dist/{middy-BIpTCy9H.mjs.map → middy-BTR3cyvk.mjs.map} +1 -1
- package/dist/{middy-DhMWMJbG.cjs → middy-y5Zp27eG.cjs} +1 -1
- package/dist/{middy-DhMWMJbG.cjs.map → middy-y5Zp27eG.cjs.map} +1 -1
- package/dist/otlp/hono.cjs +3 -3
- package/dist/otlp/hono.mjs +3 -3
- package/dist/otlp/index.cjs +3 -3
- package/dist/otlp/index.mjs +3 -3
- package/dist/otlp/receiver.cjs +3 -3
- package/dist/otlp/receiver.mjs +3 -3
- package/dist/otlp/transformer.cjs +2 -2
- package/dist/otlp/transformer.mjs +2 -2
- package/dist/otlp/types.cjs +1 -1
- package/dist/otlp/types.mjs +1 -1
- package/dist/{receiver-slCoAFat.cjs → receiver-Cj1lbAOO.cjs} +2 -2
- package/dist/{receiver-slCoAFat.cjs.map → receiver-Cj1lbAOO.cjs.map} +1 -1
- package/dist/{receiver-D46dfkYI.mjs → receiver-CxVd_9CB.mjs} +2 -2
- package/dist/{receiver-D46dfkYI.mjs.map → receiver-CxVd_9CB.mjs.map} +1 -1
- package/dist/storage/kysely.d.cts.map +1 -1
- package/dist/storage/kysely.d.mts.map +1 -1
- package/dist/tracing-BX8uY2nR.d.cts.map +1 -1
- package/dist/tracing-PnECEbEu.d.mts.map +1 -1
- package/dist/{transformer-CFQ4WFk6.mjs → transformer-BXQPhzql.mjs} +2 -2
- package/dist/{transformer-CFQ4WFk6.mjs.map → transformer-BXQPhzql.mjs.map} +1 -1
- package/dist/{transformer-Csl6fbgv.cjs → transformer-CLGZ0EQc.cjs} +2 -2
- package/dist/{transformer-Csl6fbgv.cjs.map → transformer-CLGZ0EQc.cjs.map} +1 -1
- package/dist/types-B1EIa_cQ.d.mts.map +1 -1
- package/dist/{types-Cj59nqy7.mjs → types-Bwm_jNU7.mjs} +1 -1
- package/dist/{types-Cj59nqy7.mjs.map → types-Bwm_jNU7.mjs.map} +1 -1
- package/dist/{types-BMiHgsi4.cjs → types-Dsh-DIO_.cjs} +1 -1
- package/dist/{types-BMiHgsi4.cjs.map → types-Dsh-DIO_.cjs.map} +1 -1
- package/package.json +115 -45
- package/ui/CHANGELOG.md +7 -0
- package/ui/node_modules/.bin/tsc +2 -2
- package/ui/node_modules/.bin/tsserver +2 -2
- package/ui/node_modules/.bin/vite +2 -2
- package/ui/package.json +1 -1
- package/tsconfig.tsbuildinfo +0 -1
- package/ui/node_modules/.bin/browserslist +0 -21
- package/ui/node_modules/.bin/jiti +0 -21
- package/ui/node_modules/.bin/terser +0 -21
- package/ui/node_modules/.bin/tsx +0 -21
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transformer-CFQ4WFk6.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,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;IACb,oBAAoB;GACpB;AAGD,OAAI,OAAO,MACV,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-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\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,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;AACP"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const require_types = require('./types-
|
|
1
|
+
const require_types = require('./types-Dsh-DIO_.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-
|
|
232
|
+
//# sourceMappingURL=transformer-CLGZ0EQc.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transformer-Csl6fbgv.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,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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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-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,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,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= /* @__PURE__ */ function(AggregationTemporality$1)
|
|
|
51
51
|
|
|
52
52
|
//#endregion
|
|
53
53
|
export { AggregationTemporality, SeverityNumber, SpanKind, SpanStatusCode };
|
|
54
|
-
//# sourceMappingURL=types-
|
|
54
|
+
//# sourceMappingURL=types-Bwm_jNU7.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types-
|
|
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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types-
|
|
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"}
|
package/package.json
CHANGED
|
@@ -1,78 +1,148 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@geekmidas/telescope",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "Laravel Telescope-style debugging and monitoring for web applications",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
7
7
|
".": {
|
|
8
|
-
"
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
"import": {
|
|
9
|
+
"types": "./dist/index.d.mts",
|
|
10
|
+
"default": "./dist/index.mjs"
|
|
11
|
+
},
|
|
12
|
+
"require": {
|
|
13
|
+
"types": "./dist/index.d.cts",
|
|
14
|
+
"default": "./dist/index.cjs"
|
|
15
|
+
}
|
|
11
16
|
},
|
|
12
17
|
"./storage/memory": {
|
|
13
|
-
"
|
|
14
|
-
|
|
15
|
-
|
|
18
|
+
"import": {
|
|
19
|
+
"types": "./dist/storage/memory.d.mts",
|
|
20
|
+
"default": "./dist/storage/memory.mjs"
|
|
21
|
+
},
|
|
22
|
+
"require": {
|
|
23
|
+
"types": "./dist/storage/memory.d.cts",
|
|
24
|
+
"default": "./dist/storage/memory.cjs"
|
|
25
|
+
}
|
|
16
26
|
},
|
|
17
27
|
"./storage/kysely": {
|
|
18
|
-
"
|
|
19
|
-
|
|
20
|
-
|
|
28
|
+
"import": {
|
|
29
|
+
"types": "./dist/storage/kysely.d.mts",
|
|
30
|
+
"default": "./dist/storage/kysely.mjs"
|
|
31
|
+
},
|
|
32
|
+
"require": {
|
|
33
|
+
"types": "./dist/storage/kysely.d.cts",
|
|
34
|
+
"default": "./dist/storage/kysely.cjs"
|
|
35
|
+
}
|
|
21
36
|
},
|
|
22
37
|
"./server/hono": {
|
|
23
|
-
"
|
|
24
|
-
|
|
25
|
-
|
|
38
|
+
"import": {
|
|
39
|
+
"types": "./dist/server/hono.d.mts",
|
|
40
|
+
"default": "./dist/server/hono.mjs"
|
|
41
|
+
},
|
|
42
|
+
"require": {
|
|
43
|
+
"types": "./dist/server/hono.d.cts",
|
|
44
|
+
"default": "./dist/server/hono.cjs"
|
|
45
|
+
}
|
|
26
46
|
},
|
|
27
47
|
"./hono": {
|
|
28
|
-
"
|
|
29
|
-
|
|
30
|
-
|
|
48
|
+
"import": {
|
|
49
|
+
"types": "./dist/server/hono.d.mts",
|
|
50
|
+
"default": "./dist/server/hono.mjs"
|
|
51
|
+
},
|
|
52
|
+
"require": {
|
|
53
|
+
"types": "./dist/server/hono.d.cts",
|
|
54
|
+
"default": "./dist/server/hono.cjs"
|
|
55
|
+
}
|
|
31
56
|
},
|
|
32
57
|
"./logger/pino": {
|
|
33
|
-
"
|
|
34
|
-
|
|
35
|
-
|
|
58
|
+
"import": {
|
|
59
|
+
"types": "./dist/logger/pino.d.mts",
|
|
60
|
+
"default": "./dist/logger/pino.mjs"
|
|
61
|
+
},
|
|
62
|
+
"require": {
|
|
63
|
+
"types": "./dist/logger/pino.d.cts",
|
|
64
|
+
"default": "./dist/logger/pino.cjs"
|
|
65
|
+
}
|
|
36
66
|
},
|
|
37
67
|
"./logger/console": {
|
|
38
|
-
"
|
|
39
|
-
|
|
40
|
-
|
|
68
|
+
"import": {
|
|
69
|
+
"types": "./dist/logger/console.d.mts",
|
|
70
|
+
"default": "./dist/logger/console.mjs"
|
|
71
|
+
},
|
|
72
|
+
"require": {
|
|
73
|
+
"types": "./dist/logger/console.d.cts",
|
|
74
|
+
"default": "./dist/logger/console.cjs"
|
|
75
|
+
}
|
|
41
76
|
},
|
|
42
77
|
"./metrics": {
|
|
43
|
-
"
|
|
44
|
-
|
|
45
|
-
|
|
78
|
+
"import": {
|
|
79
|
+
"types": "./dist/metrics/index.d.mts",
|
|
80
|
+
"default": "./dist/metrics/index.mjs"
|
|
81
|
+
},
|
|
82
|
+
"require": {
|
|
83
|
+
"types": "./dist/metrics/index.d.cts",
|
|
84
|
+
"default": "./dist/metrics/index.cjs"
|
|
85
|
+
}
|
|
46
86
|
},
|
|
47
87
|
"./otlp": {
|
|
48
|
-
"
|
|
49
|
-
|
|
50
|
-
|
|
88
|
+
"import": {
|
|
89
|
+
"types": "./dist/otlp/index.d.mts",
|
|
90
|
+
"default": "./dist/otlp/index.mjs"
|
|
91
|
+
},
|
|
92
|
+
"require": {
|
|
93
|
+
"types": "./dist/otlp/index.d.cts",
|
|
94
|
+
"default": "./dist/otlp/index.cjs"
|
|
95
|
+
}
|
|
51
96
|
},
|
|
52
97
|
"./otlp/hono": {
|
|
53
|
-
"
|
|
54
|
-
|
|
55
|
-
|
|
98
|
+
"import": {
|
|
99
|
+
"types": "./dist/otlp/hono.d.mts",
|
|
100
|
+
"default": "./dist/otlp/hono.mjs"
|
|
101
|
+
},
|
|
102
|
+
"require": {
|
|
103
|
+
"types": "./dist/otlp/hono.d.cts",
|
|
104
|
+
"default": "./dist/otlp/hono.cjs"
|
|
105
|
+
}
|
|
56
106
|
},
|
|
57
107
|
"./instrumentation": {
|
|
58
|
-
"
|
|
59
|
-
|
|
60
|
-
|
|
108
|
+
"import": {
|
|
109
|
+
"types": "./dist/instrumentation/index.d.mts",
|
|
110
|
+
"default": "./dist/instrumentation/index.mjs"
|
|
111
|
+
},
|
|
112
|
+
"require": {
|
|
113
|
+
"types": "./dist/instrumentation/index.d.cts",
|
|
114
|
+
"default": "./dist/instrumentation/index.cjs"
|
|
115
|
+
}
|
|
61
116
|
},
|
|
62
117
|
"./instrumentation/hono": {
|
|
63
|
-
"
|
|
64
|
-
|
|
65
|
-
|
|
118
|
+
"import": {
|
|
119
|
+
"types": "./dist/instrumentation/hono.d.mts",
|
|
120
|
+
"default": "./dist/instrumentation/hono.mjs"
|
|
121
|
+
},
|
|
122
|
+
"require": {
|
|
123
|
+
"types": "./dist/instrumentation/hono.d.cts",
|
|
124
|
+
"default": "./dist/instrumentation/hono.cjs"
|
|
125
|
+
}
|
|
66
126
|
},
|
|
67
127
|
"./core": {
|
|
68
|
-
"
|
|
69
|
-
|
|
70
|
-
|
|
128
|
+
"import": {
|
|
129
|
+
"types": "./dist/core.d.mts",
|
|
130
|
+
"default": "./dist/core.mjs"
|
|
131
|
+
},
|
|
132
|
+
"require": {
|
|
133
|
+
"types": "./dist/core.d.cts",
|
|
134
|
+
"default": "./dist/core.cjs"
|
|
135
|
+
}
|
|
71
136
|
},
|
|
72
137
|
"./lambda": {
|
|
73
|
-
"
|
|
74
|
-
|
|
75
|
-
|
|
138
|
+
"import": {
|
|
139
|
+
"types": "./dist/adapters/lambda.d.mts",
|
|
140
|
+
"default": "./dist/adapters/lambda.mjs"
|
|
141
|
+
},
|
|
142
|
+
"require": {
|
|
143
|
+
"types": "./dist/adapters/lambda.d.cts",
|
|
144
|
+
"default": "./dist/adapters/lambda.cjs"
|
|
145
|
+
}
|
|
76
146
|
}
|
|
77
147
|
},
|
|
78
148
|
"repository": {
|
|
@@ -105,7 +175,7 @@
|
|
|
105
175
|
"kysely": "^0.28.0",
|
|
106
176
|
"pino": "^9.0.0",
|
|
107
177
|
"pino-abstract-transport": "^2.0.0 || ^3.0.0",
|
|
108
|
-
"@geekmidas/logger": "^0.
|
|
178
|
+
"@geekmidas/logger": "^1.0.2"
|
|
109
179
|
},
|
|
110
180
|
"peerDependenciesMeta": {
|
|
111
181
|
"@geekmidas/logger": {
|
|
@@ -181,7 +251,7 @@
|
|
|
181
251
|
"kysely": "~0.28.2",
|
|
182
252
|
"pino": "^9.6.0",
|
|
183
253
|
"pino-abstract-transport": "~3.0.0",
|
|
184
|
-
"@geekmidas/logger": "^0.
|
|
254
|
+
"@geekmidas/logger": "^1.0.2"
|
|
185
255
|
},
|
|
186
256
|
"scripts": {
|
|
187
257
|
"build:ui": "pnpm --filter @geekmidas/telescope-ui build && tsx ../ui/scripts/embed-ui.ts dist/ui src/ui-assets.ts"
|
package/ui/CHANGELOG.md
ADDED
package/ui/node_modules/.bin/tsc
CHANGED
|
@@ -10,9 +10,9 @@ case `uname` in
|
|
|
10
10
|
esac
|
|
11
11
|
|
|
12
12
|
if [ -z "$NODE_PATH" ]; then
|
|
13
|
-
export NODE_PATH="/
|
|
13
|
+
export NODE_PATH="/home/runner/work/toolbox/toolbox/node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/bin/node_modules:/home/runner/work/toolbox/toolbox/node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/node_modules:/home/runner/work/toolbox/toolbox/node_modules/.pnpm/typescript@5.8.2/node_modules:/home/runner/work/toolbox/toolbox/node_modules/.pnpm/node_modules"
|
|
14
14
|
else
|
|
15
|
-
export NODE_PATH="/
|
|
15
|
+
export NODE_PATH="/home/runner/work/toolbox/toolbox/node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/bin/node_modules:/home/runner/work/toolbox/toolbox/node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/node_modules:/home/runner/work/toolbox/toolbox/node_modules/.pnpm/typescript@5.8.2/node_modules:/home/runner/work/toolbox/toolbox/node_modules/.pnpm/node_modules:$NODE_PATH"
|
|
16
16
|
fi
|
|
17
17
|
if [ -x "$basedir/node" ]; then
|
|
18
18
|
exec "$basedir/node" "$basedir/../typescript/bin/tsc" "$@"
|
|
@@ -10,9 +10,9 @@ case `uname` in
|
|
|
10
10
|
esac
|
|
11
11
|
|
|
12
12
|
if [ -z "$NODE_PATH" ]; then
|
|
13
|
-
export NODE_PATH="/
|
|
13
|
+
export NODE_PATH="/home/runner/work/toolbox/toolbox/node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/bin/node_modules:/home/runner/work/toolbox/toolbox/node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/node_modules:/home/runner/work/toolbox/toolbox/node_modules/.pnpm/typescript@5.8.2/node_modules:/home/runner/work/toolbox/toolbox/node_modules/.pnpm/node_modules"
|
|
14
14
|
else
|
|
15
|
-
export NODE_PATH="/
|
|
15
|
+
export NODE_PATH="/home/runner/work/toolbox/toolbox/node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/bin/node_modules:/home/runner/work/toolbox/toolbox/node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/node_modules:/home/runner/work/toolbox/toolbox/node_modules/.pnpm/typescript@5.8.2/node_modules:/home/runner/work/toolbox/toolbox/node_modules/.pnpm/node_modules:$NODE_PATH"
|
|
16
16
|
fi
|
|
17
17
|
if [ -x "$basedir/node" ]; then
|
|
18
18
|
exec "$basedir/node" "$basedir/../typescript/bin/tsserver" "$@"
|
|
@@ -10,9 +10,9 @@ case `uname` in
|
|
|
10
10
|
esac
|
|
11
11
|
|
|
12
12
|
if [ -z "$NODE_PATH" ]; then
|
|
13
|
-
export NODE_PATH="/
|
|
13
|
+
export NODE_PATH="/home/runner/work/toolbox/toolbox/node_modules/.pnpm/vite@6.3.5_@types+node@24.9.1_jiti@2.6.1_lightningcss@1.30.2_terser@5.43.1_tsx@4.20.6_yaml@2.8.2/node_modules/vite/bin/node_modules:/home/runner/work/toolbox/toolbox/node_modules/.pnpm/vite@6.3.5_@types+node@24.9.1_jiti@2.6.1_lightningcss@1.30.2_terser@5.43.1_tsx@4.20.6_yaml@2.8.2/node_modules/vite/node_modules:/home/runner/work/toolbox/toolbox/node_modules/.pnpm/vite@6.3.5_@types+node@24.9.1_jiti@2.6.1_lightningcss@1.30.2_terser@5.43.1_tsx@4.20.6_yaml@2.8.2/node_modules:/home/runner/work/toolbox/toolbox/node_modules/.pnpm/node_modules"
|
|
14
14
|
else
|
|
15
|
-
export NODE_PATH="/
|
|
15
|
+
export NODE_PATH="/home/runner/work/toolbox/toolbox/node_modules/.pnpm/vite@6.3.5_@types+node@24.9.1_jiti@2.6.1_lightningcss@1.30.2_terser@5.43.1_tsx@4.20.6_yaml@2.8.2/node_modules/vite/bin/node_modules:/home/runner/work/toolbox/toolbox/node_modules/.pnpm/vite@6.3.5_@types+node@24.9.1_jiti@2.6.1_lightningcss@1.30.2_terser@5.43.1_tsx@4.20.6_yaml@2.8.2/node_modules/vite/node_modules:/home/runner/work/toolbox/toolbox/node_modules/.pnpm/vite@6.3.5_@types+node@24.9.1_jiti@2.6.1_lightningcss@1.30.2_terser@5.43.1_tsx@4.20.6_yaml@2.8.2/node_modules:/home/runner/work/toolbox/toolbox/node_modules/.pnpm/node_modules:$NODE_PATH"
|
|
16
16
|
fi
|
|
17
17
|
if [ -x "$basedir/node" ]; then
|
|
18
18
|
exec "$basedir/node" "$basedir/../vite/bin/vite.js" "$@"
|