autotel 2.18.0 → 2.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/attributes.cjs +21 -20
- package/dist/attributes.js +2 -1
- package/dist/chunk-2ZKEORFN.cjs +14 -0
- package/dist/chunk-2ZKEORFN.cjs.map +1 -0
- package/dist/chunk-4A53YIAX.js +180 -0
- package/dist/chunk-4A53YIAX.js.map +1 -0
- package/dist/{chunk-QKVQWGTF.js → chunk-5JLXDCL2.js} +3 -3
- package/dist/{chunk-QKVQWGTF.js.map → chunk-5JLXDCL2.js.map} +1 -1
- package/dist/chunk-7552UTQW.js +11 -0
- package/dist/chunk-7552UTQW.js.map +1 -0
- package/dist/{chunk-NWT5SYOX.cjs → chunk-BEVIAKTB.cjs} +5 -5
- package/dist/{chunk-NWT5SYOX.cjs.map → chunk-BEVIAKTB.cjs.map} +1 -1
- package/dist/chunk-ESMHTKLJ.cjs +206 -0
- package/dist/chunk-ESMHTKLJ.cjs.map +1 -0
- package/dist/{chunk-QP5LVD4L.js → chunk-G47ZCJGW.js} +25 -3
- package/dist/{chunk-QP5LVD4L.js.map → chunk-G47ZCJGW.js.map} +1 -1
- package/dist/{chunk-WC2AMGBX.js → chunk-LCMARHLX.js} +3 -3
- package/dist/{chunk-WC2AMGBX.js.map → chunk-LCMARHLX.js.map} +1 -1
- package/dist/{chunk-HZ23L5KR.cjs → chunk-LGT7XA5O.cjs} +5 -5
- package/dist/{chunk-HZ23L5KR.cjs.map → chunk-LGT7XA5O.cjs.map} +1 -1
- package/dist/{chunk-4HPWUYCV.js → chunk-M4US3P4K.js} +3 -170
- package/dist/chunk-M4US3P4K.js.map +1 -0
- package/dist/{chunk-FMPBL2NF.js → chunk-XBVB3AFF.js} +3 -3
- package/dist/{chunk-FMPBL2NF.js.map → chunk-XBVB3AFF.js.map} +1 -1
- package/dist/{chunk-DWRTSOGR.cjs → chunk-XI5WPVR5.cjs} +25 -3
- package/dist/chunk-XI5WPVR5.cjs.map +1 -0
- package/dist/{chunk-74L5DOB4.cjs → chunk-XNBTEFRZ.cjs} +7 -7
- package/dist/{chunk-74L5DOB4.cjs.map → chunk-XNBTEFRZ.cjs.map} +1 -1
- package/dist/chunk-XRBP4RYL.cjs +764 -0
- package/dist/chunk-XRBP4RYL.cjs.map +1 -0
- package/dist/decorators.cjs +1 -1
- package/dist/decorators.js +1 -1
- package/dist/functional.cjs +8 -8
- package/dist/functional.js +1 -1
- package/dist/index.cjs +65 -43
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +8 -6
- package/dist/index.js.map +1 -1
- package/dist/messaging.cjs +5 -5
- package/dist/messaging.js +2 -2
- package/dist/semantic-conventions.cjs +30 -0
- package/dist/semantic-conventions.cjs.map +1 -0
- package/dist/semantic-conventions.d.cts +29 -0
- package/dist/semantic-conventions.d.ts +29 -0
- package/dist/semantic-conventions.js +5 -0
- package/dist/semantic-conventions.js.map +1 -0
- package/dist/semantic-helpers.cjs +6 -6
- package/dist/semantic-helpers.js +2 -2
- package/dist/webhook.cjs +2 -2
- package/dist/webhook.js +1 -1
- package/dist/workflow-distributed.cjs +3 -3
- package/dist/workflow-distributed.js +1 -1
- package/dist/workflow.cjs +6 -6
- package/dist/workflow.js +2 -2
- package/package.json +16 -11
- package/src/decorators.test.ts +22 -72
- package/src/functional.test.ts +24 -6
- package/src/functional.ts +37 -2
- package/src/index.ts +9 -0
- package/src/init.openllmetry.test.ts +76 -76
- package/src/semantic-conventions.ts +15 -0
- package/dist/chunk-4HPWUYCV.js.map +0 -1
- package/dist/chunk-7F4PDILZ.cjs +0 -931
- package/dist/chunk-7F4PDILZ.cjs.map +0 -1
- package/dist/chunk-DWRTSOGR.cjs.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/attributes/builders.ts","../src/attributes/validators.ts","../src/attributes/utils.ts","../src/attributes/attachers.ts","../src/attributes/domains.ts"],"names":["UserAttributes","SessionAttributes","DeviceAttributes","HTTPAttributes","DBAttributes","ServiceAttributes","NetworkAttributes","ServerAddressAttributes","URLAttributes","ErrorAttributes","ExceptionAttributes","ProcessAttributes","ThreadAttributes","ContainerAttributes","K8sAttributes","CloudAttributes","FaaSAttributes","FeatureFlagAttributes","MessagingAttributes","GenAIAttributes","RPCAttributes","GraphQLAttributes","OTelAttributes","CodeAttributes","TLSAttributes","REDACTOR_PATTERNS","replacement","attrs","resourceFromAttributes"],"mappings":";;;;;;;AAmEO,IAAM,KAAA,GAAQ;AAAA,EACnB,IAAA,EAAM;AAAA,IACJ,EAAA,EAAI,CAAC,KAAA,MAAmB,EAAE,CAACA,gCAAA,CAAe,EAAE,GAAG,KAAA,EAAM,CAAA;AAAA,IACrD,KAAA,EAAO,CAAC,KAAA,MAAmB,EAAE,CAACA,gCAAA,CAAe,KAAK,GAAG,KAAA,EAAM,CAAA;AAAA,IAC3D,IAAA,EAAM,CAAC,KAAA,MAAmB,EAAE,CAACA,gCAAA,CAAe,IAAI,GAAG,KAAA,EAAM,CAAA;AAAA,IACzD,QAAA,EAAU,CAAC,KAAA,MAAmB,EAAE,CAACA,gCAAA,CAAe,QAAQ,GAAG,KAAA,EAAM,CAAA;AAAA,IACjE,IAAA,EAAM,CAAC,KAAA,MAAmB,EAAE,CAACA,gCAAA,CAAe,IAAI,GAAG,KAAA,EAAM,CAAA;AAAA,IACzD,KAAA,EAAO,CAAC,KAAA,MAAqB,EAAE,CAACA,gCAAA,CAAe,KAAK,GAAG,KAAA,EAAM,CAAA;AAAA,IAE7D,IAAA,EAAM,CAAC,IAAA,KAAoB;AACzB,MAAA,MAAM,SAAkC,EAAC;AACzC,MAAA,IAAI,KAAK,EAAA,KAAO,MAAA,SAAkBA,gCAAA,CAAe,EAAE,IAAI,IAAA,CAAK,EAAA;AAC5D,MAAA,IAAI,KAAK,KAAA,KAAU,MAAA,SAAkBA,gCAAA,CAAe,KAAK,IAAI,IAAA,CAA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,CAAA,CAAE,CAAA;AAAA,EAClE;AAEA,EAAA,iBAAA,CAAkB,aAAA,EAAe,QAAQ,UAAU,CAAA;AACrD","file":"chunk-XRBP4RYL.cjs","sourcesContent":["/**\n * Attribute builders for constructing OpenTelemetry attributes\n * Provides both key builders (Pattern A) and object builders (Pattern B)\n *\n * @example Pattern A: Key builders\n * ```typescript\n * attrs.user.id('123') // { 'user.id': '123' }\n * attrs.user.email('user@example.com') // { 'user.email': 'user@example.com' }\n * attrs.http.request.method('GET') // { 'http.request.method': 'GET' }\n * attrs.http.response.statusCode(200) // { 'http.response.status_code': 200 }\n * ```\n *\n * @example Pattern B: Object builders\n * ```typescript\n * attrs.user({ id: '123', email: 'user@example.com' })\n * attrs.http.server({ method: 'GET', route: '/users/:id', statusCode: 200 })\n * attrs.db.client({ system: 'postgresql', operation: 'SELECT', collectionName: 'users' })\n * ```\n */\n\nimport {\n UserAttributes,\n SessionAttributes,\n DeviceAttributes,\n HTTPAttributes,\n DBAttributes,\n ServiceAttributes,\n NetworkAttributes,\n ServerAddressAttributes,\n URLAttributes,\n ErrorAttributes,\n ExceptionAttributes,\n ProcessAttributes,\n ThreadAttributes,\n ContainerAttributes,\n K8sAttributes,\n CloudAttributes,\n FaaSAttributes,\n FeatureFlagAttributes,\n MessagingAttributes,\n GenAIAttributes,\n RPCAttributes,\n GraphQLAttributes,\n OTelAttributes,\n CodeAttributes,\n TLSAttributes,\n} from './registry';\n\nimport type {\n UserAttrs,\n SessionAttrs,\n DeviceAttrs,\n HTTPServerAttrs,\n HTTPClientAttrs,\n DBAttrs,\n ServiceAttrs,\n NetworkAttrs,\n ErrorAttrs,\n MessagingAttrs,\n CloudAttrs,\n ServerAddressAttrs,\n URLAttrs,\n ProcessAttrs,\n ContainerAttrs,\n ExceptionAttrs,\n} from './types';\n\nexport const attrs = {\n user: {\n id: (value: string) => ({ [UserAttributes.id]: value }),\n email: (value: string) => ({ [UserAttributes.email]: value }),\n name: (value: string) => ({ [UserAttributes.name]: value }),\n fullName: (value: string) => ({ [UserAttributes.fullName]: value }),\n hash: (value: string) => ({ [UserAttributes.hash]: value }),\n roles: (value: string[]) => ({ [UserAttributes.roles]: value }),\n\n data: (data: UserAttrs) => {\n const result: Record<string, unknown> = {};\n if (data.id !== undefined) result[UserAttributes.id] = data.id;\n if (data.email !== undefined) result[UserAttributes.email] = data.email;\n if (data.name !== undefined) result[UserAttributes.name] = data.name;\n if (data.fullName !== undefined)\n result[UserAttributes.fullName] = data.fullName;\n if (data.hash !== undefined) result[UserAttributes.hash] = data.hash;\n if (data.roles !== undefined) result[UserAttributes.roles] = data.roles;\n return result;\n },\n },\n\n session: {\n id: (value: string) => ({ [SessionAttributes.id]: value }),\n previousId: (value: string) => ({ [SessionAttributes.previousId]: value }),\n\n data: (data: SessionAttrs) => {\n const result: Record<string, unknown> = {};\n if (data.id !== undefined) result[SessionAttributes.id] = data.id;\n if (data.previousId !== undefined)\n result[SessionAttributes.previousId] = data.previousId;\n return result;\n },\n },\n\n device: {\n id: (value: string) => ({ [DeviceAttributes.id]: value }),\n manufacturer: (value: string) => ({\n [DeviceAttributes.manufacturer]: value,\n }),\n modelIdentifier: (value: string) => ({\n [DeviceAttributes.modelIdentifier]: value,\n }),\n modelName: (value: string) => ({ [DeviceAttributes.modelName]: value }),\n\n data: (data: DeviceAttrs) => {\n const result: Record<string, unknown> = {};\n if (data.id !== undefined) result[DeviceAttributes.id] = data.id;\n if (data.manufacturer !== undefined)\n result[DeviceAttributes.manufacturer] = data.manufacturer;\n if (data.modelIdentifier !== undefined)\n result[DeviceAttributes.modelIdentifier] = data.modelIdentifier;\n if (data.modelName !== undefined)\n result[DeviceAttributes.modelName] = data.modelName;\n return result;\n },\n },\n\n http: {\n request: {\n method: (value: string) => ({ [HTTPAttributes.requestMethod]: value }),\n methodOriginal: (value: string) => ({\n [HTTPAttributes.requestMethodOriginal]: value,\n }),\n resendCount: (value: number) => ({\n [HTTPAttributes.requestResendCount]: value,\n }),\n size: (value: number) => ({ [HTTPAttributes.requestSize]: value }),\n bodySize: (value: number) => ({\n [HTTPAttributes.requestBodySize]: value,\n }),\n },\n\n response: {\n statusCode: (value: number) => ({\n [HTTPAttributes.responseStatusCode]: value,\n }),\n size: (value: number) => ({ [HTTPAttributes.responseSize]: value }),\n bodySize: (value: number) => ({\n [HTTPAttributes.responseBodySize]: value,\n }),\n },\n\n route: (value: string) => ({ [HTTPAttributes.route]: value }),\n connectionState: (value: string) => ({\n [HTTPAttributes.connectionState]: value,\n }),\n\n server: (data: HTTPServerAttrs) => {\n const result: Record<string, unknown> = {};\n if (data.method !== undefined)\n result[HTTPAttributes.requestMethod] = data.method;\n if (data.route !== undefined) result[HTTPAttributes.route] = data.route;\n if (data.statusCode !== undefined)\n result[HTTPAttributes.responseStatusCode] = data.statusCode;\n if (data.bodySize !== undefined)\n result[HTTPAttributes.requestBodySize] = data.bodySize;\n if (data.requestSize !== undefined)\n result[HTTPAttributes.requestSize] = data.requestSize;\n if (data.responseSize !== undefined)\n result[HTTPAttributes.responseSize] = data.responseSize;\n if (data.resendCount !== undefined)\n result[HTTPAttributes.requestResendCount] = data.resendCount;\n return result;\n },\n\n client: (data: HTTPClientAttrs) => {\n const result: Record<string, unknown> = {};\n if (data.method !== undefined)\n result[HTTPAttributes.requestMethod] = data.method;\n if (data.url !== undefined) result[HTTPAttributes.route] = data.url;\n if (data.statusCode !== undefined)\n result[HTTPAttributes.responseStatusCode] = data.statusCode;\n return result;\n },\n },\n\n db: {\n client: {\n system: (value: string) => ({ [DBAttributes.systemName]: value }),\n operation: (value: string) => ({ [DBAttributes.operationName]: value }),\n collectionName: (value: string) => ({\n [DBAttributes.collectionName]: value,\n }),\n namespace: (value: string) => ({ [DBAttributes.namespace]: value }),\n statement: (value: string) => ({ [DBAttributes.statement]: value }),\n querySummary: (value: string) => ({ [DBAttributes.querySummary]: value }),\n queryText: (value: string) => ({ [DBAttributes.queryText]: value }),\n responseStatus: (value: string | number) => ({\n [DBAttributes.responseStatusCode]: value,\n }),\n rowsReturned: (value: number) => ({\n [DBAttributes.responseReturnedRows]: value,\n }),\n\n data: (data: DBAttrs) => {\n const result: Record<string, unknown> = {};\n if (data.system !== undefined)\n result[DBAttributes.systemName] = data.system;\n if (data.operation !== undefined)\n result[DBAttributes.operationName] = data.operation;\n if (data.collectionName !== undefined)\n result[DBAttributes.collectionName] = data.collectionName;\n // 'name' maps to db.namespace (db.name is deprecated per OTel semantic conventions)\n if (data.name !== undefined) result[DBAttributes.namespace] = data.name;\n // 'namespace' takes precedence over 'name' if both are provided\n if (data.namespace !== undefined)\n result[DBAttributes.namespace] = data.namespace;\n if (data.statement !== undefined)\n result[DBAttributes.statement] = data.statement;\n if (data.querySummary !== undefined)\n result[DBAttributes.querySummary] = data.querySummary;\n if (data.queryText !== undefined)\n result[DBAttributes.queryText] = data.queryText;\n if (data.responseStatus !== undefined)\n result[DBAttributes.responseStatusCode] = data.responseStatus;\n if (data.rowsReturned !== undefined)\n result[DBAttributes.responseReturnedRows] = data.rowsReturned;\n return result;\n },\n },\n },\n\n service: {\n name: (value: string) => ({ [ServiceAttributes.name]: value }),\n instance: (value: string) => ({ [ServiceAttributes.instance]: value }),\n version: (value: string) => ({ [ServiceAttributes.version]: value }),\n\n data: (data: ServiceAttrs) => {\n const result: Record<string, unknown> = {};\n if (data.name !== undefined) result[ServiceAttributes.name] = data.name;\n if (data.instance !== undefined)\n result[ServiceAttributes.instance] = data.instance;\n if (data.version !== undefined)\n result[ServiceAttributes.version] = data.version;\n return result;\n },\n },\n\n network: {\n peerAddress: (value: string) => ({\n [NetworkAttributes.peerAddress]: value,\n }),\n peerPort: (value: number) => ({ [NetworkAttributes.peerPort]: value }),\n transport: (value: string) => ({ [NetworkAttributes.transport]: value }),\n protocolName: (value: string) => ({\n [NetworkAttributes.protocolName]: value,\n }),\n protocolVersion: (value: string) => ({\n [NetworkAttributes.protocolVersion]: value,\n }),\n\n data: (data: NetworkAttrs) => {\n const result: Record<string, unknown> = {};\n if (data.peerAddress !== undefined)\n result[NetworkAttributes.peerAddress] = data.peerAddress;\n if (data.peerPort !== undefined)\n result[NetworkAttributes.peerPort] = data.peerPort;\n if (data.transport !== undefined)\n result[NetworkAttributes.transport] = data.transport;\n if (data.protocolName !== undefined)\n result[NetworkAttributes.protocolName] = data.protocolName;\n if (data.protocolVersion !== undefined)\n result[NetworkAttributes.protocolVersion] = data.protocolVersion;\n return result;\n },\n },\n\n server: {\n address: (value: string) => ({ [ServerAddressAttributes.address]: value }),\n port: (value: number) => ({ [ServerAddressAttributes.port]: value }),\n socketAddress: (value: string) => ({\n [ServerAddressAttributes.socketAddress]: value,\n }),\n\n data: (data: ServerAddressAttrs) => {\n const result: Record<string, unknown> = {};\n if (data.address !== undefined)\n result[ServerAddressAttributes.address] = data.address;\n if (data.port !== undefined)\n result[ServerAddressAttributes.port] = data.port;\n if (data.socketAddress !== undefined)\n result[ServerAddressAttributes.socketAddress] = data.socketAddress;\n return result;\n },\n },\n\n url: {\n scheme: (value: string) => ({ [URLAttributes.scheme]: value }),\n full: (value: string) => ({ [URLAttributes.full]: value }),\n path: (value: string) => ({ [URLAttributes.path]: value }),\n query: (value: string) => ({ [URLAttributes.query]: value }),\n fragment: (value: string) => ({ [URLAttributes.fragment]: value }),\n\n data: (data: URLAttrs) => {\n const result: Record<string, unknown> = {};\n if (data.scheme !== undefined) result[URLAttributes.scheme] = data.scheme;\n if (data.full !== undefined) result[URLAttributes.full] = data.full;\n if (data.path !== undefined) result[URLAttributes.path] = data.path;\n if (data.query !== undefined) result[URLAttributes.query] = data.query;\n if (data.fragment !== undefined)\n result[URLAttributes.fragment] = data.fragment;\n return result;\n },\n },\n\n error: {\n type: (value: string) => ({ [ErrorAttributes.type]: value }),\n message: (value: string) => ({ [ErrorAttributes.message]: value }),\n stackTrace: (value: string) => ({ [ErrorAttributes.stackTrace]: value }),\n code: (value: string | number) => ({ [ErrorAttributes.code]: value }),\n\n data: (data: ErrorAttrs) => {\n const result: Record<string, unknown> = {};\n if (data.type !== undefined) result[ErrorAttributes.type] = data.type;\n if (data.message !== undefined)\n result[ErrorAttributes.message] = data.message;\n if (data.stackTrace !== undefined)\n result[ErrorAttributes.stackTrace] = data.stackTrace;\n if (data.code !== undefined) result[ErrorAttributes.code] = data.code;\n return result;\n },\n },\n\n exception: {\n escaped: (value: boolean) => ({ [ExceptionAttributes.escaped]: value }),\n message: (value: string) => ({ [ExceptionAttributes.message]: value }),\n stackTrace: (value: string) => ({\n [ExceptionAttributes.stackTrace]: value,\n }),\n type: (value: string) => ({ [ExceptionAttributes.type]: value }),\n moduleName: (value: string) => ({\n [ExceptionAttributes.moduleName]: value,\n }),\n\n data: (data: ExceptionAttrs) => {\n const result: Record<string, unknown> = {};\n if (data.escaped !== undefined)\n result[ExceptionAttributes.escaped] = data.escaped;\n if (data.message !== undefined)\n result[ExceptionAttributes.message] = data.message;\n if (data.stackTrace !== undefined)\n result[ExceptionAttributes.stackTrace] = data.stackTrace;\n if (data.type !== undefined) result[ExceptionAttributes.type] = data.type;\n if (data.moduleName !== undefined)\n result[ExceptionAttributes.moduleName] = data.moduleName;\n return result;\n },\n },\n\n process: {\n pid: (value: number) => ({ [ProcessAttributes.pid]: value }),\n executablePath: (value: string) => ({\n [ProcessAttributes.executablePath]: value,\n }),\n command: (value: string) => ({ [ProcessAttributes.command]: value }),\n owner: (value: string) => ({ [ProcessAttributes.owner]: value }),\n\n data: (data: ProcessAttrs) => {\n const result: Record<string, unknown> = {};\n if (data.pid !== undefined) result[ProcessAttributes.pid] = data.pid;\n if (data.executablePath !== undefined)\n result[ProcessAttributes.executablePath] = data.executablePath;\n if (data.command !== undefined)\n result[ProcessAttributes.command] = data.command;\n if (data.owner !== undefined)\n result[ProcessAttributes.owner] = data.owner;\n return result;\n },\n },\n\n thread: {\n id: (value: number) => ({ [ThreadAttributes.id]: value }),\n name: (value: string) => ({ [ThreadAttributes.name]: value }),\n },\n\n container: {\n id: (value: string) => ({ [ContainerAttributes.id]: value }),\n name: (value: string) => ({ [ContainerAttributes.name]: value }),\n image: (value: string) => ({ [ContainerAttributes.image]: value }),\n tag: (value: string) => ({ [ContainerAttributes.tag]: value }),\n\n data: (data: ContainerAttrs) => {\n const result: Record<string, unknown> = {};\n if (data.id !== undefined) result[ContainerAttributes.id] = data.id;\n if (data.name !== undefined) result[ContainerAttributes.name] = data.name;\n if (data.image !== undefined)\n result[ContainerAttributes.image] = data.image;\n if (data.tag !== undefined) result[ContainerAttributes.tag] = data.tag;\n return result;\n },\n },\n\n k8s: {\n podName: (value: string) => ({ [K8sAttributes.podName]: value }),\n namespaceName: (value: string) => ({\n [K8sAttributes.namespaceName]: value,\n }),\n deploymentName: (value: string) => ({\n [K8sAttributes.deploymentName]: value,\n }),\n state: (value: string) => ({ [K8sAttributes.state]: value }),\n },\n\n cloud: {\n provider: (value: string) => ({ [CloudAttributes.provider]: value }),\n accountId: (value: string) => ({ [CloudAttributes.accountId]: value }),\n region: (value: string) => ({ [CloudAttributes.region]: value }),\n availabilityZone: (value: string) => ({\n [CloudAttributes.availabilityZone]: value,\n }),\n platform: (value: string) => ({ [CloudAttributes.platform]: value }),\n\n data: (data: CloudAttrs) => {\n const result: Record<string, unknown> = {};\n if (data.provider !== undefined)\n result[CloudAttributes.provider] = data.provider;\n if (data.accountId !== undefined)\n result[CloudAttributes.accountId] = data.accountId;\n if (data.region !== undefined)\n result[CloudAttributes.region] = data.region;\n if (data.availabilityZone !== undefined)\n result[CloudAttributes.availabilityZone] = data.availabilityZone;\n if (data.platform !== undefined)\n result[CloudAttributes.platform] = data.platform;\n return result;\n },\n },\n\n faas: {\n name: (value: string) => ({ [FaaSAttributes.name]: value }),\n version: (value: string) => ({ [FaaSAttributes.version]: value }),\n instance: (value: string) => ({ [FaaSAttributes.instance]: value }),\n execution: (value: string) => ({ [FaaSAttributes.execution]: value }),\n coldstart: (value: boolean) => ({ [FaaSAttributes.coldstart]: value }),\n },\n\n featureFlag: {\n key: (value: string) => ({ [FeatureFlagAttributes.key]: value }),\n provider: (value: string) => ({ [FeatureFlagAttributes.provider]: value }),\n variant: (value: string) => ({ [FeatureFlagAttributes.variant]: value }),\n },\n\n messaging: {\n system: (value: string) => ({ [MessagingAttributes.system]: value }),\n destination: (value: string) => ({\n [MessagingAttributes.destination]: value,\n }),\n operation: (value: 'publish' | 'receive' | 'process') => ({\n [MessagingAttributes.operation]: value,\n }),\n messageId: (value: string) => ({ [MessagingAttributes.messageId]: value }),\n conversationId: (value: string) => ({\n [MessagingAttributes.conversationId]: value,\n }),\n\n data: (data: MessagingAttrs) => {\n const result: Record<string, unknown> = {};\n if (data.system !== undefined)\n result[MessagingAttributes.system] = data.system;\n if (data.destination !== undefined)\n result[MessagingAttributes.destination] = data.destination;\n if (data.operation !== undefined)\n result[MessagingAttributes.operation] = data.operation;\n if (data.messageId !== undefined)\n result[MessagingAttributes.messageId] = data.messageId;\n if (data.conversationId !== undefined)\n result[MessagingAttributes.conversationId] = data.conversationId;\n return result;\n },\n },\n\n genAI: {\n system: (value: string) => ({ [GenAIAttributes.system]: value }),\n requestModel: (value: string) => ({\n [GenAIAttributes.requestModel]: value,\n }),\n responseModel: (value: string) => ({\n [GenAIAttributes.responseModel]: value,\n }),\n operationName: (value: 'chat' | 'completion' | 'embedding') => ({\n [GenAIAttributes.operationName]: value,\n }),\n usagePromptTokens: (value: number) => ({\n [GenAIAttributes.usagePromptTokens]: value,\n }),\n usageCompletionTokens: (value: number) => ({\n [GenAIAttributes.usageCompletionTokens]: value,\n }),\n provider: (value: string) => ({ [GenAIAttributes.provider]: value }),\n },\n\n rpc: {\n system: (value: string) => ({ [RPCAttributes.system]: value }),\n service: (value: string) => ({ [RPCAttributes.service]: value }),\n method: (value: string) => ({ [RPCAttributes.method]: value }),\n grpcStatusCode: (value: number) => ({\n [RPCAttributes.grpcStatusCode]: value,\n }),\n },\n\n graphql: {\n document: (value: string) => ({ [GraphQLAttributes.document]: value }),\n operationName: (value: string) => ({\n [GraphQLAttributes.operationName]: value,\n }),\n operationType: (value: 'query' | 'mutation' | 'subscription') => ({\n [GraphQLAttributes.operationType]: value,\n }),\n },\n\n otel: {\n libraryName: (value: string) => ({ [OTelAttributes.libraryName]: value }),\n libraryVersion: (value: string) => ({\n [OTelAttributes.libraryVersion]: value,\n }),\n statusCode: (value: string) => ({ [OTelAttributes.statusCode]: value }),\n },\n\n code: {\n namespace: (value: string) => ({ [CodeAttributes.namespace]: value }),\n filepath: (value: string) => ({ [CodeAttributes.filepath]: value }),\n function: (value: string) => ({ [CodeAttributes.function]: value }),\n class: (value: string) => ({ [CodeAttributes.class]: value }),\n method: (value: string) => ({ [CodeAttributes.method]: value }),\n column: (value: string) => ({ [CodeAttributes.column]: value }),\n lineNumber: (value: number) => ({ [CodeAttributes.lineNumber]: value }),\n repository: (value: string) => ({ [CodeAttributes.repository]: value }),\n revision: (value: string) => ({ [CodeAttributes.revision]: value }),\n },\n\n tls: {\n protocolVersion: (value: string) => ({\n [TLSAttributes.protocolVersion]: value,\n }),\n cipher: (value: string) => ({ [TLSAttributes.cipher]: value }),\n curveName: (value: string) => ({ [TLSAttributes.curveName]: value }),\n resumed: (value: boolean) => ({ [TLSAttributes.resumed]: value }),\n },\n} as const;\n","/**\n * Attribute validation, PII detection, and guardrails\n * Provides safe-by-default attribute handling with configurable policies\n */\n\nimport { REDACTOR_PATTERNS } from '../attribute-redacting-processor';\n\nexport interface AttributeGuardrails {\n /** How to handle PII in attributes */\n pii?: 'allow' | 'redact' | 'hash' | 'block';\n\n /** Maximum length for attribute values */\n maxLength?: number;\n\n /** Validate enum values against known values */\n validateEnum?: boolean;\n\n /** Log warnings for deprecated attributes instead of throwing */\n warnDeprecated?: boolean;\n\n /** Custom deprecation warnings */\n deprecatedWarnings?: Record<string, string>;\n}\n\nexport interface AttributePolicy {\n guardrails?: AttributeGuardrails;\n /** Custom deprecation warnings for specific attributes */\n deprecatedWarnings?: Record<string, string>;\n}\n\nconst DEPRECATED_ATTRIBUTES = {\n 'enduser.id': 'user.id',\n 'enduser.role': 'user.roles',\n 'enduser.scope': undefined,\n 'http.method': 'http.request.method',\n 'http.host': 'server.address',\n 'http.status_code': 'http.response.status_code',\n 'http.target': 'url.path',\n 'http.url': 'url.full',\n 'http.user_agent': 'user_agent.original',\n 'http.flavor': 'network.protocol.name',\n 'http.scheme': 'url.scheme',\n 'http.server_name': 'server.address',\n 'db.name': 'db.namespace',\n 'db.operation': 'db.operation.name',\n 'db.statement': 'db.query.text',\n 'db.system': 'db.system.name',\n 'db.collection': 'db.collection.name',\n 'db.instance.id': undefined,\n 'db.jdbc.driver_classname': undefined,\n 'db.mssql.instance_name': 'mssql.instance.name',\n 'db.sql.table': 'db.collection.name',\n 'http.client_ip': 'client.address',\n 'user_agent.original': 'user_agent.original',\n} as const;\n\nconst HTTP_METHODS = new Set([\n 'GET',\n 'POST',\n 'PUT',\n 'DELETE',\n 'PATCH',\n 'HEAD',\n 'OPTIONS',\n 'TRACE',\n 'QUERY',\n '_OTHER',\n]);\n\nexport function validateAttribute(\n key: string,\n value: unknown,\n policy: AttributePolicy = {},\n): unknown {\n const { guardrails = {} } = policy;\n\n if (value === undefined || value === null) {\n return undefined;\n }\n\n // For non-string values that don't need transformation, preserve the original type\n if (typeof value !== 'string') {\n // PII checks only apply to strings\n // maxLength only applies to strings\n // validateEnum only applies to strings\n return value;\n }\n\n const stringValue = value;\n\n if (guardrails.pii) {\n const piiResult = applyPIIPolicy(key, stringValue, guardrails.pii);\n if (piiResult !== stringValue) {\n return piiResult;\n }\n }\n\n if (guardrails.maxLength && stringValue.length > guardrails.maxLength) {\n return truncateValue(key, stringValue, guardrails.maxLength);\n }\n\n if (guardrails.validateEnum && HTTP_METHODS.has(stringValue)) {\n const normalizedMethod = normalizeHTTPMethod(stringValue);\n if (normalizedMethod !== stringValue) {\n return normalizedMethod;\n }\n }\n\n return stringValue;\n}\n\nfunction applyPIIPolicy(\n key: string,\n value: string,\n pii: AttributeGuardrails['pii'],\n): string {\n if (pii === 'allow') {\n return value;\n }\n\n if (pii === 'redact') {\n return redactIfPII(key, value);\n }\n\n if (pii === 'hash') {\n return hashIfPII(key, value);\n }\n\n if (pii === 'block' && isPIIKey(key)) {\n throw new Error(\n `PII attribute \"${key}\" is blocked by guardrails. Use pii: \"allow\" to enable it.`,\n );\n }\n\n return value;\n}\n\nfunction isPIIKey(key: string): boolean {\n const piiKeyPatterns = [\n 'email',\n 'phone',\n 'ssn',\n 'credit_card',\n 'password',\n 'secret',\n 'token',\n 'api_key',\n 'authorization',\n ];\n const lowerKey = key.toLowerCase();\n return piiKeyPatterns.some((pattern) => lowerKey.includes(pattern));\n}\n\nfunction redactIfPII(key: string, value: string): string {\n if (isPIIKey(key)) {\n // REDACTOR_PATTERNS values are RegExp patterns\n for (const [, pattern] of Object.entries(REDACTOR_PATTERNS)) {\n if (pattern instanceof RegExp && pattern.test(value)) {\n return '[REDACTED]';\n }\n }\n // If no pattern matched but key is PII, still redact\n return '[REDACTED]';\n }\n return value;\n}\n\nfunction hashIfPII(key: string, value: string): string {\n if (!isPIIKey(key)) {\n return value;\n }\n\n // Use a simple but consistent hash that produces 32-char hex\n // FNV-1a hash variant producing 128-bit output (32 hex chars)\n const FNV_PRIME = 0x01_00_01_93;\n const FNV_OFFSET = 0x81_1c_9d_c5;\n\n // Generate 4 32-bit hashes to produce 32 hex chars\n const hashes: number[] = [];\n for (let round = 0; round < 4; round++) {\n let hash = FNV_OFFSET;\n for (let i = 0; i < value.length; i++) {\n hash ^= (value.codePointAt(i) ?? 0) + round;\n hash = Math.imul(hash, FNV_PRIME);\n }\n hashes.push(hash >>> 0); // Convert to unsigned\n }\n\n return `hash_${hashes.map((h) => h.toString(16).padStart(8, '0')).join('')}`;\n}\n\nfunction truncateValue(key: string, value: string, maxLength: number): string {\n if (value.length <= maxLength) {\n return value;\n }\n return value.slice(0, maxLength - 3) + '...';\n}\n\nfunction normalizeHTTPMethod(method: string): string {\n const upper = method.toUpperCase();\n if (HTTP_METHODS.has(upper)) {\n return upper;\n }\n return upper;\n}\n\nexport function checkDeprecatedAttribute(\n key: string,\n policy: AttributePolicy = {},\n): string | null {\n const { guardrails = {}, deprecatedWarnings = {} } = policy;\n const { warnDeprecated = true } = guardrails;\n\n if (!warnDeprecated) {\n return null;\n }\n\n // Check if the key exists in the deprecated attributes map\n const isDeprecated = key in DEPRECATED_ATTRIBUTES;\n if (isDeprecated) {\n const replacement =\n DEPRECATED_ATTRIBUTES[key as keyof typeof DEPRECATED_ATTRIBUTES];\n if (replacement === undefined) {\n // Deprecated with no replacement (e.g., enduser.scope)\n console.warn(\n `[autotel/attributes] Attribute \"${key}\" is deprecated and has no replacement. ` +\n `Remove or find a replacement in OpenTelemetry semantic conventions.`,\n );\n } else {\n // Deprecated with a known replacement\n console.warn(\n `[autotel/attributes] Attribute \"${key}\" is deprecated. Use \"${replacement}\" instead.`,\n );\n }\n }\n\n if (deprecatedWarnings[key]) {\n console.warn(`[autotel/attributes] ${deprecatedWarnings[key]}`);\n }\n\n const replacement =\n DEPRECATED_ATTRIBUTES[key as keyof typeof DEPRECATED_ATTRIBUTES];\n return replacement ?? null;\n}\n\nexport function autoRedactPII(\n attributes: Record<string, unknown>,\n policy: AttributePolicy = {},\n): Record<string, unknown> {\n const { guardrails = { pii: 'redact' } } = policy;\n\n const redacted: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(attributes)) {\n redacted[key] = validateAttribute(key, value, { guardrails });\n }\n return redacted;\n}\n\nexport function defaultGuardrails(): AttributeGuardrails {\n return {\n pii: 'redact',\n maxLength: 255,\n validateEnum: true,\n warnDeprecated: true,\n };\n}\n","/**\n * Attribute utility functions\n */\n\nimport type { AttributeValue } from '../trace-context';\nimport {\n validateAttribute,\n autoRedactPII,\n defaultGuardrails,\n checkDeprecatedAttribute,\n type AttributePolicy,\n} from './validators';\n\n// Type for objects that have setAttributes method (spans or contexts)\n// Using a generic parameter to accommodate different AttributeValue types\ntype AttributeSetter = {\n setAttributes: (attrs: Record<string, AttributeValue>) => void;\n};\n\nexport function mergeAttrs(\n ...attrSets: Array<Record<string, unknown> | undefined>\n): Record<string, unknown> {\n const result: Record<string, unknown> = {};\n for (const attrSet of attrSets) {\n if (attrSet) {\n Object.assign(result, attrSet);\n }\n }\n return result;\n}\n\nexport function safeSetAttributes(\n span: AttributeSetter,\n attrs: Record<string, unknown>,\n policy?: AttributePolicy,\n): void {\n // Merge user-supplied guardrails with defaults so callers can tweak\n // a single option without opting out of the rest\n const mergedGuardrails = {\n ...defaultGuardrails(),\n ...policy?.guardrails,\n };\n const effectivePolicy: AttributePolicy = {\n ...policy,\n guardrails: mergedGuardrails,\n };\n\n const validated = autoRedactPII(attrs, effectivePolicy);\n\n const sanitizedAttrs: Record<string, AttributeValue> = {};\n for (const [key, value] of Object.entries(validated)) {\n if (value !== undefined) {\n // Check for deprecated attributes and log warnings\n checkDeprecatedAttribute(key, effectivePolicy);\n const validatedValue = validateAttribute(key, value, effectivePolicy);\n if (validatedValue !== undefined) {\n // Cast to AttributeValue since validateAttribute ensures valid types\n sanitizedAttrs[key] = validatedValue as AttributeValue;\n }\n }\n }\n\n span.setAttributes(sanitizedAttrs);\n}\n","/**\n * Signal attachment helpers\n * These functions know WHERE to attach attributes automatically\n * They handle span, resource, and log signals correctly\n */\n\nimport type { Span, Attributes } from '@opentelemetry/api';\nimport {\n resourceFromAttributes,\n type Resource,\n} from '@opentelemetry/resources';\nimport type { TraceContext } from '../trace-context';\nimport { attrs } from './builders';\nimport { safeSetAttributes } from './utils';\n\nexport function setUser(\n spanOrContext: Span | TraceContext,\n data: import('./types').UserAttrs,\n guardrails?: import('./validators').AttributePolicy,\n): void {\n const attributes = attrs.user.data(data);\n safeSetAttributes(spanOrContext, attributes, guardrails);\n}\n\nexport function setSession(\n spanOrContext: Span | TraceContext,\n data: import('./types').SessionAttrs,\n guardrails?: import('./validators').AttributePolicy,\n): void {\n const attributes = attrs.session.data(data);\n safeSetAttributes(spanOrContext, attributes, guardrails);\n}\n\nexport function setDevice(\n spanOrContext: Span | TraceContext,\n data: import('./types').DeviceAttrs,\n guardrails?: import('./validators').AttributePolicy,\n): void {\n const attributes = attrs.device.data(data);\n safeSetAttributes(spanOrContext, attributes, guardrails);\n}\n\nexport function httpServer(\n spanOrContext: Span | TraceContext,\n data: import('./types').HTTPServerAttrs,\n guardrails?: import('./validators').AttributePolicy,\n): void {\n const attributes = attrs.http.server(data);\n\n if ('updateName' in spanOrContext && data.method && data.route) {\n const span = spanOrContext as Span;\n span.updateName(`HTTP ${data.method} ${data.route}`);\n }\n\n safeSetAttributes(spanOrContext, attributes, guardrails);\n}\n\nexport function httpClient(\n spanOrContext: Span | TraceContext,\n data: import('./types').HTTPClientAttrs,\n guardrails?: import('./validators').AttributePolicy,\n): void {\n const attributes = attrs.http.client(data);\n safeSetAttributes(spanOrContext, attributes, guardrails);\n}\n\nexport function dbClient(\n spanOrContext: Span | TraceContext,\n data: import('./types').DBAttrs,\n guardrails?: import('./validators').AttributePolicy,\n): void {\n const attributes = attrs.db.client.data(data);\n safeSetAttributes(spanOrContext, attributes, guardrails);\n}\n\n/**\n * Merge service attributes into a Resource and return a new Resource.\n *\n * Resource.attributes is readonly, so this function returns a new merged\n * Resource rather than mutating the input.\n *\n * @param resource - The existing resource to merge with\n * @param data - Service attributes to add\n * @returns A new Resource with the merged attributes\n *\n * @example\n * ```typescript\n * const baseResource = Resource.default();\n * const enrichedResource = mergeServiceResource(baseResource, {\n * name: 'my-service',\n * version: '1.0.0',\n * });\n * ```\n */\nexport function mergeServiceResource(\n resource: Resource,\n data: import('./types').ServiceAttrs,\n): Resource {\n const attributes = attrs.service.data(data);\n return resource.merge(resourceFromAttributes(attributes as Attributes));\n}\n\nexport function identify(\n spanOrContext: Span | TraceContext,\n data: {\n user?: import('./types').UserAttrs;\n session?: import('./types').SessionAttrs;\n device?: import('./types').DeviceAttrs;\n },\n guardrails?: import('./validators').AttributePolicy,\n): void {\n const allAttrs = [];\n\n if (data.user) {\n allAttrs.push(attrs.user.data(data.user));\n }\n if (data.session) {\n allAttrs.push(attrs.session.data(data.session));\n }\n if (data.device) {\n allAttrs.push(attrs.device.data(data.device));\n }\n\n const merged: Record<string, unknown> = {};\n for (const attrSet of allAttrs) {\n Object.assign(merged, attrSet);\n }\n\n safeSetAttributes(spanOrContext, merged, guardrails);\n}\n\nexport function request(\n spanOrContext: Span | TraceContext,\n data: import('./types').HTTPServerAttrs & {\n clientIp?: string;\n },\n guardrails?: import('./validators').AttributePolicy,\n): void {\n const httpAttrs = attrs.http.server(data);\n const networkAttrs = attrs.network.peerAddress(data.clientIp || '');\n const merged = { ...httpAttrs, ...networkAttrs };\n safeSetAttributes(spanOrContext, merged, guardrails);\n}\n\nexport function setError(\n spanOrContext: Span | TraceContext,\n data: import('./types').ErrorAttrs,\n guardrails?: import('./validators').AttributePolicy,\n): void {\n const attributes = attrs.error.data(data);\n safeSetAttributes(spanOrContext, attributes, guardrails);\n}\n\nexport function setException(\n spanOrContext: Span | TraceContext,\n data: import('./types').ExceptionAttrs,\n guardrails?: import('./validators').AttributePolicy,\n): void {\n const attributes = attrs.exception.data(data);\n safeSetAttributes(spanOrContext, attributes, guardrails);\n}\n","/**\n * Domain helpers for common attribute patterns\n * These bundle multiple attribute groups into semantic helpers\n */\n\nimport { attrs } from './builders';\nimport { safeSetAttributes } from './utils';\n\nexport function transaction(\n spanOrContext: import('../trace-context').TraceContext,\n config: {\n user?: import('./types').UserAttrs;\n session?: import('./types').SessionAttrs;\n method?: string;\n route?: string;\n statusCode?: number;\n clientIp?: string;\n },\n guardrails?: import('./validators').AttributePolicy,\n): void {\n const userAttrs = attrs.user.data(config.user || {});\n const sessionAttrs = attrs.session.data(config.session || {});\n const httpAttrs = attrs.http.server({\n method: config.method,\n route: config.route,\n statusCode: config.statusCode,\n });\n const networkAttrs = attrs.network.peerAddress(config.clientIp || '');\n\n const merged = {\n ...userAttrs,\n ...sessionAttrs,\n ...httpAttrs,\n ...networkAttrs,\n };\n\n if (config.method && config.route && 'updateName' in spanOrContext) {\n spanOrContext.updateName(`HTTP ${config.method} ${config.route}`);\n }\n\n safeSetAttributes(spanOrContext, merged, guardrails);\n}\n"]}
|
package/dist/decorators.cjs
CHANGED
package/dist/decorators.js
CHANGED
package/dist/functional.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkXI5WPVR5_cjs = require('./chunk-XI5WPVR5.cjs');
|
|
4
4
|
require('./chunk-W4EUTSB2.cjs');
|
|
5
5
|
require('./chunk-5PZZHX4Y.cjs');
|
|
6
6
|
require('./chunk-D5LMF53P.cjs');
|
|
@@ -24,31 +24,31 @@ require('./chunk-JEQ2X3Z6.cjs');
|
|
|
24
24
|
|
|
25
25
|
Object.defineProperty(exports, "ctx", {
|
|
26
26
|
enumerable: true,
|
|
27
|
-
get: function () { return
|
|
27
|
+
get: function () { return chunkXI5WPVR5_cjs.ctx; }
|
|
28
28
|
});
|
|
29
29
|
Object.defineProperty(exports, "instrument", {
|
|
30
30
|
enumerable: true,
|
|
31
|
-
get: function () { return
|
|
31
|
+
get: function () { return chunkXI5WPVR5_cjs.instrument; }
|
|
32
32
|
});
|
|
33
33
|
Object.defineProperty(exports, "span", {
|
|
34
34
|
enumerable: true,
|
|
35
|
-
get: function () { return
|
|
35
|
+
get: function () { return chunkXI5WPVR5_cjs.span; }
|
|
36
36
|
});
|
|
37
37
|
Object.defineProperty(exports, "trace", {
|
|
38
38
|
enumerable: true,
|
|
39
|
-
get: function () { return
|
|
39
|
+
get: function () { return chunkXI5WPVR5_cjs.trace; }
|
|
40
40
|
});
|
|
41
41
|
Object.defineProperty(exports, "withBaggage", {
|
|
42
42
|
enumerable: true,
|
|
43
|
-
get: function () { return
|
|
43
|
+
get: function () { return chunkXI5WPVR5_cjs.withBaggage; }
|
|
44
44
|
});
|
|
45
45
|
Object.defineProperty(exports, "withNewContext", {
|
|
46
46
|
enumerable: true,
|
|
47
|
-
get: function () { return
|
|
47
|
+
get: function () { return chunkXI5WPVR5_cjs.withNewContext; }
|
|
48
48
|
});
|
|
49
49
|
Object.defineProperty(exports, "withTracing", {
|
|
50
50
|
enumerable: true,
|
|
51
|
-
get: function () { return
|
|
51
|
+
get: function () { return chunkXI5WPVR5_cjs.withTracing; }
|
|
52
52
|
});
|
|
53
53
|
//# sourceMappingURL=functional.cjs.map
|
|
54
54
|
//# sourceMappingURL=functional.cjs.map
|
package/dist/functional.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { ctx, instrument, span, trace, withBaggage, withNewContext, withTracing } from './chunk-
|
|
1
|
+
export { ctx, instrument, span, trace, withBaggage, withNewContext, withTracing } from './chunk-G47ZCJGW.js';
|
|
2
2
|
import './chunk-SR35DG5A.js';
|
|
3
3
|
import './chunk-HJPXNUZR.js';
|
|
4
4
|
import './chunk-WD4RP6IV.js';
|
package/dist/index.cjs
CHANGED
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
3
|
+
var chunkLGT7XA5O_cjs = require('./chunk-LGT7XA5O.cjs');
|
|
4
|
+
var chunkXRBP4RYL_cjs = require('./chunk-XRBP4RYL.cjs');
|
|
5
|
+
var chunk2ZKEORFN_cjs = require('./chunk-2ZKEORFN.cjs');
|
|
6
|
+
var chunkESMHTKLJ_cjs = require('./chunk-ESMHTKLJ.cjs');
|
|
7
|
+
var chunkBEVIAKTB_cjs = require('./chunk-BEVIAKTB.cjs');
|
|
6
8
|
var chunkINJD3G4K_cjs = require('./chunk-INJD3G4K.cjs');
|
|
7
9
|
var chunkTC5ZPWM4_cjs = require('./chunk-TC5ZPWM4.cjs');
|
|
8
10
|
require('./chunk-YTXEZ4SD.cjs');
|
|
9
11
|
var chunkWJH6IYU2_cjs = require('./chunk-WJH6IYU2.cjs');
|
|
10
|
-
var
|
|
11
|
-
var
|
|
12
|
+
var chunkXNBTEFRZ_cjs = require('./chunk-XNBTEFRZ.cjs');
|
|
13
|
+
var chunkXI5WPVR5_cjs = require('./chunk-XI5WPVR5.cjs');
|
|
12
14
|
var chunkW4EUTSB2_cjs = require('./chunk-W4EUTSB2.cjs');
|
|
13
15
|
var chunk5PZZHX4Y_cjs = require('./chunk-5PZZHX4Y.cjs');
|
|
14
16
|
var chunk4UYR46UP_cjs = require('./chunk-4UYR46UP.cjs');
|
|
@@ -37,7 +39,7 @@ async function flush(options) {
|
|
|
37
39
|
const timeout = options?.timeout ?? 2e3;
|
|
38
40
|
const forShutdown = options?.forShutdown ?? false;
|
|
39
41
|
const doFlush = async () => {
|
|
40
|
-
const eventsQueue =
|
|
42
|
+
const eventsQueue = chunkXI5WPVR5_cjs.getEventQueue();
|
|
41
43
|
if (eventsQueue) {
|
|
42
44
|
if (forShutdown) {
|
|
43
45
|
await eventsQueue.shutdown();
|
|
@@ -119,13 +121,13 @@ async function shutdown() {
|
|
|
119
121
|
logger.error({ err }, "[autotel] SDK shutdown failed");
|
|
120
122
|
}
|
|
121
123
|
} finally {
|
|
122
|
-
const eventsQueue =
|
|
124
|
+
const eventsQueue = chunkXI5WPVR5_cjs.getEventQueue();
|
|
123
125
|
if (eventsQueue && typeof eventsQueue.cleanup === "function") {
|
|
124
126
|
eventsQueue.cleanup();
|
|
125
127
|
}
|
|
126
128
|
chunk4UYR46UP_cjs.resetEvents();
|
|
127
129
|
chunkTC5ZPWM4_cjs.resetMetrics();
|
|
128
|
-
|
|
130
|
+
chunkXI5WPVR5_cjs.resetEventQueue();
|
|
129
131
|
}
|
|
130
132
|
if (shutdownError) {
|
|
131
133
|
throw shutdownError;
|
|
@@ -164,91 +166,111 @@ registerShutdownHooks();
|
|
|
164
166
|
|
|
165
167
|
Object.defineProperty(exports, "getCurrentWorkflowContext", {
|
|
166
168
|
enumerable: true,
|
|
167
|
-
get: function () { return
|
|
169
|
+
get: function () { return chunkLGT7XA5O_cjs.getCurrentWorkflowContext; }
|
|
168
170
|
});
|
|
169
171
|
Object.defineProperty(exports, "isInWorkflow", {
|
|
170
172
|
enumerable: true,
|
|
171
|
-
get: function () { return
|
|
173
|
+
get: function () { return chunkLGT7XA5O_cjs.isInWorkflow; }
|
|
172
174
|
});
|
|
173
175
|
Object.defineProperty(exports, "traceStep", {
|
|
174
176
|
enumerable: true,
|
|
175
|
-
get: function () { return
|
|
177
|
+
get: function () { return chunkLGT7XA5O_cjs.traceStep; }
|
|
176
178
|
});
|
|
177
179
|
Object.defineProperty(exports, "traceWorkflow", {
|
|
178
180
|
enumerable: true,
|
|
179
|
-
get: function () { return
|
|
181
|
+
get: function () { return chunkLGT7XA5O_cjs.traceWorkflow; }
|
|
180
182
|
});
|
|
181
183
|
Object.defineProperty(exports, "attrs", {
|
|
182
184
|
enumerable: true,
|
|
183
|
-
get: function () { return
|
|
185
|
+
get: function () { return chunkXRBP4RYL_cjs.attrs; }
|
|
184
186
|
});
|
|
185
187
|
Object.defineProperty(exports, "autoRedactPII", {
|
|
186
188
|
enumerable: true,
|
|
187
|
-
get: function () { return
|
|
189
|
+
get: function () { return chunkXRBP4RYL_cjs.autoRedactPII; }
|
|
188
190
|
});
|
|
189
191
|
Object.defineProperty(exports, "dbClient", {
|
|
190
192
|
enumerable: true,
|
|
191
|
-
get: function () { return
|
|
193
|
+
get: function () { return chunkXRBP4RYL_cjs.dbClient; }
|
|
192
194
|
});
|
|
193
195
|
Object.defineProperty(exports, "httpClient", {
|
|
194
196
|
enumerable: true,
|
|
195
|
-
get: function () { return
|
|
197
|
+
get: function () { return chunkXRBP4RYL_cjs.httpClient; }
|
|
196
198
|
});
|
|
197
199
|
Object.defineProperty(exports, "httpServer", {
|
|
198
200
|
enumerable: true,
|
|
199
|
-
get: function () { return
|
|
201
|
+
get: function () { return chunkXRBP4RYL_cjs.httpServer; }
|
|
200
202
|
});
|
|
201
203
|
Object.defineProperty(exports, "identify", {
|
|
202
204
|
enumerable: true,
|
|
203
|
-
get: function () { return
|
|
205
|
+
get: function () { return chunkXRBP4RYL_cjs.identify; }
|
|
204
206
|
});
|
|
205
207
|
Object.defineProperty(exports, "mergeAttrs", {
|
|
206
208
|
enumerable: true,
|
|
207
|
-
get: function () { return
|
|
209
|
+
get: function () { return chunkXRBP4RYL_cjs.mergeAttrs; }
|
|
208
210
|
});
|
|
209
211
|
Object.defineProperty(exports, "mergeServiceResource", {
|
|
210
212
|
enumerable: true,
|
|
211
|
-
get: function () { return
|
|
213
|
+
get: function () { return chunkXRBP4RYL_cjs.mergeServiceResource; }
|
|
212
214
|
});
|
|
213
215
|
Object.defineProperty(exports, "request", {
|
|
214
216
|
enumerable: true,
|
|
215
|
-
get: function () { return
|
|
217
|
+
get: function () { return chunkXRBP4RYL_cjs.request; }
|
|
216
218
|
});
|
|
217
219
|
Object.defineProperty(exports, "safeSetAttributes", {
|
|
218
220
|
enumerable: true,
|
|
219
|
-
get: function () { return
|
|
221
|
+
get: function () { return chunkXRBP4RYL_cjs.safeSetAttributes; }
|
|
220
222
|
});
|
|
221
223
|
Object.defineProperty(exports, "setDevice", {
|
|
222
224
|
enumerable: true,
|
|
223
|
-
get: function () { return
|
|
225
|
+
get: function () { return chunkXRBP4RYL_cjs.setDevice; }
|
|
224
226
|
});
|
|
225
227
|
Object.defineProperty(exports, "setError", {
|
|
226
228
|
enumerable: true,
|
|
227
|
-
get: function () { return
|
|
229
|
+
get: function () { return chunkXRBP4RYL_cjs.setError; }
|
|
228
230
|
});
|
|
229
231
|
Object.defineProperty(exports, "setException", {
|
|
230
232
|
enumerable: true,
|
|
231
|
-
get: function () { return
|
|
233
|
+
get: function () { return chunkXRBP4RYL_cjs.setException; }
|
|
232
234
|
});
|
|
233
235
|
Object.defineProperty(exports, "setSession", {
|
|
234
236
|
enumerable: true,
|
|
235
|
-
get: function () { return
|
|
237
|
+
get: function () { return chunkXRBP4RYL_cjs.setSession; }
|
|
236
238
|
});
|
|
237
239
|
Object.defineProperty(exports, "setUser", {
|
|
238
240
|
enumerable: true,
|
|
239
|
-
get: function () { return
|
|
241
|
+
get: function () { return chunkXRBP4RYL_cjs.setUser; }
|
|
240
242
|
});
|
|
241
243
|
Object.defineProperty(exports, "validateAttribute", {
|
|
242
244
|
enumerable: true,
|
|
243
|
-
get: function () { return
|
|
245
|
+
get: function () { return chunkXRBP4RYL_cjs.validateAttribute; }
|
|
246
|
+
});
|
|
247
|
+
Object.defineProperty(exports, "httpRequestHeaderAttribute", {
|
|
248
|
+
enumerable: true,
|
|
249
|
+
get: function () { return chunk2ZKEORFN_cjs.httpRequestHeaderAttribute; }
|
|
250
|
+
});
|
|
251
|
+
Object.defineProperty(exports, "httpResponseHeaderAttribute", {
|
|
252
|
+
enumerable: true,
|
|
253
|
+
get: function () { return chunk2ZKEORFN_cjs.httpResponseHeaderAttribute; }
|
|
254
|
+
});
|
|
255
|
+
Object.defineProperty(exports, "HTTPAttributes", {
|
|
256
|
+
enumerable: true,
|
|
257
|
+
get: function () { return chunkESMHTKLJ_cjs.HTTPAttributes; }
|
|
258
|
+
});
|
|
259
|
+
Object.defineProperty(exports, "ServiceAttributes", {
|
|
260
|
+
enumerable: true,
|
|
261
|
+
get: function () { return chunkESMHTKLJ_cjs.ServiceAttributes; }
|
|
262
|
+
});
|
|
263
|
+
Object.defineProperty(exports, "URLAttributes", {
|
|
264
|
+
enumerable: true,
|
|
265
|
+
get: function () { return chunkESMHTKLJ_cjs.URLAttributes; }
|
|
244
266
|
});
|
|
245
267
|
Object.defineProperty(exports, "traceConsumer", {
|
|
246
268
|
enumerable: true,
|
|
247
|
-
get: function () { return
|
|
269
|
+
get: function () { return chunkBEVIAKTB_cjs.traceConsumer; }
|
|
248
270
|
});
|
|
249
271
|
Object.defineProperty(exports, "traceProducer", {
|
|
250
272
|
enumerable: true,
|
|
251
|
-
get: function () { return
|
|
273
|
+
get: function () { return chunkBEVIAKTB_cjs.traceProducer; }
|
|
252
274
|
});
|
|
253
275
|
Object.defineProperty(exports, "BusinessBaggage", {
|
|
254
276
|
enumerable: true,
|
|
@@ -292,55 +314,55 @@ Object.defineProperty(exports, "getMeter", {
|
|
|
292
314
|
});
|
|
293
315
|
Object.defineProperty(exports, "traceDB", {
|
|
294
316
|
enumerable: true,
|
|
295
|
-
get: function () { return
|
|
317
|
+
get: function () { return chunkXNBTEFRZ_cjs.traceDB; }
|
|
296
318
|
});
|
|
297
319
|
Object.defineProperty(exports, "traceHTTP", {
|
|
298
320
|
enumerable: true,
|
|
299
|
-
get: function () { return
|
|
321
|
+
get: function () { return chunkXNBTEFRZ_cjs.traceHTTP; }
|
|
300
322
|
});
|
|
301
323
|
Object.defineProperty(exports, "traceLLM", {
|
|
302
324
|
enumerable: true,
|
|
303
|
-
get: function () { return
|
|
325
|
+
get: function () { return chunkXNBTEFRZ_cjs.traceLLM; }
|
|
304
326
|
});
|
|
305
327
|
Object.defineProperty(exports, "traceMessaging", {
|
|
306
328
|
enumerable: true,
|
|
307
|
-
get: function () { return
|
|
329
|
+
get: function () { return chunkXNBTEFRZ_cjs.traceMessaging; }
|
|
308
330
|
});
|
|
309
331
|
Object.defineProperty(exports, "ctx", {
|
|
310
332
|
enumerable: true,
|
|
311
|
-
get: function () { return
|
|
333
|
+
get: function () { return chunkXI5WPVR5_cjs.ctx; }
|
|
312
334
|
});
|
|
313
335
|
Object.defineProperty(exports, "getEventQueue", {
|
|
314
336
|
enumerable: true,
|
|
315
|
-
get: function () { return
|
|
337
|
+
get: function () { return chunkXI5WPVR5_cjs.getEventQueue; }
|
|
316
338
|
});
|
|
317
339
|
Object.defineProperty(exports, "instrument", {
|
|
318
340
|
enumerable: true,
|
|
319
|
-
get: function () { return
|
|
341
|
+
get: function () { return chunkXI5WPVR5_cjs.instrument; }
|
|
320
342
|
});
|
|
321
343
|
Object.defineProperty(exports, "span", {
|
|
322
344
|
enumerable: true,
|
|
323
|
-
get: function () { return
|
|
345
|
+
get: function () { return chunkXI5WPVR5_cjs.span; }
|
|
324
346
|
});
|
|
325
347
|
Object.defineProperty(exports, "trace", {
|
|
326
348
|
enumerable: true,
|
|
327
|
-
get: function () { return
|
|
349
|
+
get: function () { return chunkXI5WPVR5_cjs.trace; }
|
|
328
350
|
});
|
|
329
351
|
Object.defineProperty(exports, "track", {
|
|
330
352
|
enumerable: true,
|
|
331
|
-
get: function () { return
|
|
353
|
+
get: function () { return chunkXI5WPVR5_cjs.track; }
|
|
332
354
|
});
|
|
333
355
|
Object.defineProperty(exports, "withBaggage", {
|
|
334
356
|
enumerable: true,
|
|
335
|
-
get: function () { return
|
|
357
|
+
get: function () { return chunkXI5WPVR5_cjs.withBaggage; }
|
|
336
358
|
});
|
|
337
359
|
Object.defineProperty(exports, "withNewContext", {
|
|
338
360
|
enumerable: true,
|
|
339
|
-
get: function () { return
|
|
361
|
+
get: function () { return chunkXI5WPVR5_cjs.withNewContext; }
|
|
340
362
|
});
|
|
341
363
|
Object.defineProperty(exports, "withTracing", {
|
|
342
364
|
enumerable: true,
|
|
343
|
-
get: function () { return
|
|
365
|
+
get: function () { return chunkXI5WPVR5_cjs.withTracing; }
|
|
344
366
|
});
|
|
345
367
|
Object.defineProperty(exports, "defineBaggageSchema", {
|
|
346
368
|
enumerable: true,
|
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/shutdown.ts"],"names":["getEventQueue","getSdk","getLogger","resetEvents","resetMetrics","resetEventQueue"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqCA,eAAsB,MAAM,OAAA,EAGV;AAChB,EAAA,MAAM,OAAA,GAAU,SAAS,OAAA,IAAW,GAAA;AACpC,EAAA,MAAM,WAAA,GAAc,SAAS,WAAA,IAAe,KAAA;AAE5C,EAAA,MAAM,UAAU,YAAY;AAE1B,IAAA,MAAM,cAAcA,+BAAA,EAAc;AAClC,IAAA,IAAI,WAAA,EAAa;AACf,MAAA,IAAI,WAAA,EAAa;AACf,QAAA,MAAM,YAAY,QAAA,EAAS;AAAA,MAC7B,CAAA,MAAO;AACL,QAAA,MAAM,YAAY,KAAA,EAAM;AAAA,MAC1B;AAA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AY,UAAA,EAAY;AAC5D,MAAA,WAAA,CAAY,OAAA,EAAQ;AAAA,IACtB;AACA,IAAAG,6BAAA,EAAY;AACZ,IAAAC,8BAAA,EAAa;AACb,IAAAC,iCAAA,EAAgB;AAAA,EAClB;AAIA,EAAA,IAAI,aAAA,EAAe;AACjB,IAAA,MAAM,aAAA;AAAA,EACR;AACF;AAWA,SAAS,qBAAA,GAA8B;AACrC,EAAA,IAAI,OAAO,YAAY,WAAA,EAAa;AAEpC,EAAA,MAAM,OAAA,GAA4B,CAAC,SAAA,EAAW,QAAQ,CAAA;AACtD,EAAA,IAAI,YAAA,GAAe,KAAA;AAEnB,EAAA,KAAA,MAAW,UAAU,OAAA,EAAS;AAC5B,IAAA,OAAA,CAAQ,EAAA,CAAG,QAAQ,YAAY;AAC7B,MAAA,IAAI,YAAA,EAAc;AAClB,MAAA,YAAA,GAAe,IAAA;AAEf,MAAA,IAAI,OAAA,CAAQ,GAAA,CAAI,QAAA,KAAa,MAAA,EAAQ;AACnC,QAAAH,2BAAA,EAAU,CAAE,IAAA;AAAA,UACV,EAAC;AAAA,UACD,sBAAsB,MAAM,CAAA,uBAAA;AAAA,SAC9B;AAAA,MACF;AAEA,MAAA,IAAI;AACF,QAAA,MAAM,QAAA,EAAS;AAAA,MACjB,SAAS,KAAA,EAAO;AACd,QAAAA,2BAAA,EAAU,CAAE,KAAA;AAAA,UACV;AAAA,YACE,GAAA,EAAK,KAAA,YAAiB,KAAA,GAAQ,KAAA,GAAQ;AAAA,WACxC;AAAA,UACA;AAAA,SACF;AAAA,MACF,CAAA,SAAE;AACA,QAAA,OAAA,CAAQ,KAAK,CAAC,CAAA;AAAA,MAChB;AAAA,IACF,CAAC,CAAA;AAAA,EACH;AACF;AAGA,qBAAA,EAAsB","file":"index.cjs","sourcesContent":["/**\n * Graceful shutdown with flush and cleanup\n */\n\nimport { getSdk, getLogger } from './init';\nimport { getEventQueue, resetEventQueue } from './track';\nimport { resetEvents } from './event';\nimport { resetMetrics } from './metric';\n\n/**\n * Flush all pending telemetry\n *\n * Flushes both events events and OpenTelemetry spans to their destinations.\n * Includes timeout protection to prevent hanging in serverless environments.\n *\n * Safe to call multiple times.\n *\n * @param options - Optional configuration\n * @param options.timeout - Timeout in milliseconds (default: 2000ms)\n * @param options.forShutdown - If true, permanently disables the events queue after flush (used internally by shutdown())\n *\n * @example Manual flush in serverless\n * ```typescript\n * import { flush } from 'autotel';\n *\n * export const handler = async (event) => {\n * // ... process event\n * await flush(); // Flush before function returns\n * return result;\n * };\n * ```\n *\n * @example With custom timeout\n * ```typescript\n * await flush({ timeout: 5000 }); // 5 second timeout\n * ```\n */\nexport async function flush(options?: {\n timeout?: number;\n forShutdown?: boolean;\n}): Promise<void> {\n const timeout = options?.timeout ?? 2000;\n const forShutdown = options?.forShutdown ?? false;\n\n const doFlush = async () => {\n // Flush events queue (or shutdown queue when tearing down)\n const eventsQueue = getEventQueue();\n if (eventsQueue) {\n if (forShutdown) {\n await eventsQueue.shutdown();\n } else {\n await eventsQueue.flush();\n }\n }\n\n // Flush OpenTelemetry spans\n // This ensures spans are exported immediately, critical for serverless\n const sdk = getSdk();\n if (sdk) {\n try {\n // Type assertion needed as getTracerProvider is not in the public NodeSDK interface\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const sdkAny = sdk as any;\n if (typeof sdkAny.getTracerProvider === 'function') {\n const tracerProvider = sdkAny.getTracerProvider();\n if (\n tracerProvider &&\n typeof tracerProvider.forceFlush === 'function'\n ) {\n await tracerProvider.forceFlush();\n }\n }\n } catch {\n // Ignore errors when accessing tracer provider (may not be available in test mocks)\n }\n }\n };\n\n // Add timeout protection to prevent hanging\n let timeoutHandle: NodeJS.Timeout | undefined;\n try {\n await Promise.race([\n doFlush().finally(() => {\n // Clear timeout as soon as flush completes\n if (timeoutHandle) {\n clearTimeout(timeoutHandle);\n }\n }),\n new Promise<void>((_, reject) => {\n timeoutHandle = setTimeout(\n () => reject(new Error('Flush timeout')),\n timeout,\n );\n // Use unref() to allow Node to exit if flush completes first\n // This prevents the 2s delay in serverless when flush succeeds immediately\n timeoutHandle.unref();\n }),\n ]);\n } catch (error) {\n // Clear timeout on error too\n if (timeoutHandle) {\n clearTimeout(timeoutHandle);\n }\n const logger = getLogger();\n logger.error(\n {\n err: error instanceof Error ? error : new Error(String(error)),\n },\n '[autotel] Flush error',\n );\n throw error;\n }\n}\n\n/**\n * Shutdown telemetry and cleanup resources\n *\n * - Flushes all pending data\n * - Shuts down OpenTelemetry SDK\n * - Cleans up resources\n *\n * Call this before process exit.\n *\n * Always performs cleanup even if flush fails, preventing resource leaks\n * in serverless handlers or tests.\n *\n * @example Express server\n * ```typescript\n * const server = app.listen(3000)\n *\n * process.on('SIGTERM', async () => {\n * await server.close()\n * await shutdown()\n * process.exit(0)\n * })\n * ```\n */\nexport async function shutdown(): Promise<void> {\n const logger = getLogger();\n let shutdownError: Error | null = null;\n\n // Attempt to flush (with queue shutdown so new events are rejected), but continue with cleanup even if it fails\n try {\n await flush({ forShutdown: true });\n } catch (error) {\n const err = error instanceof Error ? error : new Error(String(error));\n shutdownError = err;\n logger.error(\n {\n err,\n },\n '[autotel] Flush failed during shutdown, continuing cleanup',\n );\n }\n\n // Always shutdown SDK and clean up resources\n try {\n // Shutdown OpenTelemetry SDK\n const sdk = getSdk();\n if (sdk) {\n await sdk.shutdown();\n }\n } catch (error) {\n const err = error instanceof Error ? error : new Error(String(error));\n\n // Ignore ECONNREFUSED errors - this happens when no OTLP endpoint was configured\n // The SDK tries to flush exporters that don't exist, which is harmless\n const isConnectionRefused =\n typeof error === 'object' &&\n error !== null &&\n 'code' in error &&\n error.code === 'ECONNREFUSED';\n\n if (!isConnectionRefused) {\n // Only store/log non-connection errors\n if (!shutdownError) {\n shutdownError = err;\n }\n logger.error({ err }, '[autotel] SDK shutdown failed');\n }\n } finally {\n // Clean up singleton Maps and queues to prevent memory leaks\n // This runs even if SDK shutdown fails\n const eventsQueue = getEventQueue();\n if (eventsQueue && typeof eventsQueue.cleanup === 'function') {\n eventsQueue.cleanup();\n }\n resetEvents();\n resetMetrics();\n resetEventQueue();\n }\n\n // Rethrow first error after cleanup completes\n // This allows tests and CI to detect failures while still ensuring cleanup\n if (shutdownError) {\n throw shutdownError;\n }\n}\n\n/**\n * Register automatic shutdown hooks for common signals\n *\n * Handles:\n * - SIGTERM (Docker/K8s graceful shutdown)\n * - SIGINT (Ctrl+C)\n *\n * @internal Called automatically on module load\n */\nfunction registerShutdownHooks(): void {\n if (typeof process === 'undefined') return; // Not in Node.js\n\n const signals: NodeJS.Signals[] = ['SIGTERM', 'SIGINT'];\n let shuttingDown = false;\n\n for (const signal of signals) {\n process.on(signal, async () => {\n if (shuttingDown) return; // Prevent double shutdown\n shuttingDown = true;\n\n if (process.env.NODE_ENV !== 'test') {\n getLogger().info(\n {},\n `[autotel] Received ${signal}, flushing telemetry...`,\n );\n }\n\n try {\n await shutdown();\n } catch (error) {\n getLogger().error(\n {\n err: error instanceof Error ? error : undefined,\n },\n '[autotel] Error during shutdown',\n );\n } finally {\n process.exit(0);\n }\n });\n }\n}\n\n// Auto-register shutdown hooks\nregisterShutdownHooks();\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/shutdown.ts"],"names":["getEventQueue","getSdk","getLogger","resetEvents","resetMetrics","resetEventQueue"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqCA,eAAsB,MAAM,OAAA,EAGV;AAChB,EAAA,MAAM,OAAA,GAAU,SAAS,OAAA,IAAW,GAAA;AACpC,EAAA,MAAM,WAAA,GAAc,SAAS,WAAA,IAAe,KAAA;AAE5C,EAAA,MAAM,UAAU,YAAY;AAE1B,IAAA,MAAM,cAAcA,+BAAA,EAAc;AAClC,IAAA,IAAI,WAAA,EAAa;AACf,MAAA,IAAI,WAAA,EAAa;AACf,QAAA,MAAM,YAAY,QAAA,EAAS;AAAA,MAC7B,CAAA,MAAO;AACL,QAAA,MAAM,YAAY,KAAA,EAAM;AAAA,MAC1B;AAA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AY,UAAA,EAAY;AAC5D,MAAA,WAAA,CAAY,OAAA,EAAQ;AAAA,IACtB;AACA,IAAAG,6BAAA,EAAY;AACZ,IAAAC,8BAAA,EAAa;AACb,IAAAC,iCAAA,EAAgB;AAAA,EAClB;AAIA,EAAA,IAAI,aAAA,EAAe;AACjB,IAAA,MAAM,aAAA;AAAA,EACR;AACF;AAWA,SAAS,qBAAA,GAA8B;AACrC,EAAA,IAAI,OAAO,YAAY,WAAA,EAAa;AAEpC,EAAA,MAAM,OAAA,GAA4B,CAAC,SAAA,EAAW,QAAQ,CAAA;AACtD,EAAA,IAAI,YAAA,GAAe,KAAA;AAEnB,EAAA,KAAA,MAAW,UAAU,OAAA,EAAS;AAC5B,IAAA,OAAA,CAAQ,EAAA,CAAG,QAAQ,YAAY;AAC7B,MAAA,IAAI,YAAA,EAAc;AAClB,MAAA,YAAA,GAAe,IAAA;AAEf,MAAA,IAAI,OAAA,CAAQ,GAAA,CAAI,QAAA,KAAa,MAAA,EAAQ;AACnC,QAAAH,2BAAA,EAAU,CAAE,IAAA;AAAA,UACV,EAAC;AAAA,UACD,sBAAsB,MAAM,CAAA,uBAAA;AAAA,SAC9B;AAAA,MACF;AAEA,MAAA,IAAI;AACF,QAAA,MAAM,QAAA,EAAS;AAAA,MACjB,SAAS,KAAA,EAAO;AACd,QAAAA,2BAAA,EAAU,CAAE,KAAA;AAAA,UACV;AAAA,YACE,GAAA,EAAK,KAAA,YAAiB,KAAA,GAAQ,KAAA,GAAQ;AAAA,WACxC;AAAA,UACA;AAAA,SACF;AAAA,MACF,CAAA,SAAE;AACA,QAAA,OAAA,CAAQ,KAAK,CAAC,CAAA;AAAA,MAChB;AAAA,IACF,CAAC,CAAA;AAAA,EACH;AACF;AAGA,qBAAA,EAAsB","file":"index.cjs","sourcesContent":["/**\n * Graceful shutdown with flush and cleanup\n */\n\nimport { getSdk, getLogger } from './init';\nimport { getEventQueue, resetEventQueue } from './track';\nimport { resetEvents } from './event';\nimport { resetMetrics } from './metric';\n\n/**\n * Flush all pending telemetry\n *\n * Flushes both events events and OpenTelemetry spans to their destinations.\n * Includes timeout protection to prevent hanging in serverless environments.\n *\n * Safe to call multiple times.\n *\n * @param options - Optional configuration\n * @param options.timeout - Timeout in milliseconds (default: 2000ms)\n * @param options.forShutdown - If true, permanently disables the events queue after flush (used internally by shutdown())\n *\n * @example Manual flush in serverless\n * ```typescript\n * import { flush } from 'autotel';\n *\n * export const handler = async (event) => {\n * // ... process event\n * await flush(); // Flush before function returns\n * return result;\n * };\n * ```\n *\n * @example With custom timeout\n * ```typescript\n * await flush({ timeout: 5000 }); // 5 second timeout\n * ```\n */\nexport async function flush(options?: {\n timeout?: number;\n forShutdown?: boolean;\n}): Promise<void> {\n const timeout = options?.timeout ?? 2000;\n const forShutdown = options?.forShutdown ?? false;\n\n const doFlush = async () => {\n // Flush events queue (or shutdown queue when tearing down)\n const eventsQueue = getEventQueue();\n if (eventsQueue) {\n if (forShutdown) {\n await eventsQueue.shutdown();\n } else {\n await eventsQueue.flush();\n }\n }\n\n // Flush OpenTelemetry spans\n // This ensures spans are exported immediately, critical for serverless\n const sdk = getSdk();\n if (sdk) {\n try {\n // Type assertion needed as getTracerProvider is not in the public NodeSDK interface\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const sdkAny = sdk as any;\n if (typeof sdkAny.getTracerProvider === 'function') {\n const tracerProvider = sdkAny.getTracerProvider();\n if (\n tracerProvider &&\n typeof tracerProvider.forceFlush === 'function'\n ) {\n await tracerProvider.forceFlush();\n }\n }\n } catch {\n // Ignore errors when accessing tracer provider (may not be available in test mocks)\n }\n }\n };\n\n // Add timeout protection to prevent hanging\n let timeoutHandle: NodeJS.Timeout | undefined;\n try {\n await Promise.race([\n doFlush().finally(() => {\n // Clear timeout as soon as flush completes\n if (timeoutHandle) {\n clearTimeout(timeoutHandle);\n }\n }),\n new Promise<void>((_, reject) => {\n timeoutHandle = setTimeout(\n () => reject(new Error('Flush timeout')),\n timeout,\n );\n // Use unref() to allow Node to exit if flush completes first\n // This prevents the 2s delay in serverless when flush succeeds immediately\n timeoutHandle.unref();\n }),\n ]);\n } catch (error) {\n // Clear timeout on error too\n if (timeoutHandle) {\n clearTimeout(timeoutHandle);\n }\n const logger = getLogger();\n logger.error(\n {\n err: error instanceof Error ? error : new Error(String(error)),\n },\n '[autotel] Flush error',\n );\n throw error;\n }\n}\n\n/**\n * Shutdown telemetry and cleanup resources\n *\n * - Flushes all pending data\n * - Shuts down OpenTelemetry SDK\n * - Cleans up resources\n *\n * Call this before process exit.\n *\n * Always performs cleanup even if flush fails, preventing resource leaks\n * in serverless handlers or tests.\n *\n * @example Express server\n * ```typescript\n * const server = app.listen(3000)\n *\n * process.on('SIGTERM', async () => {\n * await server.close()\n * await shutdown()\n * process.exit(0)\n * })\n * ```\n */\nexport async function shutdown(): Promise<void> {\n const logger = getLogger();\n let shutdownError: Error | null = null;\n\n // Attempt to flush (with queue shutdown so new events are rejected), but continue with cleanup even if it fails\n try {\n await flush({ forShutdown: true });\n } catch (error) {\n const err = error instanceof Error ? error : new Error(String(error));\n shutdownError = err;\n logger.error(\n {\n err,\n },\n '[autotel] Flush failed during shutdown, continuing cleanup',\n );\n }\n\n // Always shutdown SDK and clean up resources\n try {\n // Shutdown OpenTelemetry SDK\n const sdk = getSdk();\n if (sdk) {\n await sdk.shutdown();\n }\n } catch (error) {\n const err = error instanceof Error ? error : new Error(String(error));\n\n // Ignore ECONNREFUSED errors - this happens when no OTLP endpoint was configured\n // The SDK tries to flush exporters that don't exist, which is harmless\n const isConnectionRefused =\n typeof error === 'object' &&\n error !== null &&\n 'code' in error &&\n error.code === 'ECONNREFUSED';\n\n if (!isConnectionRefused) {\n // Only store/log non-connection errors\n if (!shutdownError) {\n shutdownError = err;\n }\n logger.error({ err }, '[autotel] SDK shutdown failed');\n }\n } finally {\n // Clean up singleton Maps and queues to prevent memory leaks\n // This runs even if SDK shutdown fails\n const eventsQueue = getEventQueue();\n if (eventsQueue && typeof eventsQueue.cleanup === 'function') {\n eventsQueue.cleanup();\n }\n resetEvents();\n resetMetrics();\n resetEventQueue();\n }\n\n // Rethrow first error after cleanup completes\n // This allows tests and CI to detect failures while still ensuring cleanup\n if (shutdownError) {\n throw shutdownError;\n }\n}\n\n/**\n * Register automatic shutdown hooks for common signals\n *\n * Handles:\n * - SIGTERM (Docker/K8s graceful shutdown)\n * - SIGINT (Ctrl+C)\n *\n * @internal Called automatically on module load\n */\nfunction registerShutdownHooks(): void {\n if (typeof process === 'undefined') return; // Not in Node.js\n\n const signals: NodeJS.Signals[] = ['SIGTERM', 'SIGINT'];\n let shuttingDown = false;\n\n for (const signal of signals) {\n process.on(signal, async () => {\n if (shuttingDown) return; // Prevent double shutdown\n shuttingDown = true;\n\n if (process.env.NODE_ENV !== 'test') {\n getLogger().info(\n {},\n `[autotel] Received ${signal}, flushing telemetry...`,\n );\n }\n\n try {\n await shutdown();\n } catch (error) {\n getLogger().error(\n {\n err: error instanceof Error ? error : undefined,\n },\n '[autotel] Error during shutdown',\n );\n } finally {\n process.exit(0);\n }\n });\n }\n}\n\n// Auto-register shutdown hooks\nregisterShutdownHooks();\n"]}
|
package/dist/index.d.cts
CHANGED
|
@@ -16,6 +16,7 @@ export { createCounter, createHistogram, createObservableGauge, createUpDownCoun
|
|
|
16
16
|
export { createDeterministicTraceId, finalizeSpan, flattenMetadata, getActiveContext, getActiveSpan, getTracer, runWithSpan } from './trace-helpers.cjs';
|
|
17
17
|
export { getAutotelTracer, getAutotelTracerProvider, setAutotelTracerProvider } from './tracer-provider.cjs';
|
|
18
18
|
export { DBConfig, HTTPConfig, LLMConfig, MessagingConfig, traceDB, traceHTTP, traceLLM, traceMessaging } from './semantic-helpers.cjs';
|
|
19
|
+
export { HTTPAttributes, ServiceAttributes, URLAttributes, httpRequestHeaderAttribute, httpResponseHeaderAttribute } from './semantic-conventions.cjs';
|
|
19
20
|
export { p as AttributeGuardrails, A as AttributePolicy, J as ClientAttrs, C as CloudAttrs, Q as CodeAttrs, z as ContainerAttrs, t as DBAttrs, L as DeploymentAttrs, D as DeviceAttrs, E as ErrorAttrs, V as ExceptionAttrs, B as FaaSAttrs, F as FeatureFlagAttrs, G as GenAIAttrs, I as GraphQLAttrs, q as HTTPClientAttrs, H as HTTPServerAttrs, K as K8sAttrs, M as MessagingAttrs, N as NetworkAttrs, O as OTelAttrs, P as PeerAttrs, y as ProcessAttrs, R as RPCAttrs, w as ServerAddressAttrs, u as ServiceAttrs, S as SessionAttrs, W as TLSAttrs, T as ThreadAttrs, x as URLAttrs, U as UserAttrs, a as attrs, n as autoRedactPII, e as dbClient, d as httpClient, h as httpServer, i as identify, j as mergeAttrs, m as mergeServiceResource, r as request, k as safeSetAttributes, c as setDevice, f as setError, g as setException, b as setSession, s as setUser, v as validateAttribute } from './utils-DuNJfXSH.cjs';
|
|
20
21
|
export { T as TraceContext, d as defineBaggageSchema } from './trace-context-t5X1AP-e.cjs';
|
|
21
22
|
export { ConsumerConfig, ConsumerContext, LagMetricsConfig, MessagingOperation, MessagingSystem, ProducerConfig, ProducerContext, traceConsumer, traceProducer } from './messaging.cjs';
|
package/dist/index.d.ts
CHANGED
|
@@ -16,6 +16,7 @@ export { createCounter, createHistogram, createObservableGauge, createUpDownCoun
|
|
|
16
16
|
export { createDeterministicTraceId, finalizeSpan, flattenMetadata, getActiveContext, getActiveSpan, getTracer, runWithSpan } from './trace-helpers.js';
|
|
17
17
|
export { getAutotelTracer, getAutotelTracerProvider, setAutotelTracerProvider } from './tracer-provider.js';
|
|
18
18
|
export { DBConfig, HTTPConfig, LLMConfig, MessagingConfig, traceDB, traceHTTP, traceLLM, traceMessaging } from './semantic-helpers.js';
|
|
19
|
+
export { HTTPAttributes, ServiceAttributes, URLAttributes, httpRequestHeaderAttribute, httpResponseHeaderAttribute } from './semantic-conventions.js';
|
|
19
20
|
export { p as AttributeGuardrails, A as AttributePolicy, J as ClientAttrs, C as CloudAttrs, Q as CodeAttrs, z as ContainerAttrs, t as DBAttrs, L as DeploymentAttrs, D as DeviceAttrs, E as ErrorAttrs, V as ExceptionAttrs, B as FaaSAttrs, F as FeatureFlagAttrs, G as GenAIAttrs, I as GraphQLAttrs, q as HTTPClientAttrs, H as HTTPServerAttrs, K as K8sAttrs, M as MessagingAttrs, N as NetworkAttrs, O as OTelAttrs, P as PeerAttrs, y as ProcessAttrs, R as RPCAttrs, w as ServerAddressAttrs, u as ServiceAttrs, S as SessionAttrs, W as TLSAttrs, T as ThreadAttrs, x as URLAttrs, U as UserAttrs, a as attrs, n as autoRedactPII, e as dbClient, d as httpClient, h as httpServer, i as identify, j as mergeAttrs, m as mergeServiceResource, r as request, k as safeSetAttributes, c as setDevice, f as setError, g as setException, b as setSession, s as setUser, v as validateAttribute } from './utils-D1trOLNm.js';
|
|
20
21
|
export { T as TraceContext, d as defineBaggageSchema } from './trace-context-t5X1AP-e.js';
|
|
21
22
|
export { ConsumerConfig, ConsumerContext, LagMetricsConfig, MessagingOperation, MessagingSystem, ProducerConfig, ProducerContext, traceConsumer, traceProducer } from './messaging.js';
|
package/dist/index.js
CHANGED
|
@@ -1,14 +1,16 @@
|
|
|
1
|
-
export { getCurrentWorkflowContext, isInWorkflow, traceStep, traceWorkflow } from './chunk-
|
|
2
|
-
export { attrs, autoRedactPII, dbClient, httpClient, httpServer, identify, mergeAttrs, mergeServiceResource, request, safeSetAttributes, setDevice, setError, setException, setSession, setUser, validateAttribute } from './chunk-
|
|
3
|
-
export {
|
|
1
|
+
export { getCurrentWorkflowContext, isInWorkflow, traceStep, traceWorkflow } from './chunk-LCMARHLX.js';
|
|
2
|
+
export { attrs, autoRedactPII, dbClient, httpClient, httpServer, identify, mergeAttrs, mergeServiceResource, request, safeSetAttributes, setDevice, setError, setException, setSession, setUser, validateAttribute } from './chunk-M4US3P4K.js';
|
|
3
|
+
export { httpRequestHeaderAttribute, httpResponseHeaderAttribute } from './chunk-7552UTQW.js';
|
|
4
|
+
export { HTTPAttributes, ServiceAttributes, URLAttributes } from './chunk-4A53YIAX.js';
|
|
5
|
+
export { traceConsumer, traceProducer } from './chunk-XBVB3AFF.js';
|
|
4
6
|
export { BusinessBaggage, createSafeBaggageSchema } from './chunk-4IFSYQVX.js';
|
|
5
7
|
import { resetMetrics } from './chunk-7SAWIN74.js';
|
|
6
8
|
export { Metric, getMetrics, resetMetrics } from './chunk-7SAWIN74.js';
|
|
7
9
|
import './chunk-5ZN622AO.js';
|
|
8
10
|
export { createCounter, createHistogram, createObservableGauge, createUpDownCounter, getMeter } from './chunk-TQ5UWA7S.js';
|
|
9
|
-
export { traceDB, traceHTTP, traceLLM, traceMessaging } from './chunk-
|
|
10
|
-
import { getEventQueue, resetEventQueue } from './chunk-
|
|
11
|
-
export { ctx, getEventQueue, instrument, span, trace, track, withBaggage, withNewContext, withTracing } from './chunk-
|
|
11
|
+
export { traceDB, traceHTTP, traceLLM, traceMessaging } from './chunk-5JLXDCL2.js';
|
|
12
|
+
import { getEventQueue, resetEventQueue } from './chunk-G47ZCJGW.js';
|
|
13
|
+
export { ctx, getEventQueue, instrument, span, trace, track, withBaggage, withNewContext, withTracing } from './chunk-G47ZCJGW.js';
|
|
12
14
|
export { defineBaggageSchema } from './chunk-SR35DG5A.js';
|
|
13
15
|
export { createDeterministicTraceId, finalizeSpan, flattenMetadata, getActiveContext, getActiveSpan, getTracer, runWithSpan } from './chunk-HJPXNUZR.js';
|
|
14
16
|
import { resetEvents } from './chunk-PAVYKPCQ.js';
|