opentelemetry-config 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,1360 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright The OpenTelemetry Authors
4
+ # SPDX-License-Identifier: Apache-2.0
5
+ #
6
+ # DO NOT EDIT — generated by `bundle exec rake generate:constants`
7
+ # Schema: open-telemetry/opentelemetry-configuration v1.0.0-rc.3
8
+ # Structs: 74 (one per object definition in the schema)
9
+ # To regenerate: bundle exec rake generate:constants
10
+
11
+ module OpenTelemetry
12
+ module Config
13
+ # Generated struct definitions mirroring the OpenTelemetry configuration schema.
14
+ module Model
15
+ Aggregation = Struct.new(
16
+ :default,
17
+ :drop,
18
+ :explicit_bucket_histogram,
19
+ :base2_exponential_bucket_histogram,
20
+ :last_value,
21
+ :sum,
22
+ keyword_init: true
23
+ ) do
24
+ def self.from_hash(h)
25
+ return nil unless h.is_a?(Hash)
26
+
27
+ new(
28
+ default: h.key?('default'),
29
+ drop: h.key?('drop'),
30
+ explicit_bucket_histogram: ExplicitBucketHistogramAggregation.from_hash(h['explicit_bucket_histogram']),
31
+ base2_exponential_bucket_histogram: Base2ExponentialBucketHistogramAggregation.from_hash(h['base2_exponential_bucket_histogram']),
32
+ last_value: h.key?('last_value'),
33
+ sum: h.key?('sum')
34
+ )
35
+ end
36
+ end
37
+
38
+ AttributeLimits = Struct.new(
39
+ :attribute_value_length_limit,
40
+ :attribute_count_limit,
41
+ keyword_init: true
42
+ ) do
43
+ def self.from_hash(h)
44
+ return nil unless h.is_a?(Hash)
45
+
46
+ new(
47
+ attribute_value_length_limit: h['attribute_value_length_limit'],
48
+ attribute_count_limit: h['attribute_count_limit']
49
+ )
50
+ end
51
+ end
52
+
53
+ AttributeNameValue = Struct.new(
54
+ :name,
55
+ :value,
56
+ :type,
57
+ keyword_init: true
58
+ ) do
59
+ def self.from_hash(h)
60
+ return nil unless h.is_a?(Hash)
61
+
62
+ new(
63
+ name: h['name'],
64
+ value: h['value'],
65
+ type: h['type']
66
+ )
67
+ end
68
+ end
69
+
70
+ Base2ExponentialBucketHistogramAggregation = Struct.new(
71
+ :max_scale,
72
+ :max_size,
73
+ :record_min_max,
74
+ keyword_init: true
75
+ ) do
76
+ def self.from_hash(h)
77
+ return nil unless h.is_a?(Hash)
78
+
79
+ new(
80
+ max_scale: h['max_scale'],
81
+ max_size: h['max_size'],
82
+ record_min_max: h['record_min_max']
83
+ )
84
+ end
85
+ end
86
+
87
+ BatchLogRecordProcessor = Struct.new(
88
+ :schedule_delay,
89
+ :export_timeout,
90
+ :max_queue_size,
91
+ :max_export_batch_size,
92
+ :exporter,
93
+ keyword_init: true
94
+ ) do
95
+ def self.from_hash(h)
96
+ return nil unless h.is_a?(Hash)
97
+
98
+ new(
99
+ schedule_delay: h['schedule_delay'],
100
+ export_timeout: h['export_timeout'],
101
+ max_queue_size: h['max_queue_size'],
102
+ max_export_batch_size: h['max_export_batch_size'],
103
+ exporter: LogRecordExporter.from_hash(h['exporter'])
104
+ )
105
+ end
106
+ end
107
+
108
+ BatchSpanProcessor = Struct.new(
109
+ :schedule_delay,
110
+ :export_timeout,
111
+ :max_queue_size,
112
+ :max_export_batch_size,
113
+ :exporter,
114
+ keyword_init: true
115
+ ) do
116
+ def self.from_hash(h)
117
+ return nil unless h.is_a?(Hash)
118
+
119
+ new(
120
+ schedule_delay: h['schedule_delay'],
121
+ export_timeout: h['export_timeout'],
122
+ max_queue_size: h['max_queue_size'],
123
+ max_export_batch_size: h['max_export_batch_size'],
124
+ exporter: SpanExporter.from_hash(h['exporter'])
125
+ )
126
+ end
127
+ end
128
+
129
+ CardinalityLimits = Struct.new(
130
+ :default,
131
+ :counter,
132
+ :gauge,
133
+ :histogram,
134
+ :observable_counter,
135
+ :observable_gauge,
136
+ :observable_up_down_counter,
137
+ :up_down_counter,
138
+ keyword_init: true
139
+ ) do
140
+ def self.from_hash(h)
141
+ return nil unless h.is_a?(Hash)
142
+
143
+ new(
144
+ default: h['default'],
145
+ counter: h['counter'],
146
+ gauge: h['gauge'],
147
+ histogram: h['histogram'],
148
+ observable_counter: h['observable_counter'],
149
+ observable_gauge: h['observable_gauge'],
150
+ observable_up_down_counter: h['observable_up_down_counter'],
151
+ up_down_counter: h['up_down_counter']
152
+ )
153
+ end
154
+ end
155
+
156
+ ConsoleMetricExporter = Struct.new(
157
+ :temporality_preference,
158
+ :default_histogram_aggregation,
159
+ keyword_init: true
160
+ ) do
161
+ def self.from_hash(h)
162
+ return nil unless h.is_a?(Hash)
163
+
164
+ new(
165
+ temporality_preference: h['temporality_preference'],
166
+ default_histogram_aggregation: h['default_histogram_aggregation']
167
+ )
168
+ end
169
+ end
170
+
171
+ ExperimentalComposableParentThresholdSampler = Struct.new(
172
+ :root,
173
+ keyword_init: true
174
+ ) do
175
+ def self.from_hash(h)
176
+ return nil unless h.is_a?(Hash)
177
+
178
+ new(
179
+ root: ExperimentalComposableSampler.from_hash(h['root'])
180
+ )
181
+ end
182
+ end
183
+
184
+ ExperimentalComposableProbabilitySampler = Struct.new(
185
+ :ratio,
186
+ keyword_init: true
187
+ ) do
188
+ def self.from_hash(h)
189
+ return nil unless h.is_a?(Hash)
190
+
191
+ new(
192
+ ratio: h['ratio']
193
+ )
194
+ end
195
+ end
196
+
197
+ ExperimentalComposableRuleBasedSampler = Struct.new(
198
+ :rules,
199
+ keyword_init: true
200
+ ) do
201
+ def self.from_hash(h)
202
+ return nil unless h.is_a?(Hash)
203
+
204
+ new(
205
+ rules: Array(h['rules']).filter_map { |e| ExperimentalComposableRuleBasedSamplerRule.from_hash(e) }
206
+ )
207
+ end
208
+ end
209
+
210
+ ExperimentalComposableRuleBasedSamplerRule = Struct.new(
211
+ :attribute_values,
212
+ :attribute_patterns,
213
+ :span_kinds,
214
+ :parent,
215
+ :sampler,
216
+ keyword_init: true
217
+ ) do
218
+ def self.from_hash(h)
219
+ return nil unless h.is_a?(Hash)
220
+
221
+ new(
222
+ attribute_values: ExperimentalComposableRuleBasedSamplerRuleAttributeValues.from_hash(h['attribute_values']),
223
+ attribute_patterns: ExperimentalComposableRuleBasedSamplerRuleAttributePatterns.from_hash(h['attribute_patterns']),
224
+ span_kinds: h['span_kinds'],
225
+ parent: h['parent'],
226
+ sampler: ExperimentalComposableSampler.from_hash(h['sampler'])
227
+ )
228
+ end
229
+ end
230
+
231
+ ExperimentalComposableRuleBasedSamplerRuleAttributePatterns = Struct.new(
232
+ :key,
233
+ :included,
234
+ :excluded,
235
+ keyword_init: true
236
+ ) do
237
+ def self.from_hash(h)
238
+ return nil unless h.is_a?(Hash)
239
+
240
+ new(
241
+ key: h['key'],
242
+ included: h['included'],
243
+ excluded: h['excluded']
244
+ )
245
+ end
246
+ end
247
+
248
+ ExperimentalComposableRuleBasedSamplerRuleAttributeValues = Struct.new(
249
+ :key,
250
+ :values,
251
+ keyword_init: true
252
+ ) do
253
+ def self.from_hash(h)
254
+ return nil unless h.is_a?(Hash)
255
+
256
+ new(
257
+ key: h['key'],
258
+ values: h['values']
259
+ )
260
+ end
261
+ end
262
+
263
+ ExperimentalComposableSampler = Struct.new(
264
+ :always_off,
265
+ :always_on,
266
+ :parent_threshold,
267
+ :probability,
268
+ :rule_based,
269
+ :additional_properties,
270
+ keyword_init: true
271
+ ) do
272
+ def self.from_hash(h)
273
+ return nil unless h.is_a?(Hash)
274
+
275
+ new(
276
+ always_off: h.key?('always_off'),
277
+ always_on: h.key?('always_on'),
278
+ parent_threshold: ExperimentalComposableParentThresholdSampler.from_hash(h['parent_threshold']),
279
+ probability: ExperimentalComposableProbabilitySampler.from_hash(h['probability']),
280
+ rule_based: ExperimentalComposableRuleBasedSampler.from_hash(h['rule_based']),
281
+ additional_properties: h.except('always_off', 'always_on', 'parent_threshold', 'probability', 'rule_based')
282
+ )
283
+ end
284
+ end
285
+
286
+ ExperimentalGeneralInstrumentation = Struct.new(
287
+ :peer,
288
+ :http,
289
+ keyword_init: true
290
+ ) do
291
+ def self.from_hash(h)
292
+ return nil unless h.is_a?(Hash)
293
+
294
+ new(
295
+ peer: ExperimentalPeerInstrumentation.from_hash(h['peer']),
296
+ http: ExperimentalHttpInstrumentation.from_hash(h['http'])
297
+ )
298
+ end
299
+ end
300
+
301
+ ExperimentalHttpClientInstrumentation = Struct.new(
302
+ :request_captured_headers,
303
+ :response_captured_headers,
304
+ keyword_init: true
305
+ ) do
306
+ def self.from_hash(h)
307
+ return nil unless h.is_a?(Hash)
308
+
309
+ new(
310
+ request_captured_headers: h['request_captured_headers'],
311
+ response_captured_headers: h['response_captured_headers']
312
+ )
313
+ end
314
+ end
315
+
316
+ ExperimentalHttpInstrumentation = Struct.new(
317
+ :client,
318
+ :server,
319
+ keyword_init: true
320
+ ) do
321
+ def self.from_hash(h)
322
+ return nil unless h.is_a?(Hash)
323
+
324
+ new(
325
+ client: ExperimentalHttpClientInstrumentation.from_hash(h['client']),
326
+ server: ExperimentalHttpServerInstrumentation.from_hash(h['server'])
327
+ )
328
+ end
329
+ end
330
+
331
+ ExperimentalHttpServerInstrumentation = Struct.new(
332
+ :request_captured_headers,
333
+ :response_captured_headers,
334
+ keyword_init: true
335
+ ) do
336
+ def self.from_hash(h)
337
+ return nil unless h.is_a?(Hash)
338
+
339
+ new(
340
+ request_captured_headers: h['request_captured_headers'],
341
+ response_captured_headers: h['response_captured_headers']
342
+ )
343
+ end
344
+ end
345
+
346
+ ExperimentalInstrumentation = Struct.new(
347
+ :general,
348
+ :cpp,
349
+ :dotnet,
350
+ :erlang,
351
+ :go,
352
+ :java,
353
+ :js,
354
+ :php,
355
+ :python,
356
+ :ruby,
357
+ :rust,
358
+ :swift,
359
+ keyword_init: true
360
+ ) do
361
+ def self.from_hash(h)
362
+ return nil unless h.is_a?(Hash)
363
+
364
+ new(
365
+ general: ExperimentalGeneralInstrumentation.from_hash(h['general']),
366
+ cpp: h['cpp'],
367
+ dotnet: h['dotnet'],
368
+ erlang: h['erlang'],
369
+ go: h['go'],
370
+ java: h['java'],
371
+ js: h['js'],
372
+ php: h['php'],
373
+ python: h['python'],
374
+ ruby: h['ruby'],
375
+ rust: h['rust'],
376
+ swift: h['swift']
377
+ )
378
+ end
379
+ end
380
+
381
+ ExperimentalJaegerRemoteSampler = Struct.new(
382
+ :endpoint,
383
+ :interval,
384
+ :initial_sampler,
385
+ keyword_init: true
386
+ ) do
387
+ def self.from_hash(h)
388
+ return nil unless h.is_a?(Hash)
389
+
390
+ new(
391
+ endpoint: h['endpoint'],
392
+ interval: h['interval'],
393
+ initial_sampler: Sampler.from_hash(h['initial_sampler'])
394
+ )
395
+ end
396
+ end
397
+
398
+ ExperimentalLoggerConfig = Struct.new(
399
+ :disabled,
400
+ :minimum_severity,
401
+ :trace_based,
402
+ keyword_init: true
403
+ ) do
404
+ def self.from_hash(h)
405
+ return nil unless h.is_a?(Hash)
406
+
407
+ new(
408
+ disabled: h['disabled'],
409
+ minimum_severity: h['minimum_severity'],
410
+ trace_based: h['trace_based']
411
+ )
412
+ end
413
+ end
414
+
415
+ ExperimentalLoggerConfigurator = Struct.new(
416
+ :default_config,
417
+ :loggers,
418
+ keyword_init: true
419
+ ) do
420
+ def self.from_hash(h)
421
+ return nil unless h.is_a?(Hash)
422
+
423
+ new(
424
+ default_config: ExperimentalLoggerConfig.from_hash(h['default_config']),
425
+ loggers: Array(h['loggers']).filter_map { |e| ExperimentalLoggerMatcherAndConfig.from_hash(e) }
426
+ )
427
+ end
428
+ end
429
+
430
+ ExperimentalLoggerMatcherAndConfig = Struct.new(
431
+ :name,
432
+ :config,
433
+ keyword_init: true
434
+ ) do
435
+ def self.from_hash(h)
436
+ return nil unless h.is_a?(Hash)
437
+
438
+ new(
439
+ name: h['name'],
440
+ config: ExperimentalLoggerConfig.from_hash(h['config'])
441
+ )
442
+ end
443
+ end
444
+
445
+ ExperimentalMeterConfig = Struct.new(
446
+ :disabled,
447
+ keyword_init: true
448
+ ) do
449
+ def self.from_hash(h)
450
+ return nil unless h.is_a?(Hash)
451
+
452
+ new(
453
+ disabled: h['disabled']
454
+ )
455
+ end
456
+ end
457
+
458
+ ExperimentalMeterConfigurator = Struct.new(
459
+ :default_config,
460
+ :meters,
461
+ keyword_init: true
462
+ ) do
463
+ def self.from_hash(h)
464
+ return nil unless h.is_a?(Hash)
465
+
466
+ new(
467
+ default_config: ExperimentalMeterConfig.from_hash(h['default_config']),
468
+ meters: Array(h['meters']).filter_map { |e| ExperimentalMeterMatcherAndConfig.from_hash(e) }
469
+ )
470
+ end
471
+ end
472
+
473
+ ExperimentalMeterMatcherAndConfig = Struct.new(
474
+ :name,
475
+ :config,
476
+ keyword_init: true
477
+ ) do
478
+ def self.from_hash(h)
479
+ return nil unless h.is_a?(Hash)
480
+
481
+ new(
482
+ name: h['name'],
483
+ config: ExperimentalMeterConfig.from_hash(h['config'])
484
+ )
485
+ end
486
+ end
487
+
488
+ ExperimentalOtlpFileExporter = Struct.new(
489
+ :output_stream,
490
+ keyword_init: true
491
+ ) do
492
+ def self.from_hash(h)
493
+ return nil unless h.is_a?(Hash)
494
+
495
+ new(
496
+ output_stream: h['output_stream']
497
+ )
498
+ end
499
+ end
500
+
501
+ ExperimentalOtlpFileMetricExporter = Struct.new(
502
+ :output_stream,
503
+ :temporality_preference,
504
+ :default_histogram_aggregation,
505
+ keyword_init: true
506
+ ) do
507
+ def self.from_hash(h)
508
+ return nil unless h.is_a?(Hash)
509
+
510
+ new(
511
+ output_stream: h['output_stream'],
512
+ temporality_preference: h['temporality_preference'],
513
+ default_histogram_aggregation: h['default_histogram_aggregation']
514
+ )
515
+ end
516
+ end
517
+
518
+ ExperimentalPeerInstrumentation = Struct.new(
519
+ :service_mapping,
520
+ keyword_init: true
521
+ ) do
522
+ def self.from_hash(h)
523
+ return nil unless h.is_a?(Hash)
524
+
525
+ new(
526
+ service_mapping: Array(h['service_mapping']).filter_map { |e| ExperimentalPeerServiceMapping.from_hash(e) }
527
+ )
528
+ end
529
+ end
530
+
531
+ ExperimentalPeerServiceMapping = Struct.new(
532
+ :peer,
533
+ :service,
534
+ keyword_init: true
535
+ ) do
536
+ def self.from_hash(h)
537
+ return nil unless h.is_a?(Hash)
538
+
539
+ new(
540
+ peer: h['peer'],
541
+ service: h['service']
542
+ )
543
+ end
544
+ end
545
+
546
+ ExperimentalProbabilitySampler = Struct.new(
547
+ :ratio,
548
+ keyword_init: true
549
+ ) do
550
+ def self.from_hash(h)
551
+ return nil unless h.is_a?(Hash)
552
+
553
+ new(
554
+ ratio: h['ratio']
555
+ )
556
+ end
557
+ end
558
+
559
+ ExperimentalPrometheusMetricExporter = Struct.new(
560
+ :host,
561
+ :port,
562
+ :without_scope_info,
563
+ :without_target_info,
564
+ :with_resource_constant_labels,
565
+ :translation_strategy,
566
+ keyword_init: true
567
+ ) do
568
+ def self.from_hash(h)
569
+ return nil unless h.is_a?(Hash)
570
+
571
+ new(
572
+ host: h['host'],
573
+ port: h['port'],
574
+ without_scope_info: h['without_scope_info'],
575
+ without_target_info: h['without_target_info'],
576
+ with_resource_constant_labels: IncludeExclude.from_hash(h['with_resource_constant_labels']),
577
+ translation_strategy: h['translation_strategy']
578
+ )
579
+ end
580
+ end
581
+
582
+ ExperimentalResourceDetection = Struct.new(
583
+ :attributes,
584
+ :detectors,
585
+ keyword_init: true
586
+ ) do
587
+ def self.from_hash(h)
588
+ return nil unless h.is_a?(Hash)
589
+
590
+ new(
591
+ attributes: IncludeExclude.from_hash(h['attributes']),
592
+ detectors: Array(h['detectors']).filter_map { |e| ExperimentalResourceDetector.from_hash(e) }
593
+ )
594
+ end
595
+ end
596
+
597
+ ExperimentalResourceDetector = Struct.new(
598
+ :container,
599
+ :host,
600
+ :process,
601
+ :service,
602
+ :additional_properties,
603
+ keyword_init: true
604
+ ) do
605
+ def self.from_hash(h)
606
+ return nil unless h.is_a?(Hash)
607
+
608
+ new(
609
+ container: h.key?('container'),
610
+ host: h.key?('host'),
611
+ process: h.key?('process'),
612
+ service: h.key?('service'),
613
+ additional_properties: h.except('container', 'host', 'process', 'service')
614
+ )
615
+ end
616
+ end
617
+
618
+ ExperimentalTracerConfig = Struct.new(
619
+ :disabled,
620
+ keyword_init: true
621
+ ) do
622
+ def self.from_hash(h)
623
+ return nil unless h.is_a?(Hash)
624
+
625
+ new(
626
+ disabled: h['disabled']
627
+ )
628
+ end
629
+ end
630
+
631
+ ExperimentalTracerConfigurator = Struct.new(
632
+ :default_config,
633
+ :tracers,
634
+ keyword_init: true
635
+ ) do
636
+ def self.from_hash(h)
637
+ return nil unless h.is_a?(Hash)
638
+
639
+ new(
640
+ default_config: ExperimentalTracerConfig.from_hash(h['default_config']),
641
+ tracers: Array(h['tracers']).filter_map { |e| ExperimentalTracerMatcherAndConfig.from_hash(e) }
642
+ )
643
+ end
644
+ end
645
+
646
+ ExperimentalTracerMatcherAndConfig = Struct.new(
647
+ :name,
648
+ :config,
649
+ keyword_init: true
650
+ ) do
651
+ def self.from_hash(h)
652
+ return nil unless h.is_a?(Hash)
653
+
654
+ new(
655
+ name: h['name'],
656
+ config: ExperimentalTracerConfig.from_hash(h['config'])
657
+ )
658
+ end
659
+ end
660
+
661
+ ExplicitBucketHistogramAggregation = Struct.new(
662
+ :boundaries,
663
+ :record_min_max,
664
+ keyword_init: true
665
+ ) do
666
+ def self.from_hash(h)
667
+ return nil unless h.is_a?(Hash)
668
+
669
+ new(
670
+ boundaries: h['boundaries'],
671
+ record_min_max: h['record_min_max']
672
+ )
673
+ end
674
+ end
675
+
676
+ GrpcTls = Struct.new(
677
+ :ca_file,
678
+ :key_file,
679
+ :cert_file,
680
+ :insecure,
681
+ keyword_init: true
682
+ ) do
683
+ def self.from_hash(h)
684
+ return nil unless h.is_a?(Hash)
685
+
686
+ new(
687
+ ca_file: h['ca_file'],
688
+ key_file: h['key_file'],
689
+ cert_file: h['cert_file'],
690
+ insecure: h['insecure']
691
+ )
692
+ end
693
+ end
694
+
695
+ HttpTls = Struct.new(
696
+ :ca_file,
697
+ :key_file,
698
+ :cert_file,
699
+ keyword_init: true
700
+ ) do
701
+ def self.from_hash(h)
702
+ return nil unless h.is_a?(Hash)
703
+
704
+ new(
705
+ ca_file: h['ca_file'],
706
+ key_file: h['key_file'],
707
+ cert_file: h['cert_file']
708
+ )
709
+ end
710
+ end
711
+
712
+ IncludeExclude = Struct.new(
713
+ :included,
714
+ :excluded,
715
+ keyword_init: true
716
+ ) do
717
+ def self.from_hash(h)
718
+ return nil unless h.is_a?(Hash)
719
+
720
+ new(
721
+ included: h['included'],
722
+ excluded: h['excluded']
723
+ )
724
+ end
725
+ end
726
+
727
+ LogRecordExporter = Struct.new(
728
+ :otlp_http,
729
+ :otlp_grpc,
730
+ :otlp_file_development,
731
+ :console,
732
+ :additional_properties,
733
+ keyword_init: true
734
+ ) do
735
+ def self.from_hash(h)
736
+ return nil unless h.is_a?(Hash)
737
+
738
+ new(
739
+ otlp_http: OtlpHttpExporter.from_hash(h['otlp_http']),
740
+ otlp_grpc: OtlpGrpcExporter.from_hash(h['otlp_grpc']),
741
+ otlp_file_development: ExperimentalOtlpFileExporter.from_hash(h['otlp_file/development']),
742
+ console: h.key?('console'),
743
+ additional_properties: h.except('otlp_http', 'otlp_grpc', 'otlp_file/development', 'console')
744
+ )
745
+ end
746
+ end
747
+
748
+ LogRecordLimits = Struct.new(
749
+ :attribute_value_length_limit,
750
+ :attribute_count_limit,
751
+ keyword_init: true
752
+ ) do
753
+ def self.from_hash(h)
754
+ return nil unless h.is_a?(Hash)
755
+
756
+ new(
757
+ attribute_value_length_limit: h['attribute_value_length_limit'],
758
+ attribute_count_limit: h['attribute_count_limit']
759
+ )
760
+ end
761
+ end
762
+
763
+ LogRecordProcessor = Struct.new(
764
+ :batch,
765
+ :simple,
766
+ :additional_properties,
767
+ keyword_init: true
768
+ ) do
769
+ def self.from_hash(h)
770
+ return nil unless h.is_a?(Hash)
771
+
772
+ new(
773
+ batch: BatchLogRecordProcessor.from_hash(h['batch']),
774
+ simple: SimpleLogRecordProcessor.from_hash(h['simple']),
775
+ additional_properties: h.except('batch', 'simple')
776
+ )
777
+ end
778
+ end
779
+
780
+ LoggerProvider = Struct.new(
781
+ :processors,
782
+ :limits,
783
+ :logger_configurator_development,
784
+ keyword_init: true
785
+ ) do
786
+ def self.from_hash(h)
787
+ return nil unless h.is_a?(Hash)
788
+
789
+ new(
790
+ processors: Array(h['processors']).filter_map { |e| LogRecordProcessor.from_hash(e) },
791
+ limits: LogRecordLimits.from_hash(h['limits']),
792
+ logger_configurator_development: ExperimentalLoggerConfigurator.from_hash(h['logger_configurator/development'])
793
+ )
794
+ end
795
+ end
796
+
797
+ MeterProvider = Struct.new(
798
+ :readers,
799
+ :views,
800
+ :exemplar_filter,
801
+ :meter_configurator_development,
802
+ keyword_init: true
803
+ ) do
804
+ def self.from_hash(h)
805
+ return nil unless h.is_a?(Hash)
806
+
807
+ new(
808
+ readers: Array(h['readers']).filter_map { |e| MetricReader.from_hash(e) },
809
+ views: Array(h['views']).filter_map { |e| View.from_hash(e) },
810
+ exemplar_filter: h['exemplar_filter'],
811
+ meter_configurator_development: ExperimentalMeterConfigurator.from_hash(h['meter_configurator/development'])
812
+ )
813
+ end
814
+ end
815
+
816
+ MetricProducer = Struct.new(
817
+ :opencensus,
818
+ :additional_properties,
819
+ keyword_init: true
820
+ ) do
821
+ def self.from_hash(h)
822
+ return nil unless h.is_a?(Hash)
823
+
824
+ new(
825
+ opencensus: h.key?('opencensus'),
826
+ additional_properties: h.except('opencensus')
827
+ )
828
+ end
829
+ end
830
+
831
+ MetricReader = Struct.new(
832
+ :periodic,
833
+ :pull,
834
+ keyword_init: true
835
+ ) do
836
+ def self.from_hash(h)
837
+ return nil unless h.is_a?(Hash)
838
+
839
+ new(
840
+ periodic: PeriodicMetricReader.from_hash(h['periodic']),
841
+ pull: PullMetricReader.from_hash(h['pull'])
842
+ )
843
+ end
844
+ end
845
+
846
+ NameStringValuePair = Struct.new(
847
+ :name,
848
+ :value,
849
+ keyword_init: true
850
+ ) do
851
+ def self.from_hash(h)
852
+ return nil unless h.is_a?(Hash)
853
+
854
+ new(
855
+ name: h['name'],
856
+ value: h['value']
857
+ )
858
+ end
859
+ end
860
+
861
+ OpenTelemetryConfiguration = Struct.new(
862
+ :file_format,
863
+ :disabled,
864
+ :log_level,
865
+ :attribute_limits,
866
+ :logger_provider,
867
+ :meter_provider,
868
+ :propagator,
869
+ :tracer_provider,
870
+ :resource,
871
+ :instrumentation_development,
872
+ :distribution,
873
+ :additional_properties,
874
+ keyword_init: true
875
+ ) do
876
+ def self.from_hash(h)
877
+ return nil unless h.is_a?(Hash)
878
+
879
+ new(
880
+ file_format: h['file_format'],
881
+ disabled: h['disabled'],
882
+ log_level: h['log_level'],
883
+ attribute_limits: AttributeLimits.from_hash(h['attribute_limits']),
884
+ logger_provider: LoggerProvider.from_hash(h['logger_provider']),
885
+ meter_provider: MeterProvider.from_hash(h['meter_provider']),
886
+ propagator: Propagator.from_hash(h['propagator']),
887
+ tracer_provider: TracerProvider.from_hash(h['tracer_provider']),
888
+ resource: Resource.from_hash(h['resource']),
889
+ instrumentation_development: ExperimentalInstrumentation.from_hash(h['instrumentation/development']),
890
+ distribution: h['distribution'],
891
+ additional_properties: h.except('file_format', 'disabled', 'log_level', 'attribute_limits', 'logger_provider', 'meter_provider', 'propagator', 'tracer_provider', 'resource', 'instrumentation/development', 'distribution')
892
+ )
893
+ end
894
+ end
895
+
896
+ OtlpGrpcExporter = Struct.new(
897
+ :endpoint,
898
+ :tls,
899
+ :headers,
900
+ :headers_list,
901
+ :compression,
902
+ :timeout,
903
+ keyword_init: true
904
+ ) do
905
+ def self.from_hash(h)
906
+ return nil unless h.is_a?(Hash)
907
+
908
+ new(
909
+ endpoint: h['endpoint'],
910
+ tls: GrpcTls.from_hash(h['tls']),
911
+ headers: Array(h['headers']).filter_map { |e| NameStringValuePair.from_hash(e) },
912
+ headers_list: h['headers_list'],
913
+ compression: h['compression'],
914
+ timeout: h['timeout']
915
+ )
916
+ end
917
+ end
918
+
919
+ OtlpGrpcMetricExporter = Struct.new(
920
+ :endpoint,
921
+ :tls,
922
+ :headers,
923
+ :headers_list,
924
+ :compression,
925
+ :timeout,
926
+ :temporality_preference,
927
+ :default_histogram_aggregation,
928
+ keyword_init: true
929
+ ) do
930
+ def self.from_hash(h)
931
+ return nil unless h.is_a?(Hash)
932
+
933
+ new(
934
+ endpoint: h['endpoint'],
935
+ tls: GrpcTls.from_hash(h['tls']),
936
+ headers: Array(h['headers']).filter_map { |e| NameStringValuePair.from_hash(e) },
937
+ headers_list: h['headers_list'],
938
+ compression: h['compression'],
939
+ timeout: h['timeout'],
940
+ temporality_preference: h['temporality_preference'],
941
+ default_histogram_aggregation: h['default_histogram_aggregation']
942
+ )
943
+ end
944
+ end
945
+
946
+ OtlpHttpExporter = Struct.new(
947
+ :endpoint,
948
+ :tls,
949
+ :headers,
950
+ :headers_list,
951
+ :compression,
952
+ :timeout,
953
+ :encoding,
954
+ keyword_init: true
955
+ ) do
956
+ def self.from_hash(h)
957
+ return nil unless h.is_a?(Hash)
958
+
959
+ new(
960
+ endpoint: h['endpoint'],
961
+ tls: HttpTls.from_hash(h['tls']),
962
+ headers: Array(h['headers']).filter_map { |e| NameStringValuePair.from_hash(e) },
963
+ headers_list: h['headers_list'],
964
+ compression: h['compression'],
965
+ timeout: h['timeout'],
966
+ encoding: h['encoding']
967
+ )
968
+ end
969
+ end
970
+
971
+ OtlpHttpMetricExporter = Struct.new(
972
+ :endpoint,
973
+ :tls,
974
+ :headers,
975
+ :headers_list,
976
+ :compression,
977
+ :timeout,
978
+ :encoding,
979
+ :temporality_preference,
980
+ :default_histogram_aggregation,
981
+ keyword_init: true
982
+ ) do
983
+ def self.from_hash(h)
984
+ return nil unless h.is_a?(Hash)
985
+
986
+ new(
987
+ endpoint: h['endpoint'],
988
+ tls: HttpTls.from_hash(h['tls']),
989
+ headers: Array(h['headers']).filter_map { |e| NameStringValuePair.from_hash(e) },
990
+ headers_list: h['headers_list'],
991
+ compression: h['compression'],
992
+ timeout: h['timeout'],
993
+ encoding: h['encoding'],
994
+ temporality_preference: h['temporality_preference'],
995
+ default_histogram_aggregation: h['default_histogram_aggregation']
996
+ )
997
+ end
998
+ end
999
+
1000
+ ParentBasedSampler = Struct.new(
1001
+ :root,
1002
+ :remote_parent_sampled,
1003
+ :remote_parent_not_sampled,
1004
+ :local_parent_sampled,
1005
+ :local_parent_not_sampled,
1006
+ keyword_init: true
1007
+ ) do
1008
+ def self.from_hash(h)
1009
+ return nil unless h.is_a?(Hash)
1010
+
1011
+ new(
1012
+ root: Sampler.from_hash(h['root']),
1013
+ remote_parent_sampled: Sampler.from_hash(h['remote_parent_sampled']),
1014
+ remote_parent_not_sampled: Sampler.from_hash(h['remote_parent_not_sampled']),
1015
+ local_parent_sampled: Sampler.from_hash(h['local_parent_sampled']),
1016
+ local_parent_not_sampled: Sampler.from_hash(h['local_parent_not_sampled'])
1017
+ )
1018
+ end
1019
+ end
1020
+
1021
+ PeriodicMetricReader = Struct.new(
1022
+ :interval,
1023
+ :timeout,
1024
+ :exporter,
1025
+ :producers,
1026
+ :cardinality_limits,
1027
+ keyword_init: true
1028
+ ) do
1029
+ def self.from_hash(h)
1030
+ return nil unless h.is_a?(Hash)
1031
+
1032
+ new(
1033
+ interval: h['interval'],
1034
+ timeout: h['timeout'],
1035
+ exporter: PushMetricExporter.from_hash(h['exporter']),
1036
+ producers: Array(h['producers']).filter_map { |e| MetricProducer.from_hash(e) },
1037
+ cardinality_limits: CardinalityLimits.from_hash(h['cardinality_limits'])
1038
+ )
1039
+ end
1040
+ end
1041
+
1042
+ Propagator = Struct.new(
1043
+ :composite,
1044
+ :composite_list,
1045
+ keyword_init: true
1046
+ ) do
1047
+ def self.from_hash(h)
1048
+ return nil unless h.is_a?(Hash)
1049
+
1050
+ new(
1051
+ composite: Array(h['composite']).filter_map { |e| TextMapPropagator.from_hash(e) },
1052
+ composite_list: h['composite_list']
1053
+ )
1054
+ end
1055
+ end
1056
+
1057
+ PullMetricExporter = Struct.new(
1058
+ :prometheus_development,
1059
+ :additional_properties,
1060
+ keyword_init: true
1061
+ ) do
1062
+ def self.from_hash(h)
1063
+ return nil unless h.is_a?(Hash)
1064
+
1065
+ new(
1066
+ prometheus_development: ExperimentalPrometheusMetricExporter.from_hash(h['prometheus/development']),
1067
+ additional_properties: h.except('prometheus/development')
1068
+ )
1069
+ end
1070
+ end
1071
+
1072
+ PullMetricReader = Struct.new(
1073
+ :exporter,
1074
+ :producers,
1075
+ :cardinality_limits,
1076
+ keyword_init: true
1077
+ ) do
1078
+ def self.from_hash(h)
1079
+ return nil unless h.is_a?(Hash)
1080
+
1081
+ new(
1082
+ exporter: PullMetricExporter.from_hash(h['exporter']),
1083
+ producers: Array(h['producers']).filter_map { |e| MetricProducer.from_hash(e) },
1084
+ cardinality_limits: CardinalityLimits.from_hash(h['cardinality_limits'])
1085
+ )
1086
+ end
1087
+ end
1088
+
1089
+ PushMetricExporter = Struct.new(
1090
+ :otlp_http,
1091
+ :otlp_grpc,
1092
+ :otlp_file_development,
1093
+ :console,
1094
+ :additional_properties,
1095
+ keyword_init: true
1096
+ ) do
1097
+ def self.from_hash(h)
1098
+ return nil unless h.is_a?(Hash)
1099
+
1100
+ new(
1101
+ otlp_http: OtlpHttpMetricExporter.from_hash(h['otlp_http']),
1102
+ otlp_grpc: OtlpGrpcMetricExporter.from_hash(h['otlp_grpc']),
1103
+ otlp_file_development: ExperimentalOtlpFileMetricExporter.from_hash(h['otlp_file/development']),
1104
+ console: ConsoleMetricExporter.from_hash(h['console']),
1105
+ additional_properties: h.except('otlp_http', 'otlp_grpc', 'otlp_file/development', 'console')
1106
+ )
1107
+ end
1108
+ end
1109
+
1110
+ Resource = Struct.new(
1111
+ :attributes,
1112
+ :detection_development,
1113
+ :schema_url,
1114
+ :attributes_list,
1115
+ keyword_init: true
1116
+ ) do
1117
+ def self.from_hash(h)
1118
+ return nil unless h.is_a?(Hash)
1119
+
1120
+ new(
1121
+ attributes: Array(h['attributes']).filter_map { |e| AttributeNameValue.from_hash(e) },
1122
+ detection_development: ExperimentalResourceDetection.from_hash(h['detection/development']),
1123
+ schema_url: h['schema_url'],
1124
+ attributes_list: h['attributes_list']
1125
+ )
1126
+ end
1127
+ end
1128
+
1129
+ Sampler = Struct.new(
1130
+ :always_off,
1131
+ :always_on,
1132
+ :composite_development,
1133
+ :jaeger_remote_development,
1134
+ :parent_based,
1135
+ :probability_development,
1136
+ :trace_id_ratio_based,
1137
+ :additional_properties,
1138
+ keyword_init: true
1139
+ ) do
1140
+ def self.from_hash(h)
1141
+ return nil unless h.is_a?(Hash)
1142
+
1143
+ new(
1144
+ always_off: h.key?('always_off'),
1145
+ always_on: h.key?('always_on'),
1146
+ composite_development: ExperimentalComposableSampler.from_hash(h['composite/development']),
1147
+ jaeger_remote_development: ExperimentalJaegerRemoteSampler.from_hash(h['jaeger_remote/development']),
1148
+ parent_based: ParentBasedSampler.from_hash(h['parent_based']),
1149
+ probability_development: ExperimentalProbabilitySampler.from_hash(h['probability/development']),
1150
+ trace_id_ratio_based: TraceIdRatioBasedSampler.from_hash(h['trace_id_ratio_based']),
1151
+ additional_properties: h.except('always_off', 'always_on', 'composite/development', 'jaeger_remote/development', 'parent_based', 'probability/development', 'trace_id_ratio_based')
1152
+ )
1153
+ end
1154
+ end
1155
+
1156
+ SimpleLogRecordProcessor = Struct.new(
1157
+ :exporter,
1158
+ keyword_init: true
1159
+ ) do
1160
+ def self.from_hash(h)
1161
+ return nil unless h.is_a?(Hash)
1162
+
1163
+ new(
1164
+ exporter: LogRecordExporter.from_hash(h['exporter'])
1165
+ )
1166
+ end
1167
+ end
1168
+
1169
+ SimpleSpanProcessor = Struct.new(
1170
+ :exporter,
1171
+ keyword_init: true
1172
+ ) do
1173
+ def self.from_hash(h)
1174
+ return nil unless h.is_a?(Hash)
1175
+
1176
+ new(
1177
+ exporter: SpanExporter.from_hash(h['exporter'])
1178
+ )
1179
+ end
1180
+ end
1181
+
1182
+ SpanExporter = Struct.new(
1183
+ :otlp_http,
1184
+ :otlp_grpc,
1185
+ :otlp_file_development,
1186
+ :console,
1187
+ :additional_properties,
1188
+ keyword_init: true
1189
+ ) do
1190
+ def self.from_hash(h)
1191
+ return nil unless h.is_a?(Hash)
1192
+
1193
+ new(
1194
+ otlp_http: OtlpHttpExporter.from_hash(h['otlp_http']),
1195
+ otlp_grpc: OtlpGrpcExporter.from_hash(h['otlp_grpc']),
1196
+ otlp_file_development: ExperimentalOtlpFileExporter.from_hash(h['otlp_file/development']),
1197
+ console: h.key?('console'),
1198
+ additional_properties: h.except('otlp_http', 'otlp_grpc', 'otlp_file/development', 'console')
1199
+ )
1200
+ end
1201
+ end
1202
+
1203
+ SpanLimits = Struct.new(
1204
+ :attribute_value_length_limit,
1205
+ :attribute_count_limit,
1206
+ :event_count_limit,
1207
+ :link_count_limit,
1208
+ :event_attribute_count_limit,
1209
+ :link_attribute_count_limit,
1210
+ keyword_init: true
1211
+ ) do
1212
+ def self.from_hash(h)
1213
+ return nil unless h.is_a?(Hash)
1214
+
1215
+ new(
1216
+ attribute_value_length_limit: h['attribute_value_length_limit'],
1217
+ attribute_count_limit: h['attribute_count_limit'],
1218
+ event_count_limit: h['event_count_limit'],
1219
+ link_count_limit: h['link_count_limit'],
1220
+ event_attribute_count_limit: h['event_attribute_count_limit'],
1221
+ link_attribute_count_limit: h['link_attribute_count_limit']
1222
+ )
1223
+ end
1224
+ end
1225
+
1226
+ SpanProcessor = Struct.new(
1227
+ :batch,
1228
+ :simple,
1229
+ :additional_properties,
1230
+ keyword_init: true
1231
+ ) do
1232
+ def self.from_hash(h)
1233
+ return nil unless h.is_a?(Hash)
1234
+
1235
+ new(
1236
+ batch: BatchSpanProcessor.from_hash(h['batch']),
1237
+ simple: SimpleSpanProcessor.from_hash(h['simple']),
1238
+ additional_properties: h.except('batch', 'simple')
1239
+ )
1240
+ end
1241
+ end
1242
+
1243
+ TextMapPropagator = Struct.new(
1244
+ :tracecontext,
1245
+ :baggage,
1246
+ :b3,
1247
+ :b3multi,
1248
+ :jaeger,
1249
+ :ottrace,
1250
+ :additional_properties,
1251
+ keyword_init: true
1252
+ ) do
1253
+ def self.from_hash(h)
1254
+ return nil unless h.is_a?(Hash)
1255
+
1256
+ new(
1257
+ tracecontext: h.key?('tracecontext'),
1258
+ baggage: h.key?('baggage'),
1259
+ b3: h.key?('b3'),
1260
+ b3multi: h.key?('b3multi'),
1261
+ jaeger: h.key?('jaeger'),
1262
+ ottrace: h.key?('ottrace'),
1263
+ additional_properties: h.except('tracecontext', 'baggage', 'b3', 'b3multi', 'jaeger', 'ottrace')
1264
+ )
1265
+ end
1266
+ end
1267
+
1268
+ TraceIdRatioBasedSampler = Struct.new(
1269
+ :ratio,
1270
+ keyword_init: true
1271
+ ) do
1272
+ def self.from_hash(h)
1273
+ return nil unless h.is_a?(Hash)
1274
+
1275
+ new(
1276
+ ratio: h['ratio']
1277
+ )
1278
+ end
1279
+ end
1280
+
1281
+ TracerProvider = Struct.new(
1282
+ :processors,
1283
+ :limits,
1284
+ :sampler,
1285
+ :tracer_configurator_development,
1286
+ keyword_init: true
1287
+ ) do
1288
+ def self.from_hash(h)
1289
+ return nil unless h.is_a?(Hash)
1290
+
1291
+ new(
1292
+ processors: Array(h['processors']).filter_map { |e| SpanProcessor.from_hash(e) },
1293
+ limits: SpanLimits.from_hash(h['limits']),
1294
+ sampler: Sampler.from_hash(h['sampler']),
1295
+ tracer_configurator_development: ExperimentalTracerConfigurator.from_hash(h['tracer_configurator/development'])
1296
+ )
1297
+ end
1298
+ end
1299
+
1300
+ View = Struct.new(
1301
+ :selector,
1302
+ :stream,
1303
+ keyword_init: true
1304
+ ) do
1305
+ def self.from_hash(h)
1306
+ return nil unless h.is_a?(Hash)
1307
+
1308
+ new(
1309
+ selector: ViewSelector.from_hash(h['selector']),
1310
+ stream: ViewStream.from_hash(h['stream'])
1311
+ )
1312
+ end
1313
+ end
1314
+
1315
+ ViewSelector = Struct.new(
1316
+ :instrument_name,
1317
+ :instrument_type,
1318
+ :unit,
1319
+ :meter_name,
1320
+ :meter_version,
1321
+ :meter_schema_url,
1322
+ keyword_init: true
1323
+ ) do
1324
+ def self.from_hash(h)
1325
+ return nil unless h.is_a?(Hash)
1326
+
1327
+ new(
1328
+ instrument_name: h['instrument_name'],
1329
+ instrument_type: h['instrument_type'],
1330
+ unit: h['unit'],
1331
+ meter_name: h['meter_name'],
1332
+ meter_version: h['meter_version'],
1333
+ meter_schema_url: h['meter_schema_url']
1334
+ )
1335
+ end
1336
+ end
1337
+
1338
+ ViewStream = Struct.new(
1339
+ :name,
1340
+ :description,
1341
+ :aggregation,
1342
+ :aggregation_cardinality_limit,
1343
+ :attribute_keys,
1344
+ keyword_init: true
1345
+ ) do
1346
+ def self.from_hash(h)
1347
+ return nil unless h.is_a?(Hash)
1348
+
1349
+ new(
1350
+ name: h['name'],
1351
+ description: h['description'],
1352
+ aggregation: Aggregation.from_hash(h['aggregation']),
1353
+ aggregation_cardinality_limit: h['aggregation_cardinality_limit'],
1354
+ attribute_keys: IncludeExclude.from_hash(h['attribute_keys'])
1355
+ )
1356
+ end
1357
+ end
1358
+ end
1359
+ end
1360
+ end