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.
Files changed (67) hide show
  1. package/dist/attributes.cjs +21 -20
  2. package/dist/attributes.js +2 -1
  3. package/dist/chunk-2ZKEORFN.cjs +14 -0
  4. package/dist/chunk-2ZKEORFN.cjs.map +1 -0
  5. package/dist/chunk-4A53YIAX.js +180 -0
  6. package/dist/chunk-4A53YIAX.js.map +1 -0
  7. package/dist/{chunk-QKVQWGTF.js → chunk-5JLXDCL2.js} +3 -3
  8. package/dist/{chunk-QKVQWGTF.js.map → chunk-5JLXDCL2.js.map} +1 -1
  9. package/dist/chunk-7552UTQW.js +11 -0
  10. package/dist/chunk-7552UTQW.js.map +1 -0
  11. package/dist/{chunk-NWT5SYOX.cjs → chunk-BEVIAKTB.cjs} +5 -5
  12. package/dist/{chunk-NWT5SYOX.cjs.map → chunk-BEVIAKTB.cjs.map} +1 -1
  13. package/dist/chunk-ESMHTKLJ.cjs +206 -0
  14. package/dist/chunk-ESMHTKLJ.cjs.map +1 -0
  15. package/dist/{chunk-QP5LVD4L.js → chunk-G47ZCJGW.js} +25 -3
  16. package/dist/{chunk-QP5LVD4L.js.map → chunk-G47ZCJGW.js.map} +1 -1
  17. package/dist/{chunk-WC2AMGBX.js → chunk-LCMARHLX.js} +3 -3
  18. package/dist/{chunk-WC2AMGBX.js.map → chunk-LCMARHLX.js.map} +1 -1
  19. package/dist/{chunk-HZ23L5KR.cjs → chunk-LGT7XA5O.cjs} +5 -5
  20. package/dist/{chunk-HZ23L5KR.cjs.map → chunk-LGT7XA5O.cjs.map} +1 -1
  21. package/dist/{chunk-4HPWUYCV.js → chunk-M4US3P4K.js} +3 -170
  22. package/dist/chunk-M4US3P4K.js.map +1 -0
  23. package/dist/{chunk-FMPBL2NF.js → chunk-XBVB3AFF.js} +3 -3
  24. package/dist/{chunk-FMPBL2NF.js.map → chunk-XBVB3AFF.js.map} +1 -1
  25. package/dist/{chunk-DWRTSOGR.cjs → chunk-XI5WPVR5.cjs} +25 -3
  26. package/dist/chunk-XI5WPVR5.cjs.map +1 -0
  27. package/dist/{chunk-74L5DOB4.cjs → chunk-XNBTEFRZ.cjs} +7 -7
  28. package/dist/{chunk-74L5DOB4.cjs.map → chunk-XNBTEFRZ.cjs.map} +1 -1
  29. package/dist/chunk-XRBP4RYL.cjs +764 -0
  30. package/dist/chunk-XRBP4RYL.cjs.map +1 -0
  31. package/dist/decorators.cjs +1 -1
  32. package/dist/decorators.js +1 -1
  33. package/dist/functional.cjs +8 -8
  34. package/dist/functional.js +1 -1
  35. package/dist/index.cjs +65 -43
  36. package/dist/index.cjs.map +1 -1
  37. package/dist/index.d.cts +1 -0
  38. package/dist/index.d.ts +1 -0
  39. package/dist/index.js +8 -6
  40. package/dist/index.js.map +1 -1
  41. package/dist/messaging.cjs +5 -5
  42. package/dist/messaging.js +2 -2
  43. package/dist/semantic-conventions.cjs +30 -0
  44. package/dist/semantic-conventions.cjs.map +1 -0
  45. package/dist/semantic-conventions.d.cts +29 -0
  46. package/dist/semantic-conventions.d.ts +29 -0
  47. package/dist/semantic-conventions.js +5 -0
  48. package/dist/semantic-conventions.js.map +1 -0
  49. package/dist/semantic-helpers.cjs +6 -6
  50. package/dist/semantic-helpers.js +2 -2
  51. package/dist/webhook.cjs +2 -2
  52. package/dist/webhook.js +1 -1
  53. package/dist/workflow-distributed.cjs +3 -3
  54. package/dist/workflow-distributed.js +1 -1
  55. package/dist/workflow.cjs +6 -6
  56. package/dist/workflow.js +2 -2
  57. package/package.json +16 -11
  58. package/src/decorators.test.ts +22 -72
  59. package/src/functional.test.ts +24 -6
  60. package/src/functional.ts +37 -2
  61. package/src/index.ts +9 -0
  62. package/src/init.openllmetry.test.ts +76 -76
  63. package/src/semantic-conventions.ts +15 -0
  64. package/dist/chunk-4HPWUYCV.js.map +0 -1
  65. package/dist/chunk-7F4PDILZ.cjs +0 -931
  66. package/dist/chunk-7F4PDILZ.cjs.map +0 -1
  67. package/dist/chunk-DWRTSOGR.cjs.map +0 -1
@@ -0,0 +1,764 @@
1
+ 'use strict';
2
+
3
+ var chunkESMHTKLJ_cjs = require('./chunk-ESMHTKLJ.cjs');
4
+ var chunkELW34S4C_cjs = require('./chunk-ELW34S4C.cjs');
5
+ var resources = require('@opentelemetry/resources');
6
+
7
+ // src/attributes/builders.ts
8
+ var attrs = {
9
+ user: {
10
+ id: (value) => ({ [chunkESMHTKLJ_cjs.UserAttributes.id]: value }),
11
+ email: (value) => ({ [chunkESMHTKLJ_cjs.UserAttributes.email]: value }),
12
+ name: (value) => ({ [chunkESMHTKLJ_cjs.UserAttributes.name]: value }),
13
+ fullName: (value) => ({ [chunkESMHTKLJ_cjs.UserAttributes.fullName]: value }),
14
+ hash: (value) => ({ [chunkESMHTKLJ_cjs.UserAttributes.hash]: value }),
15
+ roles: (value) => ({ [chunkESMHTKLJ_cjs.UserAttributes.roles]: value }),
16
+ data: (data) => {
17
+ const result = {};
18
+ if (data.id !== void 0) result[chunkESMHTKLJ_cjs.UserAttributes.id] = data.id;
19
+ if (data.email !== void 0) result[chunkESMHTKLJ_cjs.UserAttributes.email] = data.email;
20
+ if (data.name !== void 0) result[chunkESMHTKLJ_cjs.UserAttributes.name] = data.name;
21
+ if (data.fullName !== void 0)
22
+ result[chunkESMHTKLJ_cjs.UserAttributes.fullName] = data.fullName;
23
+ if (data.hash !== void 0) result[chunkESMHTKLJ_cjs.UserAttributes.hash] = data.hash;
24
+ if (data.roles !== void 0) result[chunkESMHTKLJ_cjs.UserAttributes.roles] = data.roles;
25
+ return result;
26
+ }
27
+ },
28
+ session: {
29
+ id: (value) => ({ [chunkESMHTKLJ_cjs.SessionAttributes.id]: value }),
30
+ previousId: (value) => ({ [chunkESMHTKLJ_cjs.SessionAttributes.previousId]: value }),
31
+ data: (data) => {
32
+ const result = {};
33
+ if (data.id !== void 0) result[chunkESMHTKLJ_cjs.SessionAttributes.id] = data.id;
34
+ if (data.previousId !== void 0)
35
+ result[chunkESMHTKLJ_cjs.SessionAttributes.previousId] = data.previousId;
36
+ return result;
37
+ }
38
+ },
39
+ device: {
40
+ id: (value) => ({ [chunkESMHTKLJ_cjs.DeviceAttributes.id]: value }),
41
+ manufacturer: (value) => ({
42
+ [chunkESMHTKLJ_cjs.DeviceAttributes.manufacturer]: value
43
+ }),
44
+ modelIdentifier: (value) => ({
45
+ [chunkESMHTKLJ_cjs.DeviceAttributes.modelIdentifier]: value
46
+ }),
47
+ modelName: (value) => ({ [chunkESMHTKLJ_cjs.DeviceAttributes.modelName]: value }),
48
+ data: (data) => {
49
+ const result = {};
50
+ if (data.id !== void 0) result[chunkESMHTKLJ_cjs.DeviceAttributes.id] = data.id;
51
+ if (data.manufacturer !== void 0)
52
+ result[chunkESMHTKLJ_cjs.DeviceAttributes.manufacturer] = data.manufacturer;
53
+ if (data.modelIdentifier !== void 0)
54
+ result[chunkESMHTKLJ_cjs.DeviceAttributes.modelIdentifier] = data.modelIdentifier;
55
+ if (data.modelName !== void 0)
56
+ result[chunkESMHTKLJ_cjs.DeviceAttributes.modelName] = data.modelName;
57
+ return result;
58
+ }
59
+ },
60
+ http: {
61
+ request: {
62
+ method: (value) => ({ [chunkESMHTKLJ_cjs.HTTPAttributes.requestMethod]: value }),
63
+ methodOriginal: (value) => ({
64
+ [chunkESMHTKLJ_cjs.HTTPAttributes.requestMethodOriginal]: value
65
+ }),
66
+ resendCount: (value) => ({
67
+ [chunkESMHTKLJ_cjs.HTTPAttributes.requestResendCount]: value
68
+ }),
69
+ size: (value) => ({ [chunkESMHTKLJ_cjs.HTTPAttributes.requestSize]: value }),
70
+ bodySize: (value) => ({
71
+ [chunkESMHTKLJ_cjs.HTTPAttributes.requestBodySize]: value
72
+ })
73
+ },
74
+ response: {
75
+ statusCode: (value) => ({
76
+ [chunkESMHTKLJ_cjs.HTTPAttributes.responseStatusCode]: value
77
+ }),
78
+ size: (value) => ({ [chunkESMHTKLJ_cjs.HTTPAttributes.responseSize]: value }),
79
+ bodySize: (value) => ({
80
+ [chunkESMHTKLJ_cjs.HTTPAttributes.responseBodySize]: value
81
+ })
82
+ },
83
+ route: (value) => ({ [chunkESMHTKLJ_cjs.HTTPAttributes.route]: value }),
84
+ connectionState: (value) => ({
85
+ [chunkESMHTKLJ_cjs.HTTPAttributes.connectionState]: value
86
+ }),
87
+ server: (data) => {
88
+ const result = {};
89
+ if (data.method !== void 0)
90
+ result[chunkESMHTKLJ_cjs.HTTPAttributes.requestMethod] = data.method;
91
+ if (data.route !== void 0) result[chunkESMHTKLJ_cjs.HTTPAttributes.route] = data.route;
92
+ if (data.statusCode !== void 0)
93
+ result[chunkESMHTKLJ_cjs.HTTPAttributes.responseStatusCode] = data.statusCode;
94
+ if (data.bodySize !== void 0)
95
+ result[chunkESMHTKLJ_cjs.HTTPAttributes.requestBodySize] = data.bodySize;
96
+ if (data.requestSize !== void 0)
97
+ result[chunkESMHTKLJ_cjs.HTTPAttributes.requestSize] = data.requestSize;
98
+ if (data.responseSize !== void 0)
99
+ result[chunkESMHTKLJ_cjs.HTTPAttributes.responseSize] = data.responseSize;
100
+ if (data.resendCount !== void 0)
101
+ result[chunkESMHTKLJ_cjs.HTTPAttributes.requestResendCount] = data.resendCount;
102
+ return result;
103
+ },
104
+ client: (data) => {
105
+ const result = {};
106
+ if (data.method !== void 0)
107
+ result[chunkESMHTKLJ_cjs.HTTPAttributes.requestMethod] = data.method;
108
+ if (data.url !== void 0) result[chunkESMHTKLJ_cjs.HTTPAttributes.route] = data.url;
109
+ if (data.statusCode !== void 0)
110
+ result[chunkESMHTKLJ_cjs.HTTPAttributes.responseStatusCode] = data.statusCode;
111
+ return result;
112
+ }
113
+ },
114
+ db: {
115
+ client: {
116
+ system: (value) => ({ [chunkESMHTKLJ_cjs.DBAttributes.systemName]: value }),
117
+ operation: (value) => ({ [chunkESMHTKLJ_cjs.DBAttributes.operationName]: value }),
118
+ collectionName: (value) => ({
119
+ [chunkESMHTKLJ_cjs.DBAttributes.collectionName]: value
120
+ }),
121
+ namespace: (value) => ({ [chunkESMHTKLJ_cjs.DBAttributes.namespace]: value }),
122
+ statement: (value) => ({ [chunkESMHTKLJ_cjs.DBAttributes.statement]: value }),
123
+ querySummary: (value) => ({ [chunkESMHTKLJ_cjs.DBAttributes.querySummary]: value }),
124
+ queryText: (value) => ({ [chunkESMHTKLJ_cjs.DBAttributes.queryText]: value }),
125
+ responseStatus: (value) => ({
126
+ [chunkESMHTKLJ_cjs.DBAttributes.responseStatusCode]: value
127
+ }),
128
+ rowsReturned: (value) => ({
129
+ [chunkESMHTKLJ_cjs.DBAttributes.responseReturnedRows]: value
130
+ }),
131
+ data: (data) => {
132
+ const result = {};
133
+ if (data.system !== void 0)
134
+ result[chunkESMHTKLJ_cjs.DBAttributes.systemName] = data.system;
135
+ if (data.operation !== void 0)
136
+ result[chunkESMHTKLJ_cjs.DBAttributes.operationName] = data.operation;
137
+ if (data.collectionName !== void 0)
138
+ result[chunkESMHTKLJ_cjs.DBAttributes.collectionName] = data.collectionName;
139
+ if (data.name !== void 0) result[chunkESMHTKLJ_cjs.DBAttributes.namespace] = data.name;
140
+ if (data.namespace !== void 0)
141
+ result[chunkESMHTKLJ_cjs.DBAttributes.namespace] = data.namespace;
142
+ if (data.statement !== void 0)
143
+ result[chunkESMHTKLJ_cjs.DBAttributes.statement] = data.statement;
144
+ if (data.querySummary !== void 0)
145
+ result[chunkESMHTKLJ_cjs.DBAttributes.querySummary] = data.querySummary;
146
+ if (data.queryText !== void 0)
147
+ result[chunkESMHTKLJ_cjs.DBAttributes.queryText] = data.queryText;
148
+ if (data.responseStatus !== void 0)
149
+ result[chunkESMHTKLJ_cjs.DBAttributes.responseStatusCode] = data.responseStatus;
150
+ if (data.rowsReturned !== void 0)
151
+ result[chunkESMHTKLJ_cjs.DBAttributes.responseReturnedRows] = data.rowsReturned;
152
+ return result;
153
+ }
154
+ }
155
+ },
156
+ service: {
157
+ name: (value) => ({ [chunkESMHTKLJ_cjs.ServiceAttributes.name]: value }),
158
+ instance: (value) => ({ [chunkESMHTKLJ_cjs.ServiceAttributes.instance]: value }),
159
+ version: (value) => ({ [chunkESMHTKLJ_cjs.ServiceAttributes.version]: value }),
160
+ data: (data) => {
161
+ const result = {};
162
+ if (data.name !== void 0) result[chunkESMHTKLJ_cjs.ServiceAttributes.name] = data.name;
163
+ if (data.instance !== void 0)
164
+ result[chunkESMHTKLJ_cjs.ServiceAttributes.instance] = data.instance;
165
+ if (data.version !== void 0)
166
+ result[chunkESMHTKLJ_cjs.ServiceAttributes.version] = data.version;
167
+ return result;
168
+ }
169
+ },
170
+ network: {
171
+ peerAddress: (value) => ({
172
+ [chunkESMHTKLJ_cjs.NetworkAttributes.peerAddress]: value
173
+ }),
174
+ peerPort: (value) => ({ [chunkESMHTKLJ_cjs.NetworkAttributes.peerPort]: value }),
175
+ transport: (value) => ({ [chunkESMHTKLJ_cjs.NetworkAttributes.transport]: value }),
176
+ protocolName: (value) => ({
177
+ [chunkESMHTKLJ_cjs.NetworkAttributes.protocolName]: value
178
+ }),
179
+ protocolVersion: (value) => ({
180
+ [chunkESMHTKLJ_cjs.NetworkAttributes.protocolVersion]: value
181
+ }),
182
+ data: (data) => {
183
+ const result = {};
184
+ if (data.peerAddress !== void 0)
185
+ result[chunkESMHTKLJ_cjs.NetworkAttributes.peerAddress] = data.peerAddress;
186
+ if (data.peerPort !== void 0)
187
+ result[chunkESMHTKLJ_cjs.NetworkAttributes.peerPort] = data.peerPort;
188
+ if (data.transport !== void 0)
189
+ result[chunkESMHTKLJ_cjs.NetworkAttributes.transport] = data.transport;
190
+ if (data.protocolName !== void 0)
191
+ result[chunkESMHTKLJ_cjs.NetworkAttributes.protocolName] = data.protocolName;
192
+ if (data.protocolVersion !== void 0)
193
+ result[chunkESMHTKLJ_cjs.NetworkAttributes.protocolVersion] = data.protocolVersion;
194
+ return result;
195
+ }
196
+ },
197
+ server: {
198
+ address: (value) => ({ [chunkESMHTKLJ_cjs.ServerAddressAttributes.address]: value }),
199
+ port: (value) => ({ [chunkESMHTKLJ_cjs.ServerAddressAttributes.port]: value }),
200
+ socketAddress: (value) => ({
201
+ [chunkESMHTKLJ_cjs.ServerAddressAttributes.socketAddress]: value
202
+ }),
203
+ data: (data) => {
204
+ const result = {};
205
+ if (data.address !== void 0)
206
+ result[chunkESMHTKLJ_cjs.ServerAddressAttributes.address] = data.address;
207
+ if (data.port !== void 0)
208
+ result[chunkESMHTKLJ_cjs.ServerAddressAttributes.port] = data.port;
209
+ if (data.socketAddress !== void 0)
210
+ result[chunkESMHTKLJ_cjs.ServerAddressAttributes.socketAddress] = data.socketAddress;
211
+ return result;
212
+ }
213
+ },
214
+ url: {
215
+ scheme: (value) => ({ [chunkESMHTKLJ_cjs.URLAttributes.scheme]: value }),
216
+ full: (value) => ({ [chunkESMHTKLJ_cjs.URLAttributes.full]: value }),
217
+ path: (value) => ({ [chunkESMHTKLJ_cjs.URLAttributes.path]: value }),
218
+ query: (value) => ({ [chunkESMHTKLJ_cjs.URLAttributes.query]: value }),
219
+ fragment: (value) => ({ [chunkESMHTKLJ_cjs.URLAttributes.fragment]: value }),
220
+ data: (data) => {
221
+ const result = {};
222
+ if (data.scheme !== void 0) result[chunkESMHTKLJ_cjs.URLAttributes.scheme] = data.scheme;
223
+ if (data.full !== void 0) result[chunkESMHTKLJ_cjs.URLAttributes.full] = data.full;
224
+ if (data.path !== void 0) result[chunkESMHTKLJ_cjs.URLAttributes.path] = data.path;
225
+ if (data.query !== void 0) result[chunkESMHTKLJ_cjs.URLAttributes.query] = data.query;
226
+ if (data.fragment !== void 0)
227
+ result[chunkESMHTKLJ_cjs.URLAttributes.fragment] = data.fragment;
228
+ return result;
229
+ }
230
+ },
231
+ error: {
232
+ type: (value) => ({ [chunkESMHTKLJ_cjs.ErrorAttributes.type]: value }),
233
+ message: (value) => ({ [chunkESMHTKLJ_cjs.ErrorAttributes.message]: value }),
234
+ stackTrace: (value) => ({ [chunkESMHTKLJ_cjs.ErrorAttributes.stackTrace]: value }),
235
+ code: (value) => ({ [chunkESMHTKLJ_cjs.ErrorAttributes.code]: value }),
236
+ data: (data) => {
237
+ const result = {};
238
+ if (data.type !== void 0) result[chunkESMHTKLJ_cjs.ErrorAttributes.type] = data.type;
239
+ if (data.message !== void 0)
240
+ result[chunkESMHTKLJ_cjs.ErrorAttributes.message] = data.message;
241
+ if (data.stackTrace !== void 0)
242
+ result[chunkESMHTKLJ_cjs.ErrorAttributes.stackTrace] = data.stackTrace;
243
+ if (data.code !== void 0) result[chunkESMHTKLJ_cjs.ErrorAttributes.code] = data.code;
244
+ return result;
245
+ }
246
+ },
247
+ exception: {
248
+ escaped: (value) => ({ [chunkESMHTKLJ_cjs.ExceptionAttributes.escaped]: value }),
249
+ message: (value) => ({ [chunkESMHTKLJ_cjs.ExceptionAttributes.message]: value }),
250
+ stackTrace: (value) => ({
251
+ [chunkESMHTKLJ_cjs.ExceptionAttributes.stackTrace]: value
252
+ }),
253
+ type: (value) => ({ [chunkESMHTKLJ_cjs.ExceptionAttributes.type]: value }),
254
+ moduleName: (value) => ({
255
+ [chunkESMHTKLJ_cjs.ExceptionAttributes.moduleName]: value
256
+ }),
257
+ data: (data) => {
258
+ const result = {};
259
+ if (data.escaped !== void 0)
260
+ result[chunkESMHTKLJ_cjs.ExceptionAttributes.escaped] = data.escaped;
261
+ if (data.message !== void 0)
262
+ result[chunkESMHTKLJ_cjs.ExceptionAttributes.message] = data.message;
263
+ if (data.stackTrace !== void 0)
264
+ result[chunkESMHTKLJ_cjs.ExceptionAttributes.stackTrace] = data.stackTrace;
265
+ if (data.type !== void 0) result[chunkESMHTKLJ_cjs.ExceptionAttributes.type] = data.type;
266
+ if (data.moduleName !== void 0)
267
+ result[chunkESMHTKLJ_cjs.ExceptionAttributes.moduleName] = data.moduleName;
268
+ return result;
269
+ }
270
+ },
271
+ process: {
272
+ pid: (value) => ({ [chunkESMHTKLJ_cjs.ProcessAttributes.pid]: value }),
273
+ executablePath: (value) => ({
274
+ [chunkESMHTKLJ_cjs.ProcessAttributes.executablePath]: value
275
+ }),
276
+ command: (value) => ({ [chunkESMHTKLJ_cjs.ProcessAttributes.command]: value }),
277
+ owner: (value) => ({ [chunkESMHTKLJ_cjs.ProcessAttributes.owner]: value }),
278
+ data: (data) => {
279
+ const result = {};
280
+ if (data.pid !== void 0) result[chunkESMHTKLJ_cjs.ProcessAttributes.pid] = data.pid;
281
+ if (data.executablePath !== void 0)
282
+ result[chunkESMHTKLJ_cjs.ProcessAttributes.executablePath] = data.executablePath;
283
+ if (data.command !== void 0)
284
+ result[chunkESMHTKLJ_cjs.ProcessAttributes.command] = data.command;
285
+ if (data.owner !== void 0)
286
+ result[chunkESMHTKLJ_cjs.ProcessAttributes.owner] = data.owner;
287
+ return result;
288
+ }
289
+ },
290
+ thread: {
291
+ id: (value) => ({ [chunkESMHTKLJ_cjs.ThreadAttributes.id]: value }),
292
+ name: (value) => ({ [chunkESMHTKLJ_cjs.ThreadAttributes.name]: value })
293
+ },
294
+ container: {
295
+ id: (value) => ({ [chunkESMHTKLJ_cjs.ContainerAttributes.id]: value }),
296
+ name: (value) => ({ [chunkESMHTKLJ_cjs.ContainerAttributes.name]: value }),
297
+ image: (value) => ({ [chunkESMHTKLJ_cjs.ContainerAttributes.image]: value }),
298
+ tag: (value) => ({ [chunkESMHTKLJ_cjs.ContainerAttributes.tag]: value }),
299
+ data: (data) => {
300
+ const result = {};
301
+ if (data.id !== void 0) result[chunkESMHTKLJ_cjs.ContainerAttributes.id] = data.id;
302
+ if (data.name !== void 0) result[chunkESMHTKLJ_cjs.ContainerAttributes.name] = data.name;
303
+ if (data.image !== void 0)
304
+ result[chunkESMHTKLJ_cjs.ContainerAttributes.image] = data.image;
305
+ if (data.tag !== void 0) result[chunkESMHTKLJ_cjs.ContainerAttributes.tag] = data.tag;
306
+ return result;
307
+ }
308
+ },
309
+ k8s: {
310
+ podName: (value) => ({ [chunkESMHTKLJ_cjs.K8sAttributes.podName]: value }),
311
+ namespaceName: (value) => ({
312
+ [chunkESMHTKLJ_cjs.K8sAttributes.namespaceName]: value
313
+ }),
314
+ deploymentName: (value) => ({
315
+ [chunkESMHTKLJ_cjs.K8sAttributes.deploymentName]: value
316
+ }),
317
+ state: (value) => ({ [chunkESMHTKLJ_cjs.K8sAttributes.state]: value })
318
+ },
319
+ cloud: {
320
+ provider: (value) => ({ [chunkESMHTKLJ_cjs.CloudAttributes.provider]: value }),
321
+ accountId: (value) => ({ [chunkESMHTKLJ_cjs.CloudAttributes.accountId]: value }),
322
+ region: (value) => ({ [chunkESMHTKLJ_cjs.CloudAttributes.region]: value }),
323
+ availabilityZone: (value) => ({
324
+ [chunkESMHTKLJ_cjs.CloudAttributes.availabilityZone]: value
325
+ }),
326
+ platform: (value) => ({ [chunkESMHTKLJ_cjs.CloudAttributes.platform]: value }),
327
+ data: (data) => {
328
+ const result = {};
329
+ if (data.provider !== void 0)
330
+ result[chunkESMHTKLJ_cjs.CloudAttributes.provider] = data.provider;
331
+ if (data.accountId !== void 0)
332
+ result[chunkESMHTKLJ_cjs.CloudAttributes.accountId] = data.accountId;
333
+ if (data.region !== void 0)
334
+ result[chunkESMHTKLJ_cjs.CloudAttributes.region] = data.region;
335
+ if (data.availabilityZone !== void 0)
336
+ result[chunkESMHTKLJ_cjs.CloudAttributes.availabilityZone] = data.availabilityZone;
337
+ if (data.platform !== void 0)
338
+ result[chunkESMHTKLJ_cjs.CloudAttributes.platform] = data.platform;
339
+ return result;
340
+ }
341
+ },
342
+ faas: {
343
+ name: (value) => ({ [chunkESMHTKLJ_cjs.FaaSAttributes.name]: value }),
344
+ version: (value) => ({ [chunkESMHTKLJ_cjs.FaaSAttributes.version]: value }),
345
+ instance: (value) => ({ [chunkESMHTKLJ_cjs.FaaSAttributes.instance]: value }),
346
+ execution: (value) => ({ [chunkESMHTKLJ_cjs.FaaSAttributes.execution]: value }),
347
+ coldstart: (value) => ({ [chunkESMHTKLJ_cjs.FaaSAttributes.coldstart]: value })
348
+ },
349
+ featureFlag: {
350
+ key: (value) => ({ [chunkESMHTKLJ_cjs.FeatureFlagAttributes.key]: value }),
351
+ provider: (value) => ({ [chunkESMHTKLJ_cjs.FeatureFlagAttributes.provider]: value }),
352
+ variant: (value) => ({ [chunkESMHTKLJ_cjs.FeatureFlagAttributes.variant]: value })
353
+ },
354
+ messaging: {
355
+ system: (value) => ({ [chunkESMHTKLJ_cjs.MessagingAttributes.system]: value }),
356
+ destination: (value) => ({
357
+ [chunkESMHTKLJ_cjs.MessagingAttributes.destination]: value
358
+ }),
359
+ operation: (value) => ({
360
+ [chunkESMHTKLJ_cjs.MessagingAttributes.operation]: value
361
+ }),
362
+ messageId: (value) => ({ [chunkESMHTKLJ_cjs.MessagingAttributes.messageId]: value }),
363
+ conversationId: (value) => ({
364
+ [chunkESMHTKLJ_cjs.MessagingAttributes.conversationId]: value
365
+ }),
366
+ data: (data) => {
367
+ const result = {};
368
+ if (data.system !== void 0)
369
+ result[chunkESMHTKLJ_cjs.MessagingAttributes.system] = data.system;
370
+ if (data.destination !== void 0)
371
+ result[chunkESMHTKLJ_cjs.MessagingAttributes.destination] = data.destination;
372
+ if (data.operation !== void 0)
373
+ result[chunkESMHTKLJ_cjs.MessagingAttributes.operation] = data.operation;
374
+ if (data.messageId !== void 0)
375
+ result[chunkESMHTKLJ_cjs.MessagingAttributes.messageId] = data.messageId;
376
+ if (data.conversationId !== void 0)
377
+ result[chunkESMHTKLJ_cjs.MessagingAttributes.conversationId] = data.conversationId;
378
+ return result;
379
+ }
380
+ },
381
+ genAI: {
382
+ system: (value) => ({ [chunkESMHTKLJ_cjs.GenAIAttributes.system]: value }),
383
+ requestModel: (value) => ({
384
+ [chunkESMHTKLJ_cjs.GenAIAttributes.requestModel]: value
385
+ }),
386
+ responseModel: (value) => ({
387
+ [chunkESMHTKLJ_cjs.GenAIAttributes.responseModel]: value
388
+ }),
389
+ operationName: (value) => ({
390
+ [chunkESMHTKLJ_cjs.GenAIAttributes.operationName]: value
391
+ }),
392
+ usagePromptTokens: (value) => ({
393
+ [chunkESMHTKLJ_cjs.GenAIAttributes.usagePromptTokens]: value
394
+ }),
395
+ usageCompletionTokens: (value) => ({
396
+ [chunkESMHTKLJ_cjs.GenAIAttributes.usageCompletionTokens]: value
397
+ }),
398
+ provider: (value) => ({ [chunkESMHTKLJ_cjs.GenAIAttributes.provider]: value })
399
+ },
400
+ rpc: {
401
+ system: (value) => ({ [chunkESMHTKLJ_cjs.RPCAttributes.system]: value }),
402
+ service: (value) => ({ [chunkESMHTKLJ_cjs.RPCAttributes.service]: value }),
403
+ method: (value) => ({ [chunkESMHTKLJ_cjs.RPCAttributes.method]: value }),
404
+ grpcStatusCode: (value) => ({
405
+ [chunkESMHTKLJ_cjs.RPCAttributes.grpcStatusCode]: value
406
+ })
407
+ },
408
+ graphql: {
409
+ document: (value) => ({ [chunkESMHTKLJ_cjs.GraphQLAttributes.document]: value }),
410
+ operationName: (value) => ({
411
+ [chunkESMHTKLJ_cjs.GraphQLAttributes.operationName]: value
412
+ }),
413
+ operationType: (value) => ({
414
+ [chunkESMHTKLJ_cjs.GraphQLAttributes.operationType]: value
415
+ })
416
+ },
417
+ otel: {
418
+ libraryName: (value) => ({ [chunkESMHTKLJ_cjs.OTelAttributes.libraryName]: value }),
419
+ libraryVersion: (value) => ({
420
+ [chunkESMHTKLJ_cjs.OTelAttributes.libraryVersion]: value
421
+ }),
422
+ statusCode: (value) => ({ [chunkESMHTKLJ_cjs.OTelAttributes.statusCode]: value })
423
+ },
424
+ code: {
425
+ namespace: (value) => ({ [chunkESMHTKLJ_cjs.CodeAttributes.namespace]: value }),
426
+ filepath: (value) => ({ [chunkESMHTKLJ_cjs.CodeAttributes.filepath]: value }),
427
+ function: (value) => ({ [chunkESMHTKLJ_cjs.CodeAttributes.function]: value }),
428
+ class: (value) => ({ [chunkESMHTKLJ_cjs.CodeAttributes.class]: value }),
429
+ method: (value) => ({ [chunkESMHTKLJ_cjs.CodeAttributes.method]: value }),
430
+ column: (value) => ({ [chunkESMHTKLJ_cjs.CodeAttributes.column]: value }),
431
+ lineNumber: (value) => ({ [chunkESMHTKLJ_cjs.CodeAttributes.lineNumber]: value }),
432
+ repository: (value) => ({ [chunkESMHTKLJ_cjs.CodeAttributes.repository]: value }),
433
+ revision: (value) => ({ [chunkESMHTKLJ_cjs.CodeAttributes.revision]: value })
434
+ },
435
+ tls: {
436
+ protocolVersion: (value) => ({
437
+ [chunkESMHTKLJ_cjs.TLSAttributes.protocolVersion]: value
438
+ }),
439
+ cipher: (value) => ({ [chunkESMHTKLJ_cjs.TLSAttributes.cipher]: value }),
440
+ curveName: (value) => ({ [chunkESMHTKLJ_cjs.TLSAttributes.curveName]: value }),
441
+ resumed: (value) => ({ [chunkESMHTKLJ_cjs.TLSAttributes.resumed]: value })
442
+ }
443
+ };
444
+
445
+ // src/attributes/validators.ts
446
+ var DEPRECATED_ATTRIBUTES = {
447
+ "enduser.id": "user.id",
448
+ "enduser.role": "user.roles",
449
+ "enduser.scope": void 0,
450
+ "http.method": "http.request.method",
451
+ "http.host": "server.address",
452
+ "http.status_code": "http.response.status_code",
453
+ "http.target": "url.path",
454
+ "http.url": "url.full",
455
+ "http.user_agent": "user_agent.original",
456
+ "http.flavor": "network.protocol.name",
457
+ "http.scheme": "url.scheme",
458
+ "http.server_name": "server.address",
459
+ "db.name": "db.namespace",
460
+ "db.operation": "db.operation.name",
461
+ "db.statement": "db.query.text",
462
+ "db.system": "db.system.name",
463
+ "db.collection": "db.collection.name",
464
+ "db.instance.id": void 0,
465
+ "db.jdbc.driver_classname": void 0,
466
+ "db.mssql.instance_name": "mssql.instance.name",
467
+ "db.sql.table": "db.collection.name",
468
+ "http.client_ip": "client.address",
469
+ "user_agent.original": "user_agent.original"
470
+ };
471
+ var HTTP_METHODS = /* @__PURE__ */ new Set([
472
+ "GET",
473
+ "POST",
474
+ "PUT",
475
+ "DELETE",
476
+ "PATCH",
477
+ "HEAD",
478
+ "OPTIONS",
479
+ "TRACE",
480
+ "QUERY",
481
+ "_OTHER"
482
+ ]);
483
+ function validateAttribute(key, value, policy = {}) {
484
+ const { guardrails = {} } = policy;
485
+ if (value === void 0 || value === null) {
486
+ return void 0;
487
+ }
488
+ if (typeof value !== "string") {
489
+ return value;
490
+ }
491
+ const stringValue = value;
492
+ if (guardrails.pii) {
493
+ const piiResult = applyPIIPolicy(key, stringValue, guardrails.pii);
494
+ if (piiResult !== stringValue) {
495
+ return piiResult;
496
+ }
497
+ }
498
+ if (guardrails.maxLength && stringValue.length > guardrails.maxLength) {
499
+ return truncateValue(key, stringValue, guardrails.maxLength);
500
+ }
501
+ if (guardrails.validateEnum && HTTP_METHODS.has(stringValue)) {
502
+ const normalizedMethod = normalizeHTTPMethod(stringValue);
503
+ if (normalizedMethod !== stringValue) {
504
+ return normalizedMethod;
505
+ }
506
+ }
507
+ return stringValue;
508
+ }
509
+ function applyPIIPolicy(key, value, pii) {
510
+ if (pii === "allow") {
511
+ return value;
512
+ }
513
+ if (pii === "redact") {
514
+ return redactIfPII(key, value);
515
+ }
516
+ if (pii === "hash") {
517
+ return hashIfPII(key, value);
518
+ }
519
+ if (pii === "block" && isPIIKey(key)) {
520
+ throw new Error(
521
+ `PII attribute "${key}" is blocked by guardrails. Use pii: "allow" to enable it.`
522
+ );
523
+ }
524
+ return value;
525
+ }
526
+ function isPIIKey(key) {
527
+ const piiKeyPatterns = [
528
+ "email",
529
+ "phone",
530
+ "ssn",
531
+ "credit_card",
532
+ "password",
533
+ "secret",
534
+ "token",
535
+ "api_key",
536
+ "authorization"
537
+ ];
538
+ const lowerKey = key.toLowerCase();
539
+ return piiKeyPatterns.some((pattern) => lowerKey.includes(pattern));
540
+ }
541
+ function redactIfPII(key, value) {
542
+ if (isPIIKey(key)) {
543
+ for (const [, pattern] of Object.entries(chunkELW34S4C_cjs.REDACTOR_PATTERNS)) {
544
+ if (pattern instanceof RegExp && pattern.test(value)) {
545
+ return "[REDACTED]";
546
+ }
547
+ }
548
+ return "[REDACTED]";
549
+ }
550
+ return value;
551
+ }
552
+ function hashIfPII(key, value) {
553
+ if (!isPIIKey(key)) {
554
+ return value;
555
+ }
556
+ const FNV_PRIME = 16777619;
557
+ const FNV_OFFSET = 2166136261;
558
+ const hashes = [];
559
+ for (let round = 0; round < 4; round++) {
560
+ let hash = FNV_OFFSET;
561
+ for (let i = 0; i < value.length; i++) {
562
+ hash ^= (value.codePointAt(i) ?? 0) + round;
563
+ hash = Math.imul(hash, FNV_PRIME);
564
+ }
565
+ hashes.push(hash >>> 0);
566
+ }
567
+ return `hash_${hashes.map((h) => h.toString(16).padStart(8, "0")).join("")}`;
568
+ }
569
+ function truncateValue(key, value, maxLength) {
570
+ if (value.length <= maxLength) {
571
+ return value;
572
+ }
573
+ return value.slice(0, maxLength - 3) + "...";
574
+ }
575
+ function normalizeHTTPMethod(method) {
576
+ const upper = method.toUpperCase();
577
+ if (HTTP_METHODS.has(upper)) {
578
+ return upper;
579
+ }
580
+ return upper;
581
+ }
582
+ function checkDeprecatedAttribute(key, policy = {}) {
583
+ const { guardrails = {}, deprecatedWarnings = {} } = policy;
584
+ const { warnDeprecated = true } = guardrails;
585
+ if (!warnDeprecated) {
586
+ return null;
587
+ }
588
+ const isDeprecated = key in DEPRECATED_ATTRIBUTES;
589
+ if (isDeprecated) {
590
+ const replacement2 = DEPRECATED_ATTRIBUTES[key];
591
+ if (replacement2 === void 0) {
592
+ console.warn(
593
+ `[autotel/attributes] Attribute "${key}" is deprecated and has no replacement. Remove or find a replacement in OpenTelemetry semantic conventions.`
594
+ );
595
+ } else {
596
+ console.warn(
597
+ `[autotel/attributes] Attribute "${key}" is deprecated. Use "${replacement2}" instead.`
598
+ );
599
+ }
600
+ }
601
+ if (deprecatedWarnings[key]) {
602
+ console.warn(`[autotel/attributes] ${deprecatedWarnings[key]}`);
603
+ }
604
+ const replacement = DEPRECATED_ATTRIBUTES[key];
605
+ return replacement ?? null;
606
+ }
607
+ function autoRedactPII(attributes, policy = {}) {
608
+ const { guardrails = { pii: "redact" } } = policy;
609
+ const redacted = {};
610
+ for (const [key, value] of Object.entries(attributes)) {
611
+ redacted[key] = validateAttribute(key, value, { guardrails });
612
+ }
613
+ return redacted;
614
+ }
615
+ function defaultGuardrails() {
616
+ return {
617
+ pii: "redact",
618
+ maxLength: 255,
619
+ validateEnum: true,
620
+ warnDeprecated: true
621
+ };
622
+ }
623
+
624
+ // src/attributes/utils.ts
625
+ function mergeAttrs(...attrSets) {
626
+ const result = {};
627
+ for (const attrSet of attrSets) {
628
+ if (attrSet) {
629
+ Object.assign(result, attrSet);
630
+ }
631
+ }
632
+ return result;
633
+ }
634
+ function safeSetAttributes(span, attrs2, policy) {
635
+ const mergedGuardrails = {
636
+ ...defaultGuardrails(),
637
+ ...policy?.guardrails
638
+ };
639
+ const effectivePolicy = {
640
+ ...policy,
641
+ guardrails: mergedGuardrails
642
+ };
643
+ const validated = autoRedactPII(attrs2, effectivePolicy);
644
+ const sanitizedAttrs = {};
645
+ for (const [key, value] of Object.entries(validated)) {
646
+ if (value !== void 0) {
647
+ checkDeprecatedAttribute(key, effectivePolicy);
648
+ const validatedValue = validateAttribute(key, value, effectivePolicy);
649
+ if (validatedValue !== void 0) {
650
+ sanitizedAttrs[key] = validatedValue;
651
+ }
652
+ }
653
+ }
654
+ span.setAttributes(sanitizedAttrs);
655
+ }
656
+
657
+ // src/attributes/attachers.ts
658
+ function setUser(spanOrContext, data, guardrails) {
659
+ const attributes = attrs.user.data(data);
660
+ safeSetAttributes(spanOrContext, attributes, guardrails);
661
+ }
662
+ function setSession(spanOrContext, data, guardrails) {
663
+ const attributes = attrs.session.data(data);
664
+ safeSetAttributes(spanOrContext, attributes, guardrails);
665
+ }
666
+ function setDevice(spanOrContext, data, guardrails) {
667
+ const attributes = attrs.device.data(data);
668
+ safeSetAttributes(spanOrContext, attributes, guardrails);
669
+ }
670
+ function httpServer(spanOrContext, data, guardrails) {
671
+ const attributes = attrs.http.server(data);
672
+ if ("updateName" in spanOrContext && data.method && data.route) {
673
+ const span = spanOrContext;
674
+ span.updateName(`HTTP ${data.method} ${data.route}`);
675
+ }
676
+ safeSetAttributes(spanOrContext, attributes, guardrails);
677
+ }
678
+ function httpClient(spanOrContext, data, guardrails) {
679
+ const attributes = attrs.http.client(data);
680
+ safeSetAttributes(spanOrContext, attributes, guardrails);
681
+ }
682
+ function dbClient(spanOrContext, data, guardrails) {
683
+ const attributes = attrs.db.client.data(data);
684
+ safeSetAttributes(spanOrContext, attributes, guardrails);
685
+ }
686
+ function mergeServiceResource(resource, data) {
687
+ const attributes = attrs.service.data(data);
688
+ return resource.merge(resources.resourceFromAttributes(attributes));
689
+ }
690
+ function identify(spanOrContext, data, guardrails) {
691
+ const allAttrs = [];
692
+ if (data.user) {
693
+ allAttrs.push(attrs.user.data(data.user));
694
+ }
695
+ if (data.session) {
696
+ allAttrs.push(attrs.session.data(data.session));
697
+ }
698
+ if (data.device) {
699
+ allAttrs.push(attrs.device.data(data.device));
700
+ }
701
+ const merged = {};
702
+ for (const attrSet of allAttrs) {
703
+ Object.assign(merged, attrSet);
704
+ }
705
+ safeSetAttributes(spanOrContext, merged, guardrails);
706
+ }
707
+ function request(spanOrContext, data, guardrails) {
708
+ const httpAttrs = attrs.http.server(data);
709
+ const networkAttrs = attrs.network.peerAddress(data.clientIp || "");
710
+ const merged = { ...httpAttrs, ...networkAttrs };
711
+ safeSetAttributes(spanOrContext, merged, guardrails);
712
+ }
713
+ function setError(spanOrContext, data, guardrails) {
714
+ const attributes = attrs.error.data(data);
715
+ safeSetAttributes(spanOrContext, attributes, guardrails);
716
+ }
717
+ function setException(spanOrContext, data, guardrails) {
718
+ const attributes = attrs.exception.data(data);
719
+ safeSetAttributes(spanOrContext, attributes, guardrails);
720
+ }
721
+
722
+ // src/attributes/domains.ts
723
+ function transaction(spanOrContext, config, guardrails) {
724
+ const userAttrs = attrs.user.data(config.user || {});
725
+ const sessionAttrs = attrs.session.data(config.session || {});
726
+ const httpAttrs = attrs.http.server({
727
+ method: config.method,
728
+ route: config.route,
729
+ statusCode: config.statusCode
730
+ });
731
+ const networkAttrs = attrs.network.peerAddress(config.clientIp || "");
732
+ const merged = {
733
+ ...userAttrs,
734
+ ...sessionAttrs,
735
+ ...httpAttrs,
736
+ ...networkAttrs
737
+ };
738
+ if (config.method && config.route && "updateName" in spanOrContext) {
739
+ spanOrContext.updateName(`HTTP ${config.method} ${config.route}`);
740
+ }
741
+ safeSetAttributes(spanOrContext, merged, guardrails);
742
+ }
743
+
744
+ exports.attrs = attrs;
745
+ exports.autoRedactPII = autoRedactPII;
746
+ exports.checkDeprecatedAttribute = checkDeprecatedAttribute;
747
+ exports.dbClient = dbClient;
748
+ exports.defaultGuardrails = defaultGuardrails;
749
+ exports.httpClient = httpClient;
750
+ exports.httpServer = httpServer;
751
+ exports.identify = identify;
752
+ exports.mergeAttrs = mergeAttrs;
753
+ exports.mergeServiceResource = mergeServiceResource;
754
+ exports.request = request;
755
+ exports.safeSetAttributes = safeSetAttributes;
756
+ exports.setDevice = setDevice;
757
+ exports.setError = setError;
758
+ exports.setException = setException;
759
+ exports.setSession = setSession;
760
+ exports.setUser = setUser;
761
+ exports.transaction = transaction;
762
+ exports.validateAttribute = validateAttribute;
763
+ //# sourceMappingURL=chunk-XRBP4RYL.cjs.map
764
+ //# sourceMappingURL=chunk-XRBP4RYL.cjs.map