libo11y 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,785 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Code generated by specgen from spec/registry (spec 1.3.0). DO NOT EDIT.
4
+
5
+ require "set"
6
+
7
+ module Libo11y
8
+ module Spec
9
+ module Sensitivity
10
+ PUBLIC = "public"
11
+ INTERNAL = "internal"
12
+ PII = "pii"
13
+ SECRET = "secret"
14
+ ALL = [PUBLIC, INTERNAL, PII, SECRET].freeze
15
+ end
16
+
17
+ module Cardinality
18
+ ENUM = "enum"
19
+ BOUNDED = "bounded"
20
+ UNBOUNDED = "unbounded"
21
+ ALL = [ENUM, BOUNDED, UNBOUNDED].freeze
22
+ end
23
+
24
+ module Requirement
25
+ REQUIRED = "required"
26
+ CONDITIONALLY_REQUIRED = "conditionally_required"
27
+ RECOMMENDED = "recommended"
28
+ OPT_IN = "opt_in"
29
+ ALL = [REQUIRED, CONDITIONALLY_REQUIRED, RECOMMENDED, OPT_IN].freeze
30
+ end
31
+
32
+ module Instrument
33
+ COUNTER = "counter"
34
+ HISTOGRAM = "histogram"
35
+ GAUGE = "gauge"
36
+ UP_DOWN_COUNTER = "updowncounter"
37
+ ALL = [COUNTER, HISTOGRAM, GAUGE, UP_DOWN_COUNTER].freeze
38
+ end
39
+
40
+ ResourceAttr = Data.define(:key, :tier, :requirement, :source, :role)
41
+ EventInfo = Data.define(:name, :required, :required_templates)
42
+ MetricInfo = Data.define(:name, :instrument, :unit)
43
+
44
+ RESOURCE = {
45
+ "service.name" => ResourceAttr.new(
46
+ key: "service.name",
47
+ tier: "tier0",
48
+ requirement: Requirement::REQUIRED,
49
+ source: "option-or-env",
50
+ role: "identifying"
51
+ ),
52
+ "service.version" => ResourceAttr.new(
53
+ key: "service.version",
54
+ tier: "tier0",
55
+ requirement: Requirement::REQUIRED,
56
+ source: "option-or-env-or-buildinfo",
57
+ role: "descriptive"
58
+ ),
59
+ "deployment.environment.name" => ResourceAttr.new(
60
+ key: "deployment.environment.name",
61
+ tier: "tier0",
62
+ requirement: Requirement::REQUIRED,
63
+ source: "option-or-env",
64
+ role: "descriptive"
65
+ ),
66
+ "telemetry.sdk.name" => ResourceAttr.new(
67
+ key: "telemetry.sdk.name",
68
+ tier: "tier0",
69
+ requirement: Requirement::REQUIRED,
70
+ source: "sdk",
71
+ role: "identifying"
72
+ ),
73
+ "telemetry.sdk.language" => ResourceAttr.new(
74
+ key: "telemetry.sdk.language",
75
+ tier: "tier0",
76
+ requirement: Requirement::REQUIRED,
77
+ source: "sdk",
78
+ role: "identifying"
79
+ ),
80
+ "telemetry.sdk.version" => ResourceAttr.new(
81
+ key: "telemetry.sdk.version",
82
+ tier: "tier0",
83
+ requirement: Requirement::REQUIRED,
84
+ source: "sdk",
85
+ role: "identifying"
86
+ ),
87
+ "telemetry.distro.name" => ResourceAttr.new(
88
+ key: "telemetry.distro.name",
89
+ tier: "tier0",
90
+ requirement: Requirement::RECOMMENDED,
91
+ source: "sdk",
92
+ role: "descriptive"
93
+ ),
94
+ "telemetry.distro.version" => ResourceAttr.new(
95
+ key: "telemetry.distro.version",
96
+ tier: "tier0",
97
+ requirement: Requirement::RECOMMENDED,
98
+ source: "sdk",
99
+ role: "descriptive"
100
+ ),
101
+ "service.instance.id" => ResourceAttr.new(
102
+ key: "service.instance.id",
103
+ tier: "tier1",
104
+ requirement: Requirement::REQUIRED,
105
+ source: "derived",
106
+ role: "identifying"
107
+ ),
108
+ "service.namespace" => ResourceAttr.new(
109
+ key: "service.namespace",
110
+ tier: "tier1",
111
+ requirement: Requirement::CONDITIONALLY_REQUIRED,
112
+ source: "option-or-env",
113
+ role: "identifying"
114
+ ),
115
+ "k8s.namespace.name" => ResourceAttr.new(
116
+ key: "k8s.namespace.name",
117
+ tier: "tier1",
118
+ requirement: Requirement::CONDITIONALLY_REQUIRED,
119
+ source: "downward-api",
120
+ role: "identifying"
121
+ ),
122
+ "k8s.pod.name" => ResourceAttr.new(
123
+ key: "k8s.pod.name",
124
+ tier: "tier1",
125
+ requirement: Requirement::CONDITIONALLY_REQUIRED,
126
+ source: "downward-api",
127
+ role: "descriptive"
128
+ ),
129
+ "k8s.pod.uid" => ResourceAttr.new(
130
+ key: "k8s.pod.uid",
131
+ tier: "tier1",
132
+ requirement: Requirement::CONDITIONALLY_REQUIRED,
133
+ source: "downward-api",
134
+ role: "identifying"
135
+ ),
136
+ "k8s.cluster.name" => ResourceAttr.new(
137
+ key: "k8s.cluster.name",
138
+ tier: "tier1",
139
+ requirement: Requirement::RECOMMENDED,
140
+ source: "collector",
141
+ role: "identifying"
142
+ ),
143
+ "k8s.deployment.name" => ResourceAttr.new(
144
+ key: "k8s.deployment.name",
145
+ tier: "tier1",
146
+ requirement: Requirement::RECOMMENDED,
147
+ source: "collector",
148
+ role: "descriptive"
149
+ ),
150
+ "k8s.container.name" => ResourceAttr.new(
151
+ key: "k8s.container.name",
152
+ tier: "tier1",
153
+ requirement: Requirement::RECOMMENDED,
154
+ source: "collector",
155
+ role: "descriptive"
156
+ ),
157
+ "k8s.node.name" => ResourceAttr.new(
158
+ key: "k8s.node.name",
159
+ tier: "tier1",
160
+ requirement: Requirement::RECOMMENDED,
161
+ source: "collector",
162
+ role: "descriptive"
163
+ ),
164
+ "container.id" => ResourceAttr.new(
165
+ key: "container.id",
166
+ tier: "tier1",
167
+ requirement: Requirement::CONDITIONALLY_REQUIRED,
168
+ source: "detector",
169
+ role: "identifying"
170
+ ),
171
+ "cloud.provider" => ResourceAttr.new(
172
+ key: "cloud.provider",
173
+ tier: "tier1",
174
+ requirement: Requirement::OPT_IN,
175
+ source: "detector-or-collector",
176
+ role: "descriptive"
177
+ ),
178
+ "cloud.platform" => ResourceAttr.new(
179
+ key: "cloud.platform",
180
+ tier: "tier1",
181
+ requirement: Requirement::OPT_IN,
182
+ source: "detector-or-collector",
183
+ role: "descriptive"
184
+ ),
185
+ "cloud.region" => ResourceAttr.new(
186
+ key: "cloud.region",
187
+ tier: "tier1",
188
+ requirement: Requirement::OPT_IN,
189
+ source: "detector-or-collector",
190
+ role: "descriptive"
191
+ ),
192
+ "cloud.availability_zone" => ResourceAttr.new(
193
+ key: "cloud.availability_zone",
194
+ tier: "tier1",
195
+ requirement: Requirement::OPT_IN,
196
+ source: "detector-or-collector",
197
+ role: "descriptive"
198
+ ),
199
+ "cloud.account.id" => ResourceAttr.new(
200
+ key: "cloud.account.id",
201
+ tier: "tier1",
202
+ requirement: Requirement::OPT_IN,
203
+ source: "detector-or-collector",
204
+ role: "descriptive"
205
+ ),
206
+ "host.id" => ResourceAttr.new(
207
+ key: "host.id",
208
+ tier: "tier1",
209
+ requirement: Requirement::CONDITIONALLY_REQUIRED,
210
+ source: "detector",
211
+ role: "identifying"
212
+ ),
213
+ "host.name" => ResourceAttr.new(
214
+ key: "host.name",
215
+ tier: "tier1",
216
+ requirement: Requirement::RECOMMENDED,
217
+ source: "detector",
218
+ role: "descriptive"
219
+ ),
220
+ "faas.name" => ResourceAttr.new(
221
+ key: "faas.name",
222
+ tier: "tier1",
223
+ requirement: Requirement::CONDITIONALLY_REQUIRED,
224
+ source: "detector",
225
+ role: "identifying"
226
+ ),
227
+ "faas.instance" => ResourceAttr.new(
228
+ key: "faas.instance",
229
+ tier: "tier1",
230
+ requirement: Requirement::CONDITIONALLY_REQUIRED,
231
+ source: "detector",
232
+ role: "identifying"
233
+ ),
234
+ "faas.version" => ResourceAttr.new(
235
+ key: "faas.version",
236
+ tier: "tier1",
237
+ requirement: Requirement::RECOMMENDED,
238
+ source: "detector",
239
+ role: "descriptive"
240
+ ),
241
+ "vcs.ref.head.revision" => ResourceAttr.new(
242
+ key: "vcs.ref.head.revision",
243
+ tier: "tier2",
244
+ requirement: Requirement::RECOMMENDED,
245
+ source: "buildinfo",
246
+ role: "identifying"
247
+ ),
248
+ "vcs.ref.head.name" => ResourceAttr.new(
249
+ key: "vcs.ref.head.name",
250
+ tier: "tier2",
251
+ requirement: Requirement::OPT_IN,
252
+ source: "buildinfo",
253
+ role: "descriptive"
254
+ ),
255
+ "o11y.build.modified" => ResourceAttr.new(
256
+ key: "o11y.build.modified",
257
+ tier: "tier2",
258
+ requirement: Requirement::RECOMMENDED,
259
+ source: "buildinfo",
260
+ role: "descriptive"
261
+ ),
262
+ "o11y.build.time" => ResourceAttr.new(
263
+ key: "o11y.build.time",
264
+ tier: "tier2",
265
+ requirement: Requirement::RECOMMENDED,
266
+ source: "buildinfo",
267
+ role: "descriptive"
268
+ ),
269
+ "o11y.team.name" => ResourceAttr.new(
270
+ key: "o11y.team.name",
271
+ tier: "tier2",
272
+ requirement: Requirement::RECOMMENDED,
273
+ source: "option-or-collector",
274
+ role: "descriptive"
275
+ ),
276
+ "process.pid" => ResourceAttr.new(
277
+ key: "process.pid",
278
+ tier: "tier2",
279
+ requirement: Requirement::OPT_IN,
280
+ source: "detector",
281
+ role: "identifying"
282
+ ),
283
+ "os.type" => ResourceAttr.new(
284
+ key: "os.type",
285
+ tier: "tier2",
286
+ requirement: Requirement::OPT_IN,
287
+ source: "detector",
288
+ role: "identifying"
289
+ ),
290
+ "host.arch" => ResourceAttr.new(
291
+ key: "host.arch",
292
+ tier: "tier2",
293
+ requirement: Requirement::OPT_IN,
294
+ source: "detector",
295
+ role: "descriptive"
296
+ ),
297
+ "process.runtime.name" => ResourceAttr.new(
298
+ key: "process.runtime.name",
299
+ tier: "tier2",
300
+ requirement: Requirement::RECOMMENDED,
301
+ source: "detector",
302
+ role: "descriptive"
303
+ ),
304
+ "process.runtime.version" => ResourceAttr.new(
305
+ key: "process.runtime.version",
306
+ tier: "tier2",
307
+ requirement: Requirement::RECOMMENDED,
308
+ source: "detector",
309
+ role: "descriptive"
310
+ ),
311
+ "o11y.tenant.id" => ResourceAttr.new(
312
+ key: "o11y.tenant.id",
313
+ tier: "tier3",
314
+ requirement: Requirement::OPT_IN,
315
+ source: "option",
316
+ role: "descriptive"
317
+ ),
318
+ "o11y.cost_center" => ResourceAttr.new(
319
+ key: "o11y.cost_center",
320
+ tier: "tier3",
321
+ requirement: Requirement::OPT_IN,
322
+ source: "option-or-collector",
323
+ role: "descriptive"
324
+ ),
325
+ "o11y.data.classification" => ResourceAttr.new(
326
+ key: "o11y.data.classification",
327
+ tier: "tier3",
328
+ requirement: Requirement::OPT_IN,
329
+ source: "option",
330
+ role: "descriptive"
331
+ ),
332
+ "o11y.label" => ResourceAttr.new(
333
+ key: "o11y.label",
334
+ tier: "tier3",
335
+ requirement: Requirement::OPT_IN,
336
+ source: "option",
337
+ role: "descriptive"
338
+ ),
339
+ }.freeze
340
+
341
+ REQUIRED_TIER0 = ["service.name", "service.version", "deployment.environment.name", "telemetry.sdk.name", "telemetry.sdk.language", "telemetry.sdk.version"].freeze
342
+
343
+ ENVIRONMENT_VALUES = Set["production", "staging", "development", "test"].freeze
344
+
345
+ SENSITIVITY_OF = {
346
+ "cloud.account.id" => Sensitivity::INTERNAL,
347
+ "cloud.availability_zone" => Sensitivity::INTERNAL,
348
+ "cloud.platform" => Sensitivity::INTERNAL,
349
+ "cloud.provider" => Sensitivity::INTERNAL,
350
+ "cloud.region" => Sensitivity::INTERNAL,
351
+ "code.file.path" => Sensitivity::INTERNAL,
352
+ "code.function.name" => Sensitivity::PUBLIC,
353
+ "code.line.number" => Sensitivity::PUBLIC,
354
+ "container.id" => Sensitivity::INTERNAL,
355
+ "deployment.environment.name" => Sensitivity::PUBLIC,
356
+ "device.id" => Sensitivity::PII,
357
+ "error.type" => Sensitivity::PUBLIC,
358
+ "exception.message" => Sensitivity::INTERNAL,
359
+ "exception.stacktrace" => Sensitivity::INTERNAL,
360
+ "exception.type" => Sensitivity::PUBLIC,
361
+ "faas.instance" => Sensitivity::INTERNAL,
362
+ "faas.name" => Sensitivity::INTERNAL,
363
+ "faas.version" => Sensitivity::INTERNAL,
364
+ "geo.country.iso_code" => Sensitivity::PUBLIC,
365
+ "host.arch" => Sensitivity::PUBLIC,
366
+ "host.id" => Sensitivity::INTERNAL,
367
+ "host.ip" => Sensitivity::PII,
368
+ "host.mac" => Sensitivity::PII,
369
+ "host.name" => Sensitivity::INTERNAL,
370
+ "http.request.header.authorization" => Sensitivity::SECRET,
371
+ "http.request.header.cookie" => Sensitivity::SECRET,
372
+ "http.request.header.proxy-authorization" => Sensitivity::SECRET,
373
+ "http.response.header.set-cookie" => Sensitivity::SECRET,
374
+ "k8s.cluster.name" => Sensitivity::INTERNAL,
375
+ "k8s.container.name" => Sensitivity::INTERNAL,
376
+ "k8s.deployment.name" => Sensitivity::INTERNAL,
377
+ "k8s.namespace.name" => Sensitivity::INTERNAL,
378
+ "k8s.node.name" => Sensitivity::INTERNAL,
379
+ "k8s.pod.name" => Sensitivity::INTERNAL,
380
+ "k8s.pod.uid" => Sensitivity::INTERNAL,
381
+ "o11y.build.modified" => Sensitivity::PUBLIC,
382
+ "o11y.build.time" => Sensitivity::PUBLIC,
383
+ "o11y.config" => Sensitivity::PUBLIC,
384
+ "o11y.cost_center" => Sensitivity::INTERNAL,
385
+ "o11y.data.classification" => Sensitivity::INTERNAL,
386
+ "o11y.deprecated.vcs.modified" => Sensitivity::PUBLIC,
387
+ "o11y.deprecated.vcs.revision" => Sensitivity::PUBLIC,
388
+ "o11y.deprecated.vcs.time" => Sensitivity::PUBLIC,
389
+ "o11y.duration" => Sensitivity::PUBLIC,
390
+ "o11y.label" => Sensitivity::INTERNAL,
391
+ "o11y.log.source" => Sensitivity::PUBLIC,
392
+ "o11y.outcome" => Sensitivity::PUBLIC,
393
+ "o11y.record.class" => Sensitivity::PUBLIC,
394
+ "o11y.rule" => Sensitivity::PUBLIC,
395
+ "o11y.rum.action.name" => Sensitivity::INTERNAL,
396
+ "o11y.rum.action.type" => Sensitivity::PUBLIC,
397
+ "o11y.rum.app.update_id" => Sensitivity::PUBLIC,
398
+ "o11y.rum.browser.family" => Sensitivity::PUBLIC,
399
+ "o11y.rum.config.version" => Sensitivity::PUBLIC,
400
+ "o11y.rum.connection.effective" => Sensitivity::PUBLIC,
401
+ "o11y.rum.connection.type" => Sensitivity::PUBLIC,
402
+ "o11y.rum.device.class" => Sensitivity::PUBLIC,
403
+ "o11y.rum.element.selector" => Sensitivity::INTERNAL,
404
+ "o11y.rum.element.text" => Sensitivity::PII,
405
+ "o11y.rum.error.breadcrumbs" => Sensitivity::INTERNAL,
406
+ "o11y.rum.error.fingerprint" => Sensitivity::INTERNAL,
407
+ "o11y.rum.error.source" => Sensitivity::PUBLIC,
408
+ "o11y.rum.frustration.type" => Sensitivity::PUBLIC,
409
+ "o11y.rum.platform" => Sensitivity::PUBLIC,
410
+ "o11y.rum.replay.segment" => Sensitivity::PUBLIC,
411
+ "o11y.rum.resource.type" => Sensitivity::PUBLIC,
412
+ "o11y.rum.server_timing.duration" => Sensitivity::PUBLIC,
413
+ "o11y.rum.server_timing.name" => Sensitivity::PUBLIC,
414
+ "o11y.rum.session.retained" => Sensitivity::PUBLIC,
415
+ "o11y.rum.span.shape" => Sensitivity::PUBLIC,
416
+ "o11y.rum.summary.cls.value" => Sensitivity::PUBLIC,
417
+ "o11y.rum.summary.errors.anr" => Sensitivity::PUBLIC,
418
+ "o11y.rum.summary.errors.boundary" => Sensitivity::PUBLIC,
419
+ "o11y.rum.summary.errors.console" => Sensitivity::PUBLIC,
420
+ "o11y.rum.summary.errors.crash" => Sensitivity::PUBLIC,
421
+ "o11y.rum.summary.errors.csp" => Sensitivity::PUBLIC,
422
+ "o11y.rum.summary.errors.custom" => Sensitivity::PUBLIC,
423
+ "o11y.rum.summary.errors.hang" => Sensitivity::PUBLIC,
424
+ "o11y.rum.summary.errors.network" => Sensitivity::PUBLIC,
425
+ "o11y.rum.summary.errors.resource" => Sensitivity::PUBLIC,
426
+ "o11y.rum.summary.errors.uncaught" => Sensitivity::PUBLIC,
427
+ "o11y.rum.summary.errors.unhandled_rejection" => Sensitivity::PUBLIC,
428
+ "o11y.rum.summary.fcp.value" => Sensitivity::PUBLIC,
429
+ "o11y.rum.summary.frustrations.dead" => Sensitivity::PUBLIC,
430
+ "o11y.rum.summary.frustrations.error" => Sensitivity::PUBLIC,
431
+ "o11y.rum.summary.frustrations.rage" => Sensitivity::PUBLIC,
432
+ "o11y.rum.summary.inp.value" => Sensitivity::PUBLIC,
433
+ "o11y.rum.summary.lcp.value" => Sensitivity::PUBLIC,
434
+ "o11y.rum.summary.long_animation_frames" => Sensitivity::PUBLIC,
435
+ "o11y.rum.summary.requests" => Sensitivity::PUBLIC,
436
+ "o11y.rum.summary.seq" => Sensitivity::PUBLIC,
437
+ "o11y.rum.summary.time_on_view" => Sensitivity::PUBLIC,
438
+ "o11y.rum.summary.ttfb.value" => Sensitivity::PUBLIC,
439
+ "o11y.rum.view.id" => Sensitivity::INTERNAL,
440
+ "o11y.rum.view.kind" => Sensitivity::PUBLIC,
441
+ "o11y.rum.view.name" => Sensitivity::PUBLIC,
442
+ "o11y.rum.vital.attribution.element_render_delay" => Sensitivity::PUBLIC,
443
+ "o11y.rum.vital.attribution.input_delay" => Sensitivity::PUBLIC,
444
+ "o11y.rum.vital.attribution.interaction_type" => Sensitivity::PUBLIC,
445
+ "o11y.rum.vital.attribution.largest_shift_time" => Sensitivity::PUBLIC,
446
+ "o11y.rum.vital.attribution.largest_shift_value" => Sensitivity::PUBLIC,
447
+ "o11y.rum.vital.attribution.load_state" => Sensitivity::PUBLIC,
448
+ "o11y.rum.vital.attribution.presentation_delay" => Sensitivity::PUBLIC,
449
+ "o11y.rum.vital.attribution.processing_duration" => Sensitivity::PUBLIC,
450
+ "o11y.rum.vital.attribution.resource_load_delay" => Sensitivity::PUBLIC,
451
+ "o11y.rum.vital.attribution.resource_load_duration" => Sensitivity::PUBLIC,
452
+ "o11y.rum.vital.attribution.time_to_first_byte" => Sensitivity::PUBLIC,
453
+ "o11y.rum.vital.rating" => Sensitivity::PUBLIC,
454
+ "o11y.signal" => Sensitivity::PUBLIC,
455
+ "o11y.team.name" => Sensitivity::PUBLIC,
456
+ "o11y.tenant.id" => Sensitivity::INTERNAL,
457
+ "os.name" => Sensitivity::PUBLIC,
458
+ "os.type" => Sensitivity::PUBLIC,
459
+ "process.command_args" => Sensitivity::PII,
460
+ "process.command_line" => Sensitivity::PII,
461
+ "process.pid" => Sensitivity::INTERNAL,
462
+ "process.runtime.name" => Sensitivity::PUBLIC,
463
+ "process.runtime.version" => Sensitivity::PUBLIC,
464
+ "service.instance.id" => Sensitivity::INTERNAL,
465
+ "service.name" => Sensitivity::PUBLIC,
466
+ "service.namespace" => Sensitivity::PUBLIC,
467
+ "service.version" => Sensitivity::PUBLIC,
468
+ "session.id" => Sensitivity::INTERNAL,
469
+ "telemetry.distro.name" => Sensitivity::PUBLIC,
470
+ "telemetry.distro.version" => Sensitivity::PUBLIC,
471
+ "telemetry.sdk.language" => Sensitivity::PUBLIC,
472
+ "telemetry.sdk.name" => Sensitivity::PUBLIC,
473
+ "telemetry.sdk.version" => Sensitivity::PUBLIC,
474
+ "url.path" => Sensitivity::INTERNAL,
475
+ "vcs.ref.head.name" => Sensitivity::PUBLIC,
476
+ "vcs.ref.head.revision" => Sensitivity::PUBLIC,
477
+ }.freeze
478
+
479
+ CARDINALITY_OF = {
480
+ "device.id" => Cardinality::UNBOUNDED,
481
+ "error.type" => Cardinality::BOUNDED,
482
+ "geo.country.iso_code" => Cardinality::BOUNDED,
483
+ "host.ip" => Cardinality::UNBOUNDED,
484
+ "host.mac" => Cardinality::UNBOUNDED,
485
+ "http.request.header.authorization" => Cardinality::UNBOUNDED,
486
+ "http.request.header.cookie" => Cardinality::UNBOUNDED,
487
+ "http.request.header.proxy-authorization" => Cardinality::UNBOUNDED,
488
+ "http.response.header.set-cookie" => Cardinality::UNBOUNDED,
489
+ "o11y.build.modified" => Cardinality::ENUM,
490
+ "o11y.build.time" => Cardinality::BOUNDED,
491
+ "o11y.config" => Cardinality::BOUNDED,
492
+ "o11y.cost_center" => Cardinality::BOUNDED,
493
+ "o11y.data.classification" => Cardinality::ENUM,
494
+ "o11y.duration" => Cardinality::UNBOUNDED,
495
+ "o11y.label" => Cardinality::UNBOUNDED,
496
+ "o11y.log.source" => Cardinality::ENUM,
497
+ "o11y.outcome" => Cardinality::ENUM,
498
+ "o11y.record.class" => Cardinality::ENUM,
499
+ "o11y.rule" => Cardinality::BOUNDED,
500
+ "o11y.rum.action.name" => Cardinality::BOUNDED,
501
+ "o11y.rum.action.type" => Cardinality::ENUM,
502
+ "o11y.rum.app.update_id" => Cardinality::BOUNDED,
503
+ "o11y.rum.browser.family" => Cardinality::BOUNDED,
504
+ "o11y.rum.config.version" => Cardinality::BOUNDED,
505
+ "o11y.rum.connection.effective" => Cardinality::ENUM,
506
+ "o11y.rum.connection.type" => Cardinality::ENUM,
507
+ "o11y.rum.device.class" => Cardinality::ENUM,
508
+ "o11y.rum.element.selector" => Cardinality::UNBOUNDED,
509
+ "o11y.rum.element.text" => Cardinality::UNBOUNDED,
510
+ "o11y.rum.error.breadcrumbs" => Cardinality::UNBOUNDED,
511
+ "o11y.rum.error.fingerprint" => Cardinality::BOUNDED,
512
+ "o11y.rum.error.source" => Cardinality::ENUM,
513
+ "o11y.rum.frustration.type" => Cardinality::ENUM,
514
+ "o11y.rum.platform" => Cardinality::ENUM,
515
+ "o11y.rum.replay.segment" => Cardinality::UNBOUNDED,
516
+ "o11y.rum.resource.type" => Cardinality::ENUM,
517
+ "o11y.rum.server_timing.duration" => Cardinality::UNBOUNDED,
518
+ "o11y.rum.server_timing.name" => Cardinality::BOUNDED,
519
+ "o11y.rum.session.retained" => Cardinality::ENUM,
520
+ "o11y.rum.span.shape" => Cardinality::ENUM,
521
+ "o11y.rum.summary.cls.value" => Cardinality::UNBOUNDED,
522
+ "o11y.rum.summary.errors.anr" => Cardinality::UNBOUNDED,
523
+ "o11y.rum.summary.errors.boundary" => Cardinality::UNBOUNDED,
524
+ "o11y.rum.summary.errors.console" => Cardinality::UNBOUNDED,
525
+ "o11y.rum.summary.errors.crash" => Cardinality::UNBOUNDED,
526
+ "o11y.rum.summary.errors.csp" => Cardinality::UNBOUNDED,
527
+ "o11y.rum.summary.errors.custom" => Cardinality::UNBOUNDED,
528
+ "o11y.rum.summary.errors.hang" => Cardinality::UNBOUNDED,
529
+ "o11y.rum.summary.errors.network" => Cardinality::UNBOUNDED,
530
+ "o11y.rum.summary.errors.resource" => Cardinality::UNBOUNDED,
531
+ "o11y.rum.summary.errors.uncaught" => Cardinality::UNBOUNDED,
532
+ "o11y.rum.summary.errors.unhandled_rejection" => Cardinality::UNBOUNDED,
533
+ "o11y.rum.summary.fcp.value" => Cardinality::UNBOUNDED,
534
+ "o11y.rum.summary.frustrations.dead" => Cardinality::UNBOUNDED,
535
+ "o11y.rum.summary.frustrations.error" => Cardinality::UNBOUNDED,
536
+ "o11y.rum.summary.frustrations.rage" => Cardinality::UNBOUNDED,
537
+ "o11y.rum.summary.inp.value" => Cardinality::UNBOUNDED,
538
+ "o11y.rum.summary.lcp.value" => Cardinality::UNBOUNDED,
539
+ "o11y.rum.summary.long_animation_frames" => Cardinality::UNBOUNDED,
540
+ "o11y.rum.summary.requests" => Cardinality::UNBOUNDED,
541
+ "o11y.rum.summary.seq" => Cardinality::UNBOUNDED,
542
+ "o11y.rum.summary.time_on_view" => Cardinality::UNBOUNDED,
543
+ "o11y.rum.summary.ttfb.value" => Cardinality::UNBOUNDED,
544
+ "o11y.rum.view.id" => Cardinality::UNBOUNDED,
545
+ "o11y.rum.view.kind" => Cardinality::ENUM,
546
+ "o11y.rum.view.name" => Cardinality::BOUNDED,
547
+ "o11y.rum.vital.attribution.element_render_delay" => Cardinality::UNBOUNDED,
548
+ "o11y.rum.vital.attribution.input_delay" => Cardinality::UNBOUNDED,
549
+ "o11y.rum.vital.attribution.interaction_type" => Cardinality::ENUM,
550
+ "o11y.rum.vital.attribution.largest_shift_time" => Cardinality::UNBOUNDED,
551
+ "o11y.rum.vital.attribution.largest_shift_value" => Cardinality::UNBOUNDED,
552
+ "o11y.rum.vital.attribution.load_state" => Cardinality::ENUM,
553
+ "o11y.rum.vital.attribution.presentation_delay" => Cardinality::UNBOUNDED,
554
+ "o11y.rum.vital.attribution.processing_duration" => Cardinality::UNBOUNDED,
555
+ "o11y.rum.vital.attribution.resource_load_delay" => Cardinality::UNBOUNDED,
556
+ "o11y.rum.vital.attribution.resource_load_duration" => Cardinality::UNBOUNDED,
557
+ "o11y.rum.vital.attribution.time_to_first_byte" => Cardinality::UNBOUNDED,
558
+ "o11y.rum.vital.rating" => Cardinality::ENUM,
559
+ "o11y.signal" => Cardinality::ENUM,
560
+ "o11y.team.name" => Cardinality::BOUNDED,
561
+ "o11y.tenant.id" => Cardinality::UNBOUNDED,
562
+ "os.name" => Cardinality::BOUNDED,
563
+ "process.command_args" => Cardinality::UNBOUNDED,
564
+ "process.command_line" => Cardinality::UNBOUNDED,
565
+ "service.name" => Cardinality::BOUNDED,
566
+ "session.id" => Cardinality::UNBOUNDED,
567
+ "url.path" => Cardinality::UNBOUNDED,
568
+ }.freeze
569
+
570
+ LEGACY_KEYS = {
571
+ "vcs.modified" => "o11y.build.modified",
572
+ "vcs.revision" => "vcs.ref.head.revision",
573
+ "vcs.time" => "o11y.build.time",
574
+ }.freeze
575
+
576
+ METRIC_RESOURCE_LABELS = ["service.name", "service.namespace", "service.instance.id", "deployment.environment.name", "service.version"].freeze
577
+
578
+ EVENTS = {
579
+ "o11y.telemetry.configured" => EventInfo.new(
580
+ name: "o11y.telemetry.configured",
581
+ required: [].freeze,
582
+ required_templates: ["o11y.config"].freeze
583
+ ),
584
+ "o11y.request.summary" => EventInfo.new(
585
+ name: "o11y.request.summary",
586
+ required: ["http.request.method", "http.response.status_code", "o11y.outcome", "o11y.duration"].freeze,
587
+ required_templates: [].freeze
588
+ ),
589
+ "o11y.telemetry.dropped" => EventInfo.new(
590
+ name: "o11y.telemetry.dropped",
591
+ required: ["o11y.signal", "error.type"].freeze,
592
+ required_templates: [].freeze
593
+ ),
594
+ "o11y.rum.error" => EventInfo.new(
595
+ name: "o11y.rum.error",
596
+ required: ["o11y.rum.error.source", "exception.type", "session.id", "o11y.rum.view.id"].freeze,
597
+ required_templates: [].freeze
598
+ ),
599
+ "o11y.rum.frustration" => EventInfo.new(
600
+ name: "o11y.rum.frustration",
601
+ required: ["o11y.rum.frustration.type", "session.id", "o11y.rum.view.id"].freeze,
602
+ required_templates: [].freeze
603
+ ),
604
+ "o11y.rum.session.start" => EventInfo.new(
605
+ name: "o11y.rum.session.start",
606
+ required: ["session.id", "o11y.rum.platform"].freeze,
607
+ required_templates: [].freeze
608
+ ),
609
+ "o11y.rum.session.end" => EventInfo.new(
610
+ name: "o11y.rum.session.end",
611
+ required: ["session.id", "o11y.rum.session.retained"].freeze,
612
+ required_templates: [].freeze
613
+ ),
614
+ "o11y.rum.view.summary" => EventInfo.new(
615
+ name: "o11y.rum.view.summary",
616
+ required: ["o11y.rum.platform", "o11y.rum.view.id", "o11y.rum.view.name", "o11y.rum.view.kind", "session.id", "o11y.rum.summary.seq", "o11y.rum.summary.time_on_view"].freeze,
617
+ required_templates: [].freeze
618
+ ),
619
+ }.freeze
620
+
621
+ METRICS = {
622
+ "o11y.schema.violations" => MetricInfo.new(
623
+ name: "o11y.schema.violations",
624
+ instrument: Instrument::COUNTER,
625
+ unit: "{violation}"
626
+ ),
627
+ "o11y.rum.vital.lcp" => MetricInfo.new(
628
+ name: "o11y.rum.vital.lcp",
629
+ instrument: Instrument::HISTOGRAM,
630
+ unit: "s"
631
+ ),
632
+ "o11y.rum.vital.inp" => MetricInfo.new(
633
+ name: "o11y.rum.vital.inp",
634
+ instrument: Instrument::HISTOGRAM,
635
+ unit: "s"
636
+ ),
637
+ "o11y.rum.vital.cls" => MetricInfo.new(
638
+ name: "o11y.rum.vital.cls",
639
+ instrument: Instrument::HISTOGRAM,
640
+ unit: "1"
641
+ ),
642
+ "o11y.rum.vital.fcp" => MetricInfo.new(
643
+ name: "o11y.rum.vital.fcp",
644
+ instrument: Instrument::HISTOGRAM,
645
+ unit: "s"
646
+ ),
647
+ "o11y.rum.vital.ttfb" => MetricInfo.new(
648
+ name: "o11y.rum.vital.ttfb",
649
+ instrument: Instrument::HISTOGRAM,
650
+ unit: "s"
651
+ ),
652
+ "o11y.rum.browser.long_animation_frames" => MetricInfo.new(
653
+ name: "o11y.rum.browser.long_animation_frames",
654
+ instrument: Instrument::COUNTER,
655
+ unit: "{frame}"
656
+ ),
657
+ "o11y.rum.views" => MetricInfo.new(
658
+ name: "o11y.rum.views",
659
+ instrument: Instrument::COUNTER,
660
+ unit: "{view}"
661
+ ),
662
+ "o11y.rum.errors" => MetricInfo.new(
663
+ name: "o11y.rum.errors",
664
+ instrument: Instrument::COUNTER,
665
+ unit: "{error}"
666
+ ),
667
+ "o11y.rum.frustrations" => MetricInfo.new(
668
+ name: "o11y.rum.frustrations",
669
+ instrument: Instrument::COUNTER,
670
+ unit: "{signal}"
671
+ ),
672
+ }.freeze
673
+
674
+ SPAN_REQUIRED = {
675
+ "server" => ["http.request.method", "url.path", "url.scheme"].freeze,
676
+ "client" => ["http.request.method", "server.address", "server.port", "url.full"].freeze,
677
+ }.freeze
678
+
679
+ RUM_SPAN_REQUIRED = {
680
+ "view" => ["o11y.rum.span.shape", "o11y.rum.platform", "o11y.rum.view.name", "o11y.rum.view.id", "o11y.rum.view.kind", "session.id"].freeze,
681
+ "action" => ["o11y.rum.span.shape", "o11y.rum.action.type", "o11y.rum.view.id", "session.id"].freeze,
682
+ "app_load" => ["o11y.rum.span.shape", "o11y.rum.platform", "o11y.rum.view.id", "session.id"].freeze,
683
+ }.freeze
684
+
685
+ APP_REGISTRY_SCHEMA = "libo11y.app-registry/v1"
686
+
687
+ APP_RESERVED_NAMESPACES = Set[
688
+ "android",
689
+ "app",
690
+ "artifact",
691
+ "aspnetcore",
692
+ "aws",
693
+ "az",
694
+ "azure",
695
+ "browser",
696
+ "cassandra",
697
+ "cicd",
698
+ "cli",
699
+ "client",
700
+ "cloud",
701
+ "cloudevents",
702
+ "cloudfoundry",
703
+ "code",
704
+ "container",
705
+ "cpu",
706
+ "cpython",
707
+ "db",
708
+ "deployment",
709
+ "destination",
710
+ "device",
711
+ "disk",
712
+ "dns",
713
+ "dotnet",
714
+ "elasticsearch",
715
+ "enduser",
716
+ "error",
717
+ "event",
718
+ "exception",
719
+ "faas",
720
+ "feature_flag",
721
+ "file",
722
+ "gcp",
723
+ "gen_ai",
724
+ "geo",
725
+ "go",
726
+ "graphql",
727
+ "hardware",
728
+ "heroku",
729
+ "host",
730
+ "http",
731
+ "hw",
732
+ "ios",
733
+ "jsonrpc",
734
+ "jvm",
735
+ "k8s",
736
+ "kestrel",
737
+ "linux",
738
+ "log",
739
+ "mainframe",
740
+ "mcp",
741
+ "message",
742
+ "messaging",
743
+ "net",
744
+ "network",
745
+ "nfs",
746
+ "nodejs",
747
+ "o11y",
748
+ "oci",
749
+ "onc_rpc",
750
+ "openai",
751
+ "openshift",
752
+ "opentracing",
753
+ "oracle",
754
+ "oracle_cloud",
755
+ "oracledb",
756
+ "os",
757
+ "otel",
758
+ "peer",
759
+ "pool",
760
+ "pprof",
761
+ "process",
762
+ "profile",
763
+ "rpc",
764
+ "security_rule",
765
+ "server",
766
+ "service",
767
+ "session",
768
+ "signalr",
769
+ "source",
770
+ "state",
771
+ "system",
772
+ "telemetry",
773
+ "test",
774
+ "thread",
775
+ "tls",
776
+ "url",
777
+ "user",
778
+ "user_agent",
779
+ "v8js",
780
+ "vcs",
781
+ "webengine",
782
+ "zos",
783
+ ].freeze
784
+ end
785
+ end