autotel 4.0.0 → 4.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +26 -1
- package/dist/auto.cjs +2 -2
- package/dist/auto.js +1 -1
- package/dist/correlation-id.cjs +1 -1
- package/dist/correlation-id.js +1 -1
- package/dist/decorators.cjs +1 -1
- package/dist/decorators.js +1 -1
- package/dist/{event-Dlqr4ZNL.cjs → event-BhHREDJk.cjs} +3 -3
- package/dist/{event-Dlqr4ZNL.cjs.map → event-BhHREDJk.cjs.map} +1 -1
- package/dist/{event-_58ryBjh.js → event-ByBTV9M2.js} +3 -3
- package/dist/{event-_58ryBjh.js.map → event-ByBTV9M2.js.map} +1 -1
- package/dist/event.cjs +1 -1
- package/dist/event.js +1 -1
- package/dist/{functional-BGkT8J-h.js → functional-DtI0u4vx.js} +19 -19
- package/dist/functional-DtI0u4vx.js.map +1 -0
- package/dist/{functional-C4CzoVrX.cjs → functional-zpzNLhky.cjs} +4 -4
- package/dist/{functional-C4CzoVrX.cjs.map → functional-zpzNLhky.cjs.map} +1 -1
- package/dist/functional.cjs +1 -1
- package/dist/functional.js +1 -1
- package/dist/http.cjs +1 -1
- package/dist/http.js +1 -1
- package/dist/index.cjs +5 -5
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +5 -5
- package/dist/{init-DJQOdVlN.d.ts → init-B7u-DjxM.d.ts} +57 -2
- package/dist/init-B7u-DjxM.d.ts.map +1 -0
- package/dist/{init-DvapOXCc.cjs → init-BX7AmFRl.cjs} +40 -21
- package/dist/init-BX7AmFRl.cjs.map +1 -0
- package/dist/{init-Ch6t7MNI.js → init-D-jnNMix.js} +39 -20
- package/dist/init-D-jnNMix.js.map +1 -0
- package/dist/{init-CNp-ee80.d.cts → init-DSrRmVnz.d.cts} +57 -2
- package/dist/init-DSrRmVnz.d.cts.map +1 -0
- package/dist/instrumentation.cjs +1 -1
- package/dist/instrumentation.js +1 -1
- package/dist/logger-D3Ej3DII.js +446 -0
- package/dist/logger-D3Ej3DII.js.map +1 -0
- package/dist/logger-thMPLpOG.cjs +487 -0
- package/dist/logger-thMPLpOG.cjs.map +1 -0
- package/dist/logger.cjs +8 -236
- package/dist/logger.js +2 -204
- package/dist/messaging.cjs +1 -1
- package/dist/messaging.js +1 -1
- package/dist/semantic-helpers.cjs +1 -1
- package/dist/semantic-helpers.js +1 -1
- package/dist/{track-3HY4NGV-.cjs → track-D59FfpL0.cjs} +2 -2
- package/dist/{track-3HY4NGV-.cjs.map → track-D59FfpL0.cjs.map} +1 -1
- package/dist/{track-nsKVy-pj.js → track-wc0HafS_.js} +6 -6
- package/dist/track-wc0HafS_.js.map +1 -0
- package/dist/webhook.cjs +1 -1
- package/dist/webhook.js +1 -1
- package/dist/workflow-distributed.cjs +1 -1
- package/dist/workflow-distributed.js +1 -1
- package/dist/workflow.cjs +1 -1
- package/dist/workflow.js +1 -1
- package/dist/{yaml-config-B3dQ82GR.cjs → yaml-config-Ck2uB0Dp.cjs} +2 -1
- package/dist/yaml-config-Ck2uB0Dp.cjs.map +1 -0
- package/dist/yaml-config.cjs +1 -1
- package/dist/yaml-config.d.cts +7 -1
- package/dist/yaml-config.d.cts.map +1 -1
- package/dist/yaml-config.d.ts +7 -1
- package/dist/yaml-config.d.ts.map +1 -1
- package/dist/yaml-config.js +1 -0
- package/dist/yaml-config.js.map +1 -1
- package/package.json +1 -2
- package/skills/autotel-core/SKILL.md +2 -0
- package/skills/autotel-instrumentation/SKILL.md +25 -0
- package/skills/debug-missing-spans/SKILL.md +3 -1
- package/skills/migrate-to-autotel/SKILL.md +24 -23
- package/skills/review-otel-patterns/SKILL.md +5 -4
- package/dist/functional-BGkT8J-h.js.map +0 -1
- package/dist/init-CNp-ee80.d.cts.map +0 -1
- package/dist/init-Ch6t7MNI.js.map +0 -1
- package/dist/init-DJQOdVlN.d.ts.map +0 -1
- package/dist/init-DvapOXCc.cjs.map +0 -1
- package/dist/logger.cjs.map +0 -1
- package/dist/logger.js.map +0 -1
- package/dist/track-nsKVy-pj.js.map +0 -1
- package/dist/yaml-config-B3dQ82GR.cjs.map +0 -1
- package/src/attribute-redacting-processor.test.ts +0 -763
- package/src/attribute-redacting-processor.ts +0 -621
- package/src/attributes/attachers.ts +0 -161
- package/src/attributes/builders.ts +0 -529
- package/src/attributes/domains.ts +0 -42
- package/src/attributes/index.ts +0 -81
- package/src/attributes/registry.ts +0 -323
- package/src/attributes/types.ts +0 -211
- package/src/attributes/utils.ts +0 -64
- package/src/attributes/validators.ts +0 -266
- package/src/attributes.test.ts +0 -292
- package/src/auto.ts +0 -67
- package/src/autotel-logger.test.ts +0 -548
- package/src/autotel-logger.ts +0 -364
- package/src/baggage-span-processor.test.ts +0 -202
- package/src/baggage-span-processor.ts +0 -100
- package/src/business-baggage.test.ts +0 -500
- package/src/business-baggage.ts +0 -669
- package/src/circuit-breaker.test.ts +0 -341
- package/src/circuit-breaker.ts +0 -184
- package/src/config.test.ts +0 -94
- package/src/config.ts +0 -172
- package/src/correlated-events.test.ts +0 -151
- package/src/correlated-events.ts +0 -47
- package/src/correlation-id.test.ts +0 -163
- package/src/correlation-id.ts +0 -206
- package/src/db.test.ts +0 -252
- package/src/db.ts +0 -447
- package/src/decorators.test.ts +0 -153
- package/src/decorators.ts +0 -188
- package/src/define-event.test.ts +0 -41
- package/src/define-event.ts +0 -58
- package/src/devtools.ts +0 -60
- package/src/drain-pipeline.test.ts +0 -68
- package/src/drain-pipeline.ts +0 -199
- package/src/drain-toolkit.test.ts +0 -113
- package/src/drain-toolkit.ts +0 -129
- package/src/enricher-toolkit.test.ts +0 -67
- package/src/enricher-toolkit.ts +0 -79
- package/src/enrichers.test.ts +0 -150
- package/src/enrichers.ts +0 -145
- package/src/env-config.test.ts +0 -323
- package/src/env-config.ts +0 -309
- package/src/error-catalog.test.ts +0 -133
- package/src/error-catalog.ts +0 -262
- package/src/event-queue.test.ts +0 -864
- package/src/event-queue.ts +0 -699
- package/src/event-subscriber.ts +0 -262
- package/src/event-testing.ts +0 -197
- package/src/event.test.ts +0 -1104
- package/src/event.ts +0 -988
- package/src/events-config.ts +0 -235
- package/src/exporters.ts +0 -165
- package/src/filtering-span-processor.test.ts +0 -281
- package/src/filtering-span-processor.ts +0 -111
- package/src/flatten-attributes.test.ts +0 -76
- package/src/flatten-attributes.ts +0 -80
- package/src/functional.strict-types.typecheck.ts +0 -53
- package/src/functional.test.ts +0 -1464
- package/src/functional.ts +0 -2539
- package/src/functional.types.test.ts +0 -135
- package/src/hook.mjs +0 -15
- package/src/http.test.ts +0 -485
- package/src/http.ts +0 -424
- package/src/index.ts +0 -433
- package/src/init-auto-redactor.test.ts +0 -53
- package/src/init-redactor.test.ts +0 -8
- package/src/init.customization.test.ts +0 -594
- package/src/init.integrations.test.ts +0 -399
- package/src/init.openllmetry.test.ts +0 -194
- package/src/init.protocol.test.ts +0 -215
- package/src/init.ts +0 -2312
- package/src/instrumentation.test.ts +0 -108
- package/src/instrumentation.ts +0 -319
- package/src/logger.test.ts +0 -125
- package/src/logger.ts +0 -341
- package/src/messaging-adapters.test.ts +0 -595
- package/src/messaging-adapters.ts +0 -583
- package/src/messaging-testing.test.ts +0 -573
- package/src/messaging-testing.ts +0 -935
- package/src/messaging.test.ts +0 -1646
- package/src/messaging.ts +0 -2245
- package/src/metric-helpers.ts +0 -47
- package/src/metric-testing.ts +0 -197
- package/src/metric.ts +0 -446
- package/src/metrics.test.ts +0 -241
- package/src/node-require.ts +0 -123
- package/src/operation-context.ts +0 -93
- package/src/parse-error.test.ts +0 -73
- package/src/parse-error.ts +0 -112
- package/src/posthog-logs.test.ts +0 -115
- package/src/posthog-logs.ts +0 -77
- package/src/pretty-console-exporter.test.ts +0 -545
- package/src/pretty-console-exporter.ts +0 -413
- package/src/pretty-log-formatter.test.ts +0 -123
- package/src/pretty-log-formatter.ts +0 -210
- package/src/processors/canonical-log-line-processor.test.ts +0 -523
- package/src/processors/canonical-log-line-processor.ts +0 -396
- package/src/processors.ts +0 -152
- package/src/rate-limiter.test.ts +0 -199
- package/src/rate-limiter.ts +0 -98
- package/src/redact-values.test.ts +0 -90
- package/src/redact-values.ts +0 -34
- package/src/register.ts +0 -37
- package/src/request-logger.test.ts +0 -545
- package/src/request-logger.ts +0 -342
- package/src/sampling.test.ts +0 -1060
- package/src/sampling.ts +0 -737
- package/src/security-schema.test.ts +0 -45
- package/src/security-schema.ts +0 -107
- package/src/semantic-conventions.ts +0 -15
- package/src/semantic-helpers.test.ts +0 -226
- package/src/semantic-helpers.ts +0 -438
- package/src/shutdown.test.ts +0 -364
- package/src/shutdown.ts +0 -246
- package/src/span-name-normalizer.test.ts +0 -377
- package/src/span-name-normalizer.ts +0 -213
- package/src/stable-hash.ts +0 -27
- package/src/structured-error.test.ts +0 -191
- package/src/structured-error.ts +0 -157
- package/src/stub.integration.test.ts +0 -361
- package/src/tail-sampling-processor.test.ts +0 -230
- package/src/tail-sampling-processor.ts +0 -55
- package/src/test-span-collector.test.ts +0 -234
- package/src/test-span-collector.ts +0 -150
- package/src/testing.ts +0 -705
- package/src/trace-context.test.ts +0 -73
- package/src/trace-context.ts +0 -567
- package/src/trace-helpers.new.test.ts +0 -278
- package/src/trace-helpers.test.ts +0 -290
- package/src/trace-helpers.ts +0 -710
- package/src/trace-hybrid.test.ts +0 -42
- package/src/trace-hybrid.ts +0 -37
- package/src/tracer-provider.test.ts +0 -183
- package/src/tracer-provider.ts +0 -266
- package/src/track.test.ts +0 -154
- package/src/track.ts +0 -216
- package/src/validate.test.ts +0 -287
- package/src/validate.ts +0 -307
- package/src/validation-attributes.ts +0 -43
- package/src/validation.test.ts +0 -330
- package/src/validation.ts +0 -246
- package/src/variable-name-inference.test.ts +0 -178
- package/src/variable-name-inference.ts +0 -242
- package/src/webhook.test.ts +0 -649
- package/src/webhook.ts +0 -637
- package/src/workflow-distributed.test.ts +0 -786
- package/src/workflow-distributed.ts +0 -916
- package/src/workflow.async-safety.integration.test.ts +0 -345
- package/src/workflow.test.ts +0 -647
- package/src/workflow.ts +0 -810
- package/src/yaml-config.test.ts +0 -337
- package/src/yaml-config.ts +0 -342
|
@@ -1,161 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Signal attachment helpers
|
|
3
|
-
* These functions know WHERE to attach attributes automatically
|
|
4
|
-
* They handle span, resource, and log signals correctly
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
import type { Span, Attributes } from '@opentelemetry/api';
|
|
8
|
-
import {
|
|
9
|
-
resourceFromAttributes,
|
|
10
|
-
type Resource,
|
|
11
|
-
} from '@opentelemetry/resources';
|
|
12
|
-
import type { TraceContext } from '../trace-context';
|
|
13
|
-
import { attrs } from './builders';
|
|
14
|
-
import { safeSetAttributes } from './utils';
|
|
15
|
-
|
|
16
|
-
export function setUser(
|
|
17
|
-
spanOrContext: Span | TraceContext,
|
|
18
|
-
data: import('./types').UserAttrs,
|
|
19
|
-
guardrails?: import('./validators').AttributePolicy,
|
|
20
|
-
): void {
|
|
21
|
-
const attributes = attrs.user.data(data);
|
|
22
|
-
safeSetAttributes(spanOrContext, attributes, guardrails);
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
export function setSession(
|
|
26
|
-
spanOrContext: Span | TraceContext,
|
|
27
|
-
data: import('./types').SessionAttrs,
|
|
28
|
-
guardrails?: import('./validators').AttributePolicy,
|
|
29
|
-
): void {
|
|
30
|
-
const attributes = attrs.session.data(data);
|
|
31
|
-
safeSetAttributes(spanOrContext, attributes, guardrails);
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
export function setDevice(
|
|
35
|
-
spanOrContext: Span | TraceContext,
|
|
36
|
-
data: import('./types').DeviceAttrs,
|
|
37
|
-
guardrails?: import('./validators').AttributePolicy,
|
|
38
|
-
): void {
|
|
39
|
-
const attributes = attrs.device.data(data);
|
|
40
|
-
safeSetAttributes(spanOrContext, attributes, guardrails);
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
export function httpServer(
|
|
44
|
-
spanOrContext: Span | TraceContext,
|
|
45
|
-
data: import('./types').HTTPServerAttrs,
|
|
46
|
-
guardrails?: import('./validators').AttributePolicy,
|
|
47
|
-
): void {
|
|
48
|
-
const attributes = attrs.http.server(data);
|
|
49
|
-
|
|
50
|
-
if ('updateName' in spanOrContext && data.method && data.route) {
|
|
51
|
-
const span = spanOrContext as Span;
|
|
52
|
-
span.updateName(`HTTP ${data.method} ${data.route}`);
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
safeSetAttributes(spanOrContext, attributes, guardrails);
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
export function httpClient(
|
|
59
|
-
spanOrContext: Span | TraceContext,
|
|
60
|
-
data: import('./types').HTTPClientAttrs,
|
|
61
|
-
guardrails?: import('./validators').AttributePolicy,
|
|
62
|
-
): void {
|
|
63
|
-
const attributes = attrs.http.client(data);
|
|
64
|
-
safeSetAttributes(spanOrContext, attributes, guardrails);
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
export function dbClient(
|
|
68
|
-
spanOrContext: Span | TraceContext,
|
|
69
|
-
data: import('./types').DBAttrs,
|
|
70
|
-
guardrails?: import('./validators').AttributePolicy,
|
|
71
|
-
): void {
|
|
72
|
-
const attributes = attrs.db.client.data(data);
|
|
73
|
-
safeSetAttributes(spanOrContext, attributes, guardrails);
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
/**
|
|
77
|
-
* Merge service attributes into a Resource and return a new Resource.
|
|
78
|
-
*
|
|
79
|
-
* Resource.attributes is readonly, so this function returns a new merged
|
|
80
|
-
* Resource rather than mutating the input.
|
|
81
|
-
*
|
|
82
|
-
* @param resource - The existing resource to merge with
|
|
83
|
-
* @param data - Service attributes to add
|
|
84
|
-
* @returns A new Resource with the merged attributes
|
|
85
|
-
*
|
|
86
|
-
* @example
|
|
87
|
-
* ```typescript
|
|
88
|
-
* const baseResource = Resource.default();
|
|
89
|
-
* const enrichedResource = mergeServiceResource(baseResource, {
|
|
90
|
-
* name: 'my-service',
|
|
91
|
-
* version: '1.0.0',
|
|
92
|
-
* });
|
|
93
|
-
* ```
|
|
94
|
-
*/
|
|
95
|
-
export function mergeServiceResource(
|
|
96
|
-
resource: Resource,
|
|
97
|
-
data: import('./types').ServiceAttrs,
|
|
98
|
-
): Resource {
|
|
99
|
-
const attributes = attrs.service.data(data);
|
|
100
|
-
return resource.merge(resourceFromAttributes(attributes as Attributes));
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
export function identify(
|
|
104
|
-
spanOrContext: Span | TraceContext,
|
|
105
|
-
data: {
|
|
106
|
-
user?: import('./types').UserAttrs;
|
|
107
|
-
session?: import('./types').SessionAttrs;
|
|
108
|
-
device?: import('./types').DeviceAttrs;
|
|
109
|
-
},
|
|
110
|
-
guardrails?: import('./validators').AttributePolicy,
|
|
111
|
-
): void {
|
|
112
|
-
const allAttrs = [];
|
|
113
|
-
|
|
114
|
-
if (data.user) {
|
|
115
|
-
allAttrs.push(attrs.user.data(data.user));
|
|
116
|
-
}
|
|
117
|
-
if (data.session) {
|
|
118
|
-
allAttrs.push(attrs.session.data(data.session));
|
|
119
|
-
}
|
|
120
|
-
if (data.device) {
|
|
121
|
-
allAttrs.push(attrs.device.data(data.device));
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
const merged: Record<string, unknown> = {};
|
|
125
|
-
for (const attrSet of allAttrs) {
|
|
126
|
-
Object.assign(merged, attrSet);
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
safeSetAttributes(spanOrContext, merged, guardrails);
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
export function request(
|
|
133
|
-
spanOrContext: Span | TraceContext,
|
|
134
|
-
data: import('./types').HTTPServerAttrs & {
|
|
135
|
-
clientIp?: string;
|
|
136
|
-
},
|
|
137
|
-
guardrails?: import('./validators').AttributePolicy,
|
|
138
|
-
): void {
|
|
139
|
-
const httpAttrs = attrs.http.server(data);
|
|
140
|
-
const networkAttrs = attrs.network.peerAddress(data.clientIp || '');
|
|
141
|
-
const merged = { ...httpAttrs, ...networkAttrs };
|
|
142
|
-
safeSetAttributes(spanOrContext, merged, guardrails);
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
export function setError(
|
|
146
|
-
spanOrContext: Span | TraceContext,
|
|
147
|
-
data: import('./types').ErrorAttrs,
|
|
148
|
-
guardrails?: import('./validators').AttributePolicy,
|
|
149
|
-
): void {
|
|
150
|
-
const attributes = attrs.error.data(data);
|
|
151
|
-
safeSetAttributes(spanOrContext, attributes, guardrails);
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
export function setException(
|
|
155
|
-
spanOrContext: Span | TraceContext,
|
|
156
|
-
data: import('./types').ExceptionAttrs,
|
|
157
|
-
guardrails?: import('./validators').AttributePolicy,
|
|
158
|
-
): void {
|
|
159
|
-
const attributes = attrs.exception.data(data);
|
|
160
|
-
safeSetAttributes(spanOrContext, attributes, guardrails);
|
|
161
|
-
}
|
|
@@ -1,529 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Attribute builders for constructing OpenTelemetry attributes
|
|
3
|
-
* Provides both key builders (Pattern A) and object builders (Pattern B)
|
|
4
|
-
*
|
|
5
|
-
* @example Pattern A: Key builders
|
|
6
|
-
* ```typescript
|
|
7
|
-
* attrs.user.id('123') // { 'user.id': '123' }
|
|
8
|
-
* attrs.user.email('user@example.com') // { 'user.email': 'user@example.com' }
|
|
9
|
-
* attrs.http.request.method('GET') // { 'http.request.method': 'GET' }
|
|
10
|
-
* attrs.http.response.statusCode(200) // { 'http.response.status_code': 200 }
|
|
11
|
-
* ```
|
|
12
|
-
*
|
|
13
|
-
* @example Pattern B: Object builders
|
|
14
|
-
* ```typescript
|
|
15
|
-
* attrs.user({ id: '123', email: 'user@example.com' })
|
|
16
|
-
* attrs.http.server({ method: 'GET', route: '/users/:id', statusCode: 200 })
|
|
17
|
-
* attrs.db.client({ system: 'postgresql', operation: 'SELECT', collectionName: 'users' })
|
|
18
|
-
* ```
|
|
19
|
-
*/
|
|
20
|
-
|
|
21
|
-
import {
|
|
22
|
-
UserAttributes,
|
|
23
|
-
SessionAttributes,
|
|
24
|
-
DeviceAttributes,
|
|
25
|
-
HTTPAttributes,
|
|
26
|
-
DBAttributes,
|
|
27
|
-
ServiceAttributes,
|
|
28
|
-
NetworkAttributes,
|
|
29
|
-
ServerAddressAttributes,
|
|
30
|
-
URLAttributes,
|
|
31
|
-
ErrorAttributes,
|
|
32
|
-
ExceptionAttributes,
|
|
33
|
-
ProcessAttributes,
|
|
34
|
-
ThreadAttributes,
|
|
35
|
-
ContainerAttributes,
|
|
36
|
-
K8sAttributes,
|
|
37
|
-
CloudAttributes,
|
|
38
|
-
FaaSAttributes,
|
|
39
|
-
FeatureFlagAttributes,
|
|
40
|
-
MessagingAttributes,
|
|
41
|
-
RPCAttributes,
|
|
42
|
-
GraphQLAttributes,
|
|
43
|
-
OTelAttributes,
|
|
44
|
-
CodeAttributes,
|
|
45
|
-
TLSAttributes,
|
|
46
|
-
} from './registry';
|
|
47
|
-
|
|
48
|
-
import type {
|
|
49
|
-
UserAttrs,
|
|
50
|
-
SessionAttrs,
|
|
51
|
-
DeviceAttrs,
|
|
52
|
-
HTTPServerAttrs,
|
|
53
|
-
HTTPClientAttrs,
|
|
54
|
-
DBAttrs,
|
|
55
|
-
ServiceAttrs,
|
|
56
|
-
NetworkAttrs,
|
|
57
|
-
ErrorAttrs,
|
|
58
|
-
MessagingAttrs,
|
|
59
|
-
CloudAttrs,
|
|
60
|
-
ServerAddressAttrs,
|
|
61
|
-
URLAttrs,
|
|
62
|
-
ProcessAttrs,
|
|
63
|
-
ContainerAttrs,
|
|
64
|
-
ExceptionAttrs,
|
|
65
|
-
} from './types';
|
|
66
|
-
|
|
67
|
-
export const attrs = {
|
|
68
|
-
user: {
|
|
69
|
-
id: (value: string) => ({ [UserAttributes.id]: value }),
|
|
70
|
-
email: (value: string) => ({ [UserAttributes.email]: value }),
|
|
71
|
-
name: (value: string) => ({ [UserAttributes.name]: value }),
|
|
72
|
-
fullName: (value: string) => ({ [UserAttributes.fullName]: value }),
|
|
73
|
-
hash: (value: string) => ({ [UserAttributes.hash]: value }),
|
|
74
|
-
roles: (value: string[]) => ({ [UserAttributes.roles]: value }),
|
|
75
|
-
|
|
76
|
-
data: (data: UserAttrs) => {
|
|
77
|
-
const result: Record<string, unknown> = {};
|
|
78
|
-
if (data.id !== undefined) result[UserAttributes.id] = data.id;
|
|
79
|
-
if (data.email !== undefined) result[UserAttributes.email] = data.email;
|
|
80
|
-
if (data.name !== undefined) result[UserAttributes.name] = data.name;
|
|
81
|
-
if (data.fullName !== undefined)
|
|
82
|
-
result[UserAttributes.fullName] = data.fullName;
|
|
83
|
-
if (data.hash !== undefined) result[UserAttributes.hash] = data.hash;
|
|
84
|
-
if (data.roles !== undefined) result[UserAttributes.roles] = data.roles;
|
|
85
|
-
return result;
|
|
86
|
-
},
|
|
87
|
-
},
|
|
88
|
-
|
|
89
|
-
session: {
|
|
90
|
-
id: (value: string) => ({ [SessionAttributes.id]: value }),
|
|
91
|
-
previousId: (value: string) => ({ [SessionAttributes.previousId]: value }),
|
|
92
|
-
|
|
93
|
-
data: (data: SessionAttrs) => {
|
|
94
|
-
const result: Record<string, unknown> = {};
|
|
95
|
-
if (data.id !== undefined) result[SessionAttributes.id] = data.id;
|
|
96
|
-
if (data.previousId !== undefined)
|
|
97
|
-
result[SessionAttributes.previousId] = data.previousId;
|
|
98
|
-
return result;
|
|
99
|
-
},
|
|
100
|
-
},
|
|
101
|
-
|
|
102
|
-
device: {
|
|
103
|
-
id: (value: string) => ({ [DeviceAttributes.id]: value }),
|
|
104
|
-
manufacturer: (value: string) => ({
|
|
105
|
-
[DeviceAttributes.manufacturer]: value,
|
|
106
|
-
}),
|
|
107
|
-
modelIdentifier: (value: string) => ({
|
|
108
|
-
[DeviceAttributes.modelIdentifier]: value,
|
|
109
|
-
}),
|
|
110
|
-
modelName: (value: string) => ({ [DeviceAttributes.modelName]: value }),
|
|
111
|
-
|
|
112
|
-
data: (data: DeviceAttrs) => {
|
|
113
|
-
const result: Record<string, unknown> = {};
|
|
114
|
-
if (data.id !== undefined) result[DeviceAttributes.id] = data.id;
|
|
115
|
-
if (data.manufacturer !== undefined)
|
|
116
|
-
result[DeviceAttributes.manufacturer] = data.manufacturer;
|
|
117
|
-
if (data.modelIdentifier !== undefined)
|
|
118
|
-
result[DeviceAttributes.modelIdentifier] = data.modelIdentifier;
|
|
119
|
-
if (data.modelName !== undefined)
|
|
120
|
-
result[DeviceAttributes.modelName] = data.modelName;
|
|
121
|
-
return result;
|
|
122
|
-
},
|
|
123
|
-
},
|
|
124
|
-
|
|
125
|
-
http: {
|
|
126
|
-
request: {
|
|
127
|
-
method: (value: string) => ({ [HTTPAttributes.requestMethod]: value }),
|
|
128
|
-
methodOriginal: (value: string) => ({
|
|
129
|
-
[HTTPAttributes.requestMethodOriginal]: value,
|
|
130
|
-
}),
|
|
131
|
-
resendCount: (value: number) => ({
|
|
132
|
-
[HTTPAttributes.requestResendCount]: value,
|
|
133
|
-
}),
|
|
134
|
-
size: (value: number) => ({ [HTTPAttributes.requestSize]: value }),
|
|
135
|
-
bodySize: (value: number) => ({
|
|
136
|
-
[HTTPAttributes.requestBodySize]: value,
|
|
137
|
-
}),
|
|
138
|
-
},
|
|
139
|
-
|
|
140
|
-
response: {
|
|
141
|
-
statusCode: (value: number) => ({
|
|
142
|
-
[HTTPAttributes.responseStatusCode]: value,
|
|
143
|
-
}),
|
|
144
|
-
size: (value: number) => ({ [HTTPAttributes.responseSize]: value }),
|
|
145
|
-
bodySize: (value: number) => ({
|
|
146
|
-
[HTTPAttributes.responseBodySize]: value,
|
|
147
|
-
}),
|
|
148
|
-
},
|
|
149
|
-
|
|
150
|
-
route: (value: string) => ({ [HTTPAttributes.route]: value }),
|
|
151
|
-
connectionState: (value: string) => ({
|
|
152
|
-
[HTTPAttributes.connectionState]: value,
|
|
153
|
-
}),
|
|
154
|
-
|
|
155
|
-
server: (data: HTTPServerAttrs) => {
|
|
156
|
-
const result: Record<string, unknown> = {};
|
|
157
|
-
if (data.method !== undefined)
|
|
158
|
-
result[HTTPAttributes.requestMethod] = data.method;
|
|
159
|
-
if (data.route !== undefined) result[HTTPAttributes.route] = data.route;
|
|
160
|
-
if (data.statusCode !== undefined)
|
|
161
|
-
result[HTTPAttributes.responseStatusCode] = data.statusCode;
|
|
162
|
-
if (data.bodySize !== undefined)
|
|
163
|
-
result[HTTPAttributes.requestBodySize] = data.bodySize;
|
|
164
|
-
if (data.requestSize !== undefined)
|
|
165
|
-
result[HTTPAttributes.requestSize] = data.requestSize;
|
|
166
|
-
if (data.responseSize !== undefined)
|
|
167
|
-
result[HTTPAttributes.responseSize] = data.responseSize;
|
|
168
|
-
if (data.resendCount !== undefined)
|
|
169
|
-
result[HTTPAttributes.requestResendCount] = data.resendCount;
|
|
170
|
-
return result;
|
|
171
|
-
},
|
|
172
|
-
|
|
173
|
-
client: (data: HTTPClientAttrs) => {
|
|
174
|
-
const result: Record<string, unknown> = {};
|
|
175
|
-
if (data.method !== undefined)
|
|
176
|
-
result[HTTPAttributes.requestMethod] = data.method;
|
|
177
|
-
if (data.url !== undefined) result[HTTPAttributes.route] = data.url;
|
|
178
|
-
if (data.statusCode !== undefined)
|
|
179
|
-
result[HTTPAttributes.responseStatusCode] = data.statusCode;
|
|
180
|
-
return result;
|
|
181
|
-
},
|
|
182
|
-
},
|
|
183
|
-
|
|
184
|
-
db: {
|
|
185
|
-
client: {
|
|
186
|
-
system: (value: string) => ({ [DBAttributes.systemName]: value }),
|
|
187
|
-
operation: (value: string) => ({ [DBAttributes.operationName]: value }),
|
|
188
|
-
collectionName: (value: string) => ({
|
|
189
|
-
[DBAttributes.collectionName]: value,
|
|
190
|
-
}),
|
|
191
|
-
namespace: (value: string) => ({ [DBAttributes.namespace]: value }),
|
|
192
|
-
statement: (value: string) => ({ [DBAttributes.statement]: value }),
|
|
193
|
-
querySummary: (value: string) => ({ [DBAttributes.querySummary]: value }),
|
|
194
|
-
queryText: (value: string) => ({ [DBAttributes.queryText]: value }),
|
|
195
|
-
responseStatus: (value: string | number) => ({
|
|
196
|
-
[DBAttributes.responseStatusCode]: value,
|
|
197
|
-
}),
|
|
198
|
-
rowsReturned: (value: number) => ({
|
|
199
|
-
[DBAttributes.responseReturnedRows]: value,
|
|
200
|
-
}),
|
|
201
|
-
|
|
202
|
-
data: (data: DBAttrs) => {
|
|
203
|
-
const result: Record<string, unknown> = {};
|
|
204
|
-
if (data.system !== undefined)
|
|
205
|
-
result[DBAttributes.systemName] = data.system;
|
|
206
|
-
if (data.operation !== undefined)
|
|
207
|
-
result[DBAttributes.operationName] = data.operation;
|
|
208
|
-
if (data.collectionName !== undefined)
|
|
209
|
-
result[DBAttributes.collectionName] = data.collectionName;
|
|
210
|
-
// 'name' maps to db.namespace (db.name is deprecated per OTel semantic conventions)
|
|
211
|
-
if (data.name !== undefined) result[DBAttributes.namespace] = data.name;
|
|
212
|
-
// 'namespace' takes precedence over 'name' if both are provided
|
|
213
|
-
if (data.namespace !== undefined)
|
|
214
|
-
result[DBAttributes.namespace] = data.namespace;
|
|
215
|
-
if (data.statement !== undefined)
|
|
216
|
-
result[DBAttributes.statement] = data.statement;
|
|
217
|
-
if (data.querySummary !== undefined)
|
|
218
|
-
result[DBAttributes.querySummary] = data.querySummary;
|
|
219
|
-
if (data.queryText !== undefined)
|
|
220
|
-
result[DBAttributes.queryText] = data.queryText;
|
|
221
|
-
if (data.responseStatus !== undefined)
|
|
222
|
-
result[DBAttributes.responseStatusCode] = data.responseStatus;
|
|
223
|
-
if (data.rowsReturned !== undefined)
|
|
224
|
-
result[DBAttributes.responseReturnedRows] = data.rowsReturned;
|
|
225
|
-
return result;
|
|
226
|
-
},
|
|
227
|
-
},
|
|
228
|
-
},
|
|
229
|
-
|
|
230
|
-
service: {
|
|
231
|
-
name: (value: string) => ({ [ServiceAttributes.name]: value }),
|
|
232
|
-
instance: (value: string) => ({ [ServiceAttributes.instance]: value }),
|
|
233
|
-
version: (value: string) => ({ [ServiceAttributes.version]: value }),
|
|
234
|
-
|
|
235
|
-
data: (data: ServiceAttrs) => {
|
|
236
|
-
const result: Record<string, unknown> = {};
|
|
237
|
-
if (data.name !== undefined) result[ServiceAttributes.name] = data.name;
|
|
238
|
-
if (data.instance !== undefined)
|
|
239
|
-
result[ServiceAttributes.instance] = data.instance;
|
|
240
|
-
if (data.version !== undefined)
|
|
241
|
-
result[ServiceAttributes.version] = data.version;
|
|
242
|
-
return result;
|
|
243
|
-
},
|
|
244
|
-
},
|
|
245
|
-
|
|
246
|
-
network: {
|
|
247
|
-
peerAddress: (value: string) => ({
|
|
248
|
-
[NetworkAttributes.peerAddress]: value,
|
|
249
|
-
}),
|
|
250
|
-
peerPort: (value: number) => ({ [NetworkAttributes.peerPort]: value }),
|
|
251
|
-
transport: (value: string) => ({ [NetworkAttributes.transport]: value }),
|
|
252
|
-
protocolName: (value: string) => ({
|
|
253
|
-
[NetworkAttributes.protocolName]: value,
|
|
254
|
-
}),
|
|
255
|
-
protocolVersion: (value: string) => ({
|
|
256
|
-
[NetworkAttributes.protocolVersion]: value,
|
|
257
|
-
}),
|
|
258
|
-
|
|
259
|
-
data: (data: NetworkAttrs) => {
|
|
260
|
-
const result: Record<string, unknown> = {};
|
|
261
|
-
if (data.peerAddress !== undefined)
|
|
262
|
-
result[NetworkAttributes.peerAddress] = data.peerAddress;
|
|
263
|
-
if (data.peerPort !== undefined)
|
|
264
|
-
result[NetworkAttributes.peerPort] = data.peerPort;
|
|
265
|
-
if (data.transport !== undefined)
|
|
266
|
-
result[NetworkAttributes.transport] = data.transport;
|
|
267
|
-
if (data.protocolName !== undefined)
|
|
268
|
-
result[NetworkAttributes.protocolName] = data.protocolName;
|
|
269
|
-
if (data.protocolVersion !== undefined)
|
|
270
|
-
result[NetworkAttributes.protocolVersion] = data.protocolVersion;
|
|
271
|
-
return result;
|
|
272
|
-
},
|
|
273
|
-
},
|
|
274
|
-
|
|
275
|
-
server: {
|
|
276
|
-
address: (value: string) => ({ [ServerAddressAttributes.address]: value }),
|
|
277
|
-
port: (value: number) => ({ [ServerAddressAttributes.port]: value }),
|
|
278
|
-
socketAddress: (value: string) => ({
|
|
279
|
-
[ServerAddressAttributes.socketAddress]: value,
|
|
280
|
-
}),
|
|
281
|
-
|
|
282
|
-
data: (data: ServerAddressAttrs) => {
|
|
283
|
-
const result: Record<string, unknown> = {};
|
|
284
|
-
if (data.address !== undefined)
|
|
285
|
-
result[ServerAddressAttributes.address] = data.address;
|
|
286
|
-
if (data.port !== undefined)
|
|
287
|
-
result[ServerAddressAttributes.port] = data.port;
|
|
288
|
-
if (data.socketAddress !== undefined)
|
|
289
|
-
result[ServerAddressAttributes.socketAddress] = data.socketAddress;
|
|
290
|
-
return result;
|
|
291
|
-
},
|
|
292
|
-
},
|
|
293
|
-
|
|
294
|
-
url: {
|
|
295
|
-
scheme: (value: string) => ({ [URLAttributes.scheme]: value }),
|
|
296
|
-
full: (value: string) => ({ [URLAttributes.full]: value }),
|
|
297
|
-
path: (value: string) => ({ [URLAttributes.path]: value }),
|
|
298
|
-
query: (value: string) => ({ [URLAttributes.query]: value }),
|
|
299
|
-
fragment: (value: string) => ({ [URLAttributes.fragment]: value }),
|
|
300
|
-
|
|
301
|
-
data: (data: URLAttrs) => {
|
|
302
|
-
const result: Record<string, unknown> = {};
|
|
303
|
-
if (data.scheme !== undefined) result[URLAttributes.scheme] = data.scheme;
|
|
304
|
-
if (data.full !== undefined) result[URLAttributes.full] = data.full;
|
|
305
|
-
if (data.path !== undefined) result[URLAttributes.path] = data.path;
|
|
306
|
-
if (data.query !== undefined) result[URLAttributes.query] = data.query;
|
|
307
|
-
if (data.fragment !== undefined)
|
|
308
|
-
result[URLAttributes.fragment] = data.fragment;
|
|
309
|
-
return result;
|
|
310
|
-
},
|
|
311
|
-
},
|
|
312
|
-
|
|
313
|
-
error: {
|
|
314
|
-
type: (value: string) => ({ [ErrorAttributes.type]: value }),
|
|
315
|
-
message: (value: string) => ({ [ErrorAttributes.message]: value }),
|
|
316
|
-
stackTrace: (value: string) => ({ [ErrorAttributes.stackTrace]: value }),
|
|
317
|
-
code: (value: string | number) => ({ [ErrorAttributes.code]: value }),
|
|
318
|
-
|
|
319
|
-
data: (data: ErrorAttrs) => {
|
|
320
|
-
const result: Record<string, unknown> = {};
|
|
321
|
-
if (data.type !== undefined) result[ErrorAttributes.type] = data.type;
|
|
322
|
-
if (data.message !== undefined)
|
|
323
|
-
result[ErrorAttributes.message] = data.message;
|
|
324
|
-
if (data.stackTrace !== undefined)
|
|
325
|
-
result[ErrorAttributes.stackTrace] = data.stackTrace;
|
|
326
|
-
if (data.code !== undefined) result[ErrorAttributes.code] = data.code;
|
|
327
|
-
return result;
|
|
328
|
-
},
|
|
329
|
-
},
|
|
330
|
-
|
|
331
|
-
exception: {
|
|
332
|
-
escaped: (value: boolean) => ({ [ExceptionAttributes.escaped]: value }),
|
|
333
|
-
message: (value: string) => ({ [ExceptionAttributes.message]: value }),
|
|
334
|
-
stackTrace: (value: string) => ({
|
|
335
|
-
[ExceptionAttributes.stackTrace]: value,
|
|
336
|
-
}),
|
|
337
|
-
type: (value: string) => ({ [ExceptionAttributes.type]: value }),
|
|
338
|
-
moduleName: (value: string) => ({
|
|
339
|
-
[ExceptionAttributes.moduleName]: value,
|
|
340
|
-
}),
|
|
341
|
-
|
|
342
|
-
data: (data: ExceptionAttrs) => {
|
|
343
|
-
const result: Record<string, unknown> = {};
|
|
344
|
-
if (data.escaped !== undefined)
|
|
345
|
-
result[ExceptionAttributes.escaped] = data.escaped;
|
|
346
|
-
if (data.message !== undefined)
|
|
347
|
-
result[ExceptionAttributes.message] = data.message;
|
|
348
|
-
if (data.stackTrace !== undefined)
|
|
349
|
-
result[ExceptionAttributes.stackTrace] = data.stackTrace;
|
|
350
|
-
if (data.type !== undefined) result[ExceptionAttributes.type] = data.type;
|
|
351
|
-
if (data.moduleName !== undefined)
|
|
352
|
-
result[ExceptionAttributes.moduleName] = data.moduleName;
|
|
353
|
-
return result;
|
|
354
|
-
},
|
|
355
|
-
},
|
|
356
|
-
|
|
357
|
-
process: {
|
|
358
|
-
pid: (value: number) => ({ [ProcessAttributes.pid]: value }),
|
|
359
|
-
executablePath: (value: string) => ({
|
|
360
|
-
[ProcessAttributes.executablePath]: value,
|
|
361
|
-
}),
|
|
362
|
-
command: (value: string) => ({ [ProcessAttributes.command]: value }),
|
|
363
|
-
owner: (value: string) => ({ [ProcessAttributes.owner]: value }),
|
|
364
|
-
|
|
365
|
-
data: (data: ProcessAttrs) => {
|
|
366
|
-
const result: Record<string, unknown> = {};
|
|
367
|
-
if (data.pid !== undefined) result[ProcessAttributes.pid] = data.pid;
|
|
368
|
-
if (data.executablePath !== undefined)
|
|
369
|
-
result[ProcessAttributes.executablePath] = data.executablePath;
|
|
370
|
-
if (data.command !== undefined)
|
|
371
|
-
result[ProcessAttributes.command] = data.command;
|
|
372
|
-
if (data.owner !== undefined)
|
|
373
|
-
result[ProcessAttributes.owner] = data.owner;
|
|
374
|
-
return result;
|
|
375
|
-
},
|
|
376
|
-
},
|
|
377
|
-
|
|
378
|
-
thread: {
|
|
379
|
-
id: (value: number) => ({ [ThreadAttributes.id]: value }),
|
|
380
|
-
name: (value: string) => ({ [ThreadAttributes.name]: value }),
|
|
381
|
-
},
|
|
382
|
-
|
|
383
|
-
container: {
|
|
384
|
-
id: (value: string) => ({ [ContainerAttributes.id]: value }),
|
|
385
|
-
name: (value: string) => ({ [ContainerAttributes.name]: value }),
|
|
386
|
-
image: (value: string) => ({ [ContainerAttributes.image]: value }),
|
|
387
|
-
tag: (value: string) => ({ [ContainerAttributes.tag]: value }),
|
|
388
|
-
|
|
389
|
-
data: (data: ContainerAttrs) => {
|
|
390
|
-
const result: Record<string, unknown> = {};
|
|
391
|
-
if (data.id !== undefined) result[ContainerAttributes.id] = data.id;
|
|
392
|
-
if (data.name !== undefined) result[ContainerAttributes.name] = data.name;
|
|
393
|
-
if (data.image !== undefined)
|
|
394
|
-
result[ContainerAttributes.image] = data.image;
|
|
395
|
-
if (data.tag !== undefined) result[ContainerAttributes.tag] = data.tag;
|
|
396
|
-
return result;
|
|
397
|
-
},
|
|
398
|
-
},
|
|
399
|
-
|
|
400
|
-
k8s: {
|
|
401
|
-
podName: (value: string) => ({ [K8sAttributes.podName]: value }),
|
|
402
|
-
namespaceName: (value: string) => ({
|
|
403
|
-
[K8sAttributes.namespaceName]: value,
|
|
404
|
-
}),
|
|
405
|
-
deploymentName: (value: string) => ({
|
|
406
|
-
[K8sAttributes.deploymentName]: value,
|
|
407
|
-
}),
|
|
408
|
-
state: (value: string) => ({ [K8sAttributes.state]: value }),
|
|
409
|
-
},
|
|
410
|
-
|
|
411
|
-
cloud: {
|
|
412
|
-
provider: (value: string) => ({ [CloudAttributes.provider]: value }),
|
|
413
|
-
accountId: (value: string) => ({ [CloudAttributes.accountId]: value }),
|
|
414
|
-
region: (value: string) => ({ [CloudAttributes.region]: value }),
|
|
415
|
-
availabilityZone: (value: string) => ({
|
|
416
|
-
[CloudAttributes.availabilityZone]: value,
|
|
417
|
-
}),
|
|
418
|
-
platform: (value: string) => ({ [CloudAttributes.platform]: value }),
|
|
419
|
-
|
|
420
|
-
data: (data: CloudAttrs) => {
|
|
421
|
-
const result: Record<string, unknown> = {};
|
|
422
|
-
if (data.provider !== undefined)
|
|
423
|
-
result[CloudAttributes.provider] = data.provider;
|
|
424
|
-
if (data.accountId !== undefined)
|
|
425
|
-
result[CloudAttributes.accountId] = data.accountId;
|
|
426
|
-
if (data.region !== undefined)
|
|
427
|
-
result[CloudAttributes.region] = data.region;
|
|
428
|
-
if (data.availabilityZone !== undefined)
|
|
429
|
-
result[CloudAttributes.availabilityZone] = data.availabilityZone;
|
|
430
|
-
if (data.platform !== undefined)
|
|
431
|
-
result[CloudAttributes.platform] = data.platform;
|
|
432
|
-
return result;
|
|
433
|
-
},
|
|
434
|
-
},
|
|
435
|
-
|
|
436
|
-
faas: {
|
|
437
|
-
name: (value: string) => ({ [FaaSAttributes.name]: value }),
|
|
438
|
-
version: (value: string) => ({ [FaaSAttributes.version]: value }),
|
|
439
|
-
instance: (value: string) => ({ [FaaSAttributes.instance]: value }),
|
|
440
|
-
execution: (value: string) => ({ [FaaSAttributes.execution]: value }),
|
|
441
|
-
coldstart: (value: boolean) => ({ [FaaSAttributes.coldstart]: value }),
|
|
442
|
-
},
|
|
443
|
-
|
|
444
|
-
featureFlag: {
|
|
445
|
-
key: (value: string) => ({ [FeatureFlagAttributes.key]: value }),
|
|
446
|
-
provider: (value: string) => ({ [FeatureFlagAttributes.provider]: value }),
|
|
447
|
-
variant: (value: string) => ({ [FeatureFlagAttributes.variant]: value }),
|
|
448
|
-
},
|
|
449
|
-
|
|
450
|
-
messaging: {
|
|
451
|
-
system: (value: string) => ({ [MessagingAttributes.system]: value }),
|
|
452
|
-
destination: (value: string) => ({
|
|
453
|
-
[MessagingAttributes.destination]: value,
|
|
454
|
-
}),
|
|
455
|
-
operation: (value: 'publish' | 'receive' | 'process') => ({
|
|
456
|
-
[MessagingAttributes.operation]: value,
|
|
457
|
-
}),
|
|
458
|
-
messageId: (value: string) => ({ [MessagingAttributes.messageId]: value }),
|
|
459
|
-
conversationId: (value: string) => ({
|
|
460
|
-
[MessagingAttributes.conversationId]: value,
|
|
461
|
-
}),
|
|
462
|
-
|
|
463
|
-
data: (data: MessagingAttrs) => {
|
|
464
|
-
const result: Record<string, unknown> = {};
|
|
465
|
-
if (data.system !== undefined)
|
|
466
|
-
result[MessagingAttributes.system] = data.system;
|
|
467
|
-
if (data.destination !== undefined)
|
|
468
|
-
result[MessagingAttributes.destination] = data.destination;
|
|
469
|
-
if (data.operation !== undefined)
|
|
470
|
-
result[MessagingAttributes.operation] = data.operation;
|
|
471
|
-
if (data.messageId !== undefined)
|
|
472
|
-
result[MessagingAttributes.messageId] = data.messageId;
|
|
473
|
-
if (data.conversationId !== undefined)
|
|
474
|
-
result[MessagingAttributes.conversationId] = data.conversationId;
|
|
475
|
-
return result;
|
|
476
|
-
},
|
|
477
|
-
},
|
|
478
|
-
|
|
479
|
-
// GenAI/LLM attribute builders moved to the `autotel-genai` package
|
|
480
|
-
// (canonical `gen_ai.*` semantic conventions).
|
|
481
|
-
|
|
482
|
-
rpc: {
|
|
483
|
-
system: (value: string) => ({ [RPCAttributes.system]: value }),
|
|
484
|
-
service: (value: string) => ({ [RPCAttributes.service]: value }),
|
|
485
|
-
method: (value: string) => ({ [RPCAttributes.method]: value }),
|
|
486
|
-
grpcStatusCode: (value: number) => ({
|
|
487
|
-
[RPCAttributes.grpcStatusCode]: value,
|
|
488
|
-
}),
|
|
489
|
-
},
|
|
490
|
-
|
|
491
|
-
graphql: {
|
|
492
|
-
document: (value: string) => ({ [GraphQLAttributes.document]: value }),
|
|
493
|
-
operationName: (value: string) => ({
|
|
494
|
-
[GraphQLAttributes.operationName]: value,
|
|
495
|
-
}),
|
|
496
|
-
operationType: (value: 'query' | 'mutation' | 'subscription') => ({
|
|
497
|
-
[GraphQLAttributes.operationType]: value,
|
|
498
|
-
}),
|
|
499
|
-
},
|
|
500
|
-
|
|
501
|
-
otel: {
|
|
502
|
-
libraryName: (value: string) => ({ [OTelAttributes.libraryName]: value }),
|
|
503
|
-
libraryVersion: (value: string) => ({
|
|
504
|
-
[OTelAttributes.libraryVersion]: value,
|
|
505
|
-
}),
|
|
506
|
-
statusCode: (value: string) => ({ [OTelAttributes.statusCode]: value }),
|
|
507
|
-
},
|
|
508
|
-
|
|
509
|
-
code: {
|
|
510
|
-
namespace: (value: string) => ({ [CodeAttributes.namespace]: value }),
|
|
511
|
-
filepath: (value: string) => ({ [CodeAttributes.filepath]: value }),
|
|
512
|
-
function: (value: string) => ({ [CodeAttributes.function]: value }),
|
|
513
|
-
class: (value: string) => ({ [CodeAttributes.class]: value }),
|
|
514
|
-
method: (value: string) => ({ [CodeAttributes.method]: value }),
|
|
515
|
-
column: (value: string) => ({ [CodeAttributes.column]: value }),
|
|
516
|
-
lineNumber: (value: number) => ({ [CodeAttributes.lineNumber]: value }),
|
|
517
|
-
repository: (value: string) => ({ [CodeAttributes.repository]: value }),
|
|
518
|
-
revision: (value: string) => ({ [CodeAttributes.revision]: value }),
|
|
519
|
-
},
|
|
520
|
-
|
|
521
|
-
tls: {
|
|
522
|
-
protocolVersion: (value: string) => ({
|
|
523
|
-
[TLSAttributes.protocolVersion]: value,
|
|
524
|
-
}),
|
|
525
|
-
cipher: (value: string) => ({ [TLSAttributes.cipher]: value }),
|
|
526
|
-
curveName: (value: string) => ({ [TLSAttributes.curveName]: value }),
|
|
527
|
-
resumed: (value: boolean) => ({ [TLSAttributes.resumed]: value }),
|
|
528
|
-
},
|
|
529
|
-
} as const;
|