forked from open-telemetry/opentelemetry-rust
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmetric.rs
5161 lines (4892 loc) · 166 KB
/
metric.rs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// DO NOT EDIT, this is an auto-generated file
//
// If you want to update the file:
// - Edit the template at scripts/templates/registry/rust/metric.rs.j2
// - Run the script at scripts/generate-consts-from-spec.sh
//! # Metric Semantic Conventions
//!
//! The [metric semantic conventions] define a set of standardized attributes to
//! be used in `Meter`s.
//!
//! [metric semantic conventions]: https://github.com/open-telemetry/semantic-conventions/tree/main/model/metric
//!
//! ## Usage
//!
//! ```rust
//! use opentelemetry::{global, KeyValue};
//! use opentelemetry_semantic_conventions as semconv;
//!
//! // Assumes we already have an initialized `MeterProvider`
//! // See: https://github.com/open-telemetry/opentelemetry-rust/blob/main/examples/metrics-basic/src/main.rs
//! // for an example
//! let meter = global::meter("mylibraryname");
//! let histogram = meter
//! .u64_histogram(semconv::metric::HTTP_SERVER_REQUEST_DURATION)
//! .with_unit("s")
//! .with_description("Duration of HTTP server requests.")
//! .build();
//! ```
/// ## Description
///
/// Number of exceptions caught by exception handling middleware.
///
/// ## Notes
///
/// Meter name: `Microsoft.AspNetCore.Diagnostics`; Added in: ASP.NET Core 8.0
/// ## Metadata
/// | | |
/// |:-|:-
/// | Instrument: | `counter` |
/// | Unit: | `{exception}` |
/// | Status: | `Stable` |
///
/// ## Attributes
/// | Name | Requirement |
/// |:-|:- |
/// | [`crate::attribute::ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT`] | `Required`
/// | [`crate::attribute::ASPNETCORE_DIAGNOSTICS_HANDLER_TYPE`] | `Conditionally_required`: if and only if the exception was handled by this handler.
/// | [`crate::attribute::ERROR_TYPE`] | `Required`
pub const ASPNETCORE_DIAGNOSTICS_EXCEPTIONS: &str = "aspnetcore.diagnostics.exceptions";
/// ## Description
///
/// Number of requests that are currently active on the server that hold a rate limiting lease.
///
/// ## Notes
///
/// Meter name: `Microsoft.AspNetCore.RateLimiting`; Added in: ASP.NET Core 8.0
/// ## Metadata
/// | | |
/// |:-|:-
/// | Instrument: | `updowncounter` |
/// | Unit: | `{request}` |
/// | Status: | `Stable` |
///
/// ## Attributes
/// | Name | Requirement |
/// |:-|:- |
/// | [`crate::attribute::ASPNETCORE_RATE_LIMITING_POLICY`] | `Conditionally_required`: if the matched endpoint for the request had a rate-limiting policy.
pub const ASPNETCORE_RATE_LIMITING_ACTIVE_REQUEST_LEASES: &str =
"aspnetcore.rate_limiting.active_request_leases";
/// ## Description
///
/// Number of requests that are currently queued, waiting to acquire a rate limiting lease.
///
/// ## Notes
///
/// Meter name: `Microsoft.AspNetCore.RateLimiting`; Added in: ASP.NET Core 8.0
/// ## Metadata
/// | | |
/// |:-|:-
/// | Instrument: | `updowncounter` |
/// | Unit: | `{request}` |
/// | Status: | `Stable` |
///
/// ## Attributes
/// | Name | Requirement |
/// |:-|:- |
/// | [`crate::attribute::ASPNETCORE_RATE_LIMITING_POLICY`] | `Conditionally_required`: if the matched endpoint for the request had a rate-limiting policy.
pub const ASPNETCORE_RATE_LIMITING_QUEUED_REQUESTS: &str =
"aspnetcore.rate_limiting.queued_requests";
/// ## Description
///
/// The time the request spent in a queue waiting to acquire a rate limiting lease.
///
/// ## Notes
///
/// Meter name: `Microsoft.AspNetCore.RateLimiting`; Added in: ASP.NET Core 8.0
/// ## Metadata
/// | | |
/// |:-|:-
/// | Instrument: | `histogram` |
/// | Unit: | `s` |
/// | Status: | `Stable` |
///
/// ## Attributes
/// | Name | Requirement |
/// |:-|:- |
/// | [`crate::attribute::ASPNETCORE_RATE_LIMITING_POLICY`] | `Conditionally_required`: if the matched endpoint for the request had a rate-limiting policy.
/// | [`crate::attribute::ASPNETCORE_RATE_LIMITING_RESULT`] | `Required`
pub const ASPNETCORE_RATE_LIMITING_REQUEST_TIME_IN_QUEUE: &str =
"aspnetcore.rate_limiting.request.time_in_queue";
/// ## Description
///
/// The duration of rate limiting lease held by requests on the server.
///
/// ## Notes
///
/// Meter name: `Microsoft.AspNetCore.RateLimiting`; Added in: ASP.NET Core 8.0
/// ## Metadata
/// | | |
/// |:-|:-
/// | Instrument: | `histogram` |
/// | Unit: | `s` |
/// | Status: | `Stable` |
///
/// ## Attributes
/// | Name | Requirement |
/// |:-|:- |
/// | [`crate::attribute::ASPNETCORE_RATE_LIMITING_POLICY`] | `Conditionally_required`: if the matched endpoint for the request had a rate-limiting policy.
pub const ASPNETCORE_RATE_LIMITING_REQUEST_LEASE_DURATION: &str =
"aspnetcore.rate_limiting.request_lease.duration";
/// ## Description
///
/// Number of requests that tried to acquire a rate limiting lease.
///
/// ## Notes
///
/// Requests could be:
///
/// - Rejected by global or endpoint rate limiting policies
/// - Canceled while waiting for the lease.
///
/// Meter name: `Microsoft.AspNetCore.RateLimiting`; Added in: ASP.NET Core 8.0
/// ## Metadata
/// | | |
/// |:-|:-
/// | Instrument: | `counter` |
/// | Unit: | `{request}` |
/// | Status: | `Stable` |
///
/// ## Attributes
/// | Name | Requirement |
/// |:-|:- |
/// | [`crate::attribute::ASPNETCORE_RATE_LIMITING_POLICY`] | `Conditionally_required`: if the matched endpoint for the request had a rate-limiting policy.
/// | [`crate::attribute::ASPNETCORE_RATE_LIMITING_RESULT`] | `Required`
pub const ASPNETCORE_RATE_LIMITING_REQUESTS: &str = "aspnetcore.rate_limiting.requests";
/// ## Description
///
/// Number of requests that were attempted to be matched to an endpoint.
///
/// ## Notes
///
/// Meter name: `Microsoft.AspNetCore.Routing`; Added in: ASP.NET Core 8.0
/// ## Metadata
/// | | |
/// |:-|:-
/// | Instrument: | `counter` |
/// | Unit: | `{match_attempt}` |
/// | Status: | `Stable` |
///
/// ## Attributes
/// | Name | Requirement |
/// |:-|:- |
/// | [`crate::attribute::ASPNETCORE_ROUTING_IS_FALLBACK`] | `Conditionally_required`: if and only if a route was successfully matched.
/// | [`crate::attribute::ASPNETCORE_ROUTING_MATCH_STATUS`] | `Required`
/// | [`crate::attribute::HTTP_ROUTE`] | `Conditionally_required`: if and only if a route was successfully matched.
pub const ASPNETCORE_ROUTING_MATCH_ATTEMPTS: &str = "aspnetcore.routing.match_attempts";
/// ## Description
///
/// Number of active client instances
/// ## Metadata
/// | | |
/// |:-|:-
/// | Instrument: | `updowncounter` |
/// | Unit: | `{instance}` |
/// | Status: | `Development` |
///
/// ## Attributes
/// | Name | Requirement |
/// |:-|:- |
/// | [`crate::attribute::SERVER_ADDRESS`] | `Recommended`
/// | [`crate::attribute::SERVER_PORT`] | `Conditionally_required`: If using a port other than the default port for this DBMS and if `server.address` is set.
#[cfg(feature = "semconv_experimental")]
pub const AZURE_COSMOSDB_CLIENT_ACTIVE_INSTANCE_COUNT: &str =
"azure.cosmosdb.client.active_instance.count";
/// ## Description
///
/// [Request units](https://learn.microsoft.com/azure/cosmos-db/request-units) consumed by the operation
/// ## Metadata
/// | | |
/// |:-|:-
/// | Instrument: | `histogram` |
/// | Unit: | `{request_unit}` |
/// | Status: | `Development` |
///
/// ## Attributes
/// | Name | Requirement |
/// |:-|:- |
/// | [`crate::attribute::AZURE_COSMOSDB_CONSISTENCY_LEVEL`] | `Conditionally_required`: If available.
/// | [`crate::attribute::AZURE_COSMOSDB_OPERATION_CONTACTED_REGIONS`] | `{"recommended": "if available"}`
/// | [`crate::attribute::AZURE_COSMOSDB_RESPONSE_SUB_STATUS_CODE`] | `Conditionally_required`: when response was received and contained sub-code.
/// | [`crate::attribute::DB_COLLECTION_NAME`] | `Conditionally_required`: If available.
/// | [`crate::attribute::DB_NAMESPACE`] | `Conditionally_required`: If available.
/// | [`crate::attribute::DB_OPERATION_NAME`] | `Conditionally_required`: If readily available.
/// | [`crate::attribute::DB_RESPONSE_STATUS_CODE`] | `Conditionally_required`: If the operation failed and status code is available.
/// | [`crate::attribute::ERROR_TYPE`] | `Conditionally_required`: If and only if the operation failed.
/// | [`crate::attribute::SERVER_ADDRESS`] | `Recommended`
/// | [`crate::attribute::SERVER_PORT`] | `Conditionally_required`: If using a port other than the default port for this DBMS and if `server.address` is set.
#[cfg(feature = "semconv_experimental")]
pub const AZURE_COSMOSDB_CLIENT_OPERATION_REQUEST_CHARGE: &str =
"azure.cosmosdb.client.operation.request_charge";
/// ## Description
///
/// The number of pipeline runs currently active in the system by state
/// ## Metadata
/// | | |
/// |:-|:-
/// | Instrument: | `updowncounter` |
/// | Unit: | `{run}` |
/// | Status: | `Development` |
///
/// ## Attributes
/// | Name | Requirement |
/// |:-|:- |
/// | [`crate::attribute::CICD_PIPELINE_NAME`] | `Required`
/// | [`crate::attribute::CICD_PIPELINE_RUN_STATE`] | `Required`
#[cfg(feature = "semconv_experimental")]
pub const CICD_PIPELINE_RUN_ACTIVE: &str = "cicd.pipeline.run.active";
/// ## Description
///
/// Duration of a pipeline run grouped by pipeline, state and result
/// ## Metadata
/// | | |
/// |:-|:-
/// | Instrument: | `histogram` |
/// | Unit: | `s` |
/// | Status: | `Development` |
///
/// ## Attributes
/// | Name | Requirement |
/// |:-|:- |
/// | [`crate::attribute::CICD_PIPELINE_NAME`] | `Required`
/// | [`crate::attribute::CICD_PIPELINE_RESULT`] | `Conditionally_required`: If and only if the pipeline run result has been set during that state.
/// | [`crate::attribute::CICD_PIPELINE_RUN_STATE`] | `Required`
/// | [`crate::attribute::ERROR_TYPE`] | `Conditionally_required`: If and only if the pipeline run failed.
#[cfg(feature = "semconv_experimental")]
pub const CICD_PIPELINE_RUN_DURATION: &str = "cicd.pipeline.run.duration";
/// ## Description
///
/// The number of errors encountered in pipeline runs (eg. compile, test failures).
///
/// ## Notes
///
/// There might be errors in a pipeline run that are non fatal (eg. they are suppressed) or in a parallel stage multiple stages could have a fatal error.
/// This means that this error count might not be the same as the count of metric `cicd.pipeline.run.duration` with run result `failure`
/// ## Metadata
/// | | |
/// |:-|:-
/// | Instrument: | `counter` |
/// | Unit: | `{error}` |
/// | Status: | `Development` |
///
/// ## Attributes
/// | Name | Requirement |
/// |:-|:- |
/// | [`crate::attribute::CICD_PIPELINE_NAME`] | `Required`
/// | [`crate::attribute::ERROR_TYPE`] | `Required`
#[cfg(feature = "semconv_experimental")]
pub const CICD_PIPELINE_RUN_ERRORS: &str = "cicd.pipeline.run.errors";
/// ## Description
///
/// The number of errors in a component of the CICD system (eg. controller, scheduler, agent).
///
/// ## Notes
///
/// Errors in pipeline run execution are explicitly excluded. Ie a test failure is not counted in this metric
/// ## Metadata
/// | | |
/// |:-|:-
/// | Instrument: | `counter` |
/// | Unit: | `{error}` |
/// | Status: | `Development` |
///
/// ## Attributes
/// | Name | Requirement |
/// |:-|:- |
/// | [`crate::attribute::CICD_SYSTEM_COMPONENT`] | `Required`
/// | [`crate::attribute::ERROR_TYPE`] | `Required`
#[cfg(feature = "semconv_experimental")]
pub const CICD_SYSTEM_ERRORS: &str = "cicd.system.errors";
/// ## Description
///
/// The number of workers on the CICD system by state
/// ## Metadata
/// | | |
/// |:-|:-
/// | Instrument: | `updowncounter` |
/// | Unit: | `{count}` |
/// | Status: | `Development` |
///
/// ## Attributes
/// | Name | Requirement |
/// |:-|:- |
/// | [`crate::attribute::CICD_WORKER_STATE`] | `Required`
#[cfg(feature = "semconv_experimental")]
pub const CICD_WORKER_COUNT: &str = "cicd.worker.count";
/// ## Description
///
/// Total CPU time consumed
///
/// ## Notes
///
/// Total CPU time consumed by the specific container on all available CPU cores
/// ## Metadata
/// | | |
/// |:-|:-
/// | Instrument: | `counter` |
/// | Unit: | `s` |
/// | Status: | `Development` |
///
/// ## Attributes
/// | Name | Requirement |
/// |:-|:- |
/// | [`crate::attribute::CPU_MODE`] | `Conditionally_required`: Required if mode is available, i.e. metrics coming from the Docker Stats API.
#[cfg(feature = "semconv_experimental")]
pub const CONTAINER_CPU_TIME: &str = "container.cpu.time";
/// ## Description
///
/// Container's CPU usage, measured in cpus. Range from 0 to the number of allocatable CPUs
///
/// ## Notes
///
/// CPU usage of the specific container on all available CPU cores, averaged over the sample window
/// ## Metadata
/// | | |
/// |:-|:-
/// | Instrument: | `gauge` |
/// | Unit: | `{cpu}` |
/// | Status: | `Development` |
///
/// ## Attributes
/// | Name | Requirement |
/// |:-|:- |
/// | [`crate::attribute::CPU_MODE`] | `Conditionally_required`: Required if mode is available, i.e. metrics coming from the Docker Stats API.
#[cfg(feature = "semconv_experimental")]
pub const CONTAINER_CPU_USAGE: &str = "container.cpu.usage";
/// ## Description
///
/// Disk bytes for the container.
///
/// ## Notes
///
/// The total number of bytes read/written successfully (aggregated from all disks)
/// ## Metadata
/// | | |
/// |:-|:-
/// | Instrument: | `counter` |
/// | Unit: | `By` |
/// | Status: | `Development` |
///
/// ## Attributes
/// | Name | Requirement |
/// |:-|:- |
/// | [`crate::attribute::DISK_IO_DIRECTION`] | `Recommended`
/// | [`crate::attribute::SYSTEM_DEVICE`] | `Recommended`
#[cfg(feature = "semconv_experimental")]
pub const CONTAINER_DISK_IO: &str = "container.disk.io";
/// ## Description
///
/// Memory usage of the container.
///
/// ## Notes
///
/// Memory usage of the container
/// ## Metadata
/// | | |
/// |:-|:-
/// | Instrument: | `counter` |
/// | Unit: | `By` |
/// | Status: | `Development` |
#[cfg(feature = "semconv_experimental")]
pub const CONTAINER_MEMORY_USAGE: &str = "container.memory.usage";
/// ## Description
///
/// Network bytes for the container.
///
/// ## Notes
///
/// The number of bytes sent/received on all network interfaces by the container
/// ## Metadata
/// | | |
/// |:-|:-
/// | Instrument: | `counter` |
/// | Unit: | `By` |
/// | Status: | `Development` |
///
/// ## Attributes
/// | Name | Requirement |
/// |:-|:- |
/// | [`crate::attribute::NETWORK_INTERFACE_NAME`] | `Recommended`
/// | [`crate::attribute::NETWORK_IO_DIRECTION`] | `Recommended`
#[cfg(feature = "semconv_experimental")]
pub const CONTAINER_NETWORK_IO: &str = "container.network.io";
/// ## Description
///
/// The time the container has been running
///
/// ## Notes
///
/// Instrumentations SHOULD use a gauge with type `double` and measure uptime in seconds as a floating point number with the highest precision available.
/// The actual accuracy would depend on the instrumentation and operating system
/// ## Metadata
/// | | |
/// |:-|:-
/// | Instrument: | `gauge` |
/// | Unit: | `s` |
/// | Status: | `Development` |
#[cfg(feature = "semconv_experimental")]
pub const CONTAINER_UPTIME: &str = "container.uptime";
/// ## Description
///
/// Operating frequency of the logical CPU in Hertz
/// ## Metadata
/// | | |
/// |:-|:-
/// | Instrument: | `gauge` |
/// | Unit: | `Hz` |
/// | Status: | `Development` |
///
/// ## Attributes
/// | Name | Requirement |
/// |:-|:- |
/// | [`crate::attribute::CPU_LOGICAL_NUMBER`] | `Recommended`
#[cfg(feature = "semconv_experimental")]
pub const CPU_FREQUENCY: &str = "cpu.frequency";
/// ## Description
///
/// Seconds each logical CPU spent on each mode
/// ## Metadata
/// | | |
/// |:-|:-
/// | Instrument: | `counter` |
/// | Unit: | `s` |
/// | Status: | `Development` |
///
/// ## Attributes
/// | Name | Requirement |
/// |:-|:- |
/// | [`crate::attribute::CPU_LOGICAL_NUMBER`] | `Recommended`
/// | [`crate::attribute::CPU_MODE`] | `Recommended`
#[cfg(feature = "semconv_experimental")]
pub const CPU_TIME: &str = "cpu.time";
/// ## Description
///
/// For each logical CPU, the utilization is calculated as the change in cumulative CPU time (cpu.time) over a measurement interval, divided by the elapsed time
/// ## Metadata
/// | | |
/// |:-|:-
/// | Instrument: | `gauge` |
/// | Unit: | `1` |
/// | Status: | `Development` |
///
/// ## Attributes
/// | Name | Requirement |
/// |:-|:- |
/// | [`crate::attribute::CPU_LOGICAL_NUMBER`] | `Recommended`
/// | [`crate::attribute::CPU_MODE`] | `Recommended`
#[cfg(feature = "semconv_experimental")]
pub const CPU_UTILIZATION: &str = "cpu.utilization";
/// ## Description
///
/// The number of connections that are currently in state described by the `state` attribute
/// ## Metadata
/// | | |
/// |:-|:-
/// | Instrument: | `updowncounter` |
/// | Unit: | `{connection}` |
/// | Status: | `Development` |
///
/// ## Attributes
/// | Name | Requirement |
/// |:-|:- |
/// | [`crate::attribute::DB_CLIENT_CONNECTION_POOL_NAME`] | `Required`
/// | [`crate::attribute::DB_CLIENT_CONNECTION_STATE`] | `Required`
#[cfg(feature = "semconv_experimental")]
pub const DB_CLIENT_CONNECTION_COUNT: &str = "db.client.connection.count";
/// ## Description
///
/// The time it took to create a new connection
/// ## Metadata
/// | | |
/// |:-|:-
/// | Instrument: | `histogram` |
/// | Unit: | `s` |
/// | Status: | `Development` |
///
/// ## Attributes
/// | Name | Requirement |
/// |:-|:- |
/// | [`crate::attribute::DB_CLIENT_CONNECTION_POOL_NAME`] | `Required`
#[cfg(feature = "semconv_experimental")]
pub const DB_CLIENT_CONNECTION_CREATE_TIME: &str = "db.client.connection.create_time";
/// ## Description
///
/// The maximum number of idle open connections allowed
/// ## Metadata
/// | | |
/// |:-|:-
/// | Instrument: | `updowncounter` |
/// | Unit: | `{connection}` |
/// | Status: | `Development` |
///
/// ## Attributes
/// | Name | Requirement |
/// |:-|:- |
/// | [`crate::attribute::DB_CLIENT_CONNECTION_POOL_NAME`] | `Required`
#[cfg(feature = "semconv_experimental")]
pub const DB_CLIENT_CONNECTION_IDLE_MAX: &str = "db.client.connection.idle.max";
/// ## Description
///
/// The minimum number of idle open connections allowed
/// ## Metadata
/// | | |
/// |:-|:-
/// | Instrument: | `updowncounter` |
/// | Unit: | `{connection}` |
/// | Status: | `Development` |
///
/// ## Attributes
/// | Name | Requirement |
/// |:-|:- |
/// | [`crate::attribute::DB_CLIENT_CONNECTION_POOL_NAME`] | `Required`
#[cfg(feature = "semconv_experimental")]
pub const DB_CLIENT_CONNECTION_IDLE_MIN: &str = "db.client.connection.idle.min";
/// ## Description
///
/// The maximum number of open connections allowed
/// ## Metadata
/// | | |
/// |:-|:-
/// | Instrument: | `updowncounter` |
/// | Unit: | `{connection}` |
/// | Status: | `Development` |
///
/// ## Attributes
/// | Name | Requirement |
/// |:-|:- |
/// | [`crate::attribute::DB_CLIENT_CONNECTION_POOL_NAME`] | `Required`
#[cfg(feature = "semconv_experimental")]
pub const DB_CLIENT_CONNECTION_MAX: &str = "db.client.connection.max";
/// ## Description
///
/// The number of current pending requests for an open connection
/// ## Metadata
/// | | |
/// |:-|:-
/// | Instrument: | `updowncounter` |
/// | Unit: | `{request}` |
/// | Status: | `Development` |
///
/// ## Attributes
/// | Name | Requirement |
/// |:-|:- |
/// | [`crate::attribute::DB_CLIENT_CONNECTION_POOL_NAME`] | `Required`
#[cfg(feature = "semconv_experimental")]
pub const DB_CLIENT_CONNECTION_PENDING_REQUESTS: &str = "db.client.connection.pending_requests";
/// ## Description
///
/// The number of connection timeouts that have occurred trying to obtain a connection from the pool
/// ## Metadata
/// | | |
/// |:-|:-
/// | Instrument: | `counter` |
/// | Unit: | `{timeout}` |
/// | Status: | `Development` |
///
/// ## Attributes
/// | Name | Requirement |
/// |:-|:- |
/// | [`crate::attribute::DB_CLIENT_CONNECTION_POOL_NAME`] | `Required`
#[cfg(feature = "semconv_experimental")]
pub const DB_CLIENT_CONNECTION_TIMEOUTS: &str = "db.client.connection.timeouts";
/// ## Description
///
/// The time between borrowing a connection and returning it to the pool
/// ## Metadata
/// | | |
/// |:-|:-
/// | Instrument: | `histogram` |
/// | Unit: | `s` |
/// | Status: | `Development` |
///
/// ## Attributes
/// | Name | Requirement |
/// |:-|:- |
/// | [`crate::attribute::DB_CLIENT_CONNECTION_POOL_NAME`] | `Required`
#[cfg(feature = "semconv_experimental")]
pub const DB_CLIENT_CONNECTION_USE_TIME: &str = "db.client.connection.use_time";
/// ## Description
///
/// The time it took to obtain an open connection from the pool
/// ## Metadata
/// | | |
/// |:-|:-
/// | Instrument: | `histogram` |
/// | Unit: | `s` |
/// | Status: | `Development` |
///
/// ## Attributes
/// | Name | Requirement |
/// |:-|:- |
/// | [`crate::attribute::DB_CLIENT_CONNECTION_POOL_NAME`] | `Required`
#[cfg(feature = "semconv_experimental")]
pub const DB_CLIENT_CONNECTION_WAIT_TIME: &str = "db.client.connection.wait_time";
/// ## Description
///
/// Deprecated, use `db.client.connection.create_time` instead. Note: the unit also changed from `ms` to `s`
/// ## Metadata
/// | | |
/// |:-|:-
/// | Instrument: | `histogram` |
/// | Unit: | `ms` |
/// | Status: | `Development` |
///
/// ## Attributes
/// | Name | Requirement |
/// |:-|:- |
/// | [`crate::attribute::DB_CLIENT_CONNECTIONS_POOL_NAME`] | `Required`
#[cfg(feature = "semconv_experimental")]
pub const DB_CLIENT_CONNECTIONS_CREATE_TIME: &str = "db.client.connections.create_time";
/// ## Description
///
/// Deprecated, use `db.client.connection.idle.max` instead
/// ## Metadata
/// | | |
/// |:-|:-
/// | Instrument: | `updowncounter` |
/// | Unit: | `{connection}` |
/// | Status: | `Development` |
///
/// ## Attributes
/// | Name | Requirement |
/// |:-|:- |
/// | [`crate::attribute::DB_CLIENT_CONNECTIONS_POOL_NAME`] | `Required`
#[cfg(feature = "semconv_experimental")]
pub const DB_CLIENT_CONNECTIONS_IDLE_MAX: &str = "db.client.connections.idle.max";
/// ## Description
///
/// Deprecated, use `db.client.connection.idle.min` instead
/// ## Metadata
/// | | |
/// |:-|:-
/// | Instrument: | `updowncounter` |
/// | Unit: | `{connection}` |
/// | Status: | `Development` |
///
/// ## Attributes
/// | Name | Requirement |
/// |:-|:- |
/// | [`crate::attribute::DB_CLIENT_CONNECTIONS_POOL_NAME`] | `Required`
#[cfg(feature = "semconv_experimental")]
pub const DB_CLIENT_CONNECTIONS_IDLE_MIN: &str = "db.client.connections.idle.min";
/// ## Description
///
/// Deprecated, use `db.client.connection.max` instead
/// ## Metadata
/// | | |
/// |:-|:-
/// | Instrument: | `updowncounter` |
/// | Unit: | `{connection}` |
/// | Status: | `Development` |
///
/// ## Attributes
/// | Name | Requirement |
/// |:-|:- |
/// | [`crate::attribute::DB_CLIENT_CONNECTIONS_POOL_NAME`] | `Required`
#[cfg(feature = "semconv_experimental")]
pub const DB_CLIENT_CONNECTIONS_MAX: &str = "db.client.connections.max";
/// ## Description
///
/// Deprecated, use `db.client.connection.pending_requests` instead
/// ## Metadata
/// | | |
/// |:-|:-
/// | Instrument: | `updowncounter` |
/// | Unit: | `{request}` |
/// | Status: | `Development` |
///
/// ## Attributes
/// | Name | Requirement |
/// |:-|:- |
/// | [`crate::attribute::DB_CLIENT_CONNECTIONS_POOL_NAME`] | `Required`
#[cfg(feature = "semconv_experimental")]
pub const DB_CLIENT_CONNECTIONS_PENDING_REQUESTS: &str = "db.client.connections.pending_requests";
/// ## Description
///
/// Deprecated, use `db.client.connection.timeouts` instead
/// ## Metadata
/// | | |
/// |:-|:-
/// | Instrument: | `counter` |
/// | Unit: | `{timeout}` |
/// | Status: | `Development` |
///
/// ## Attributes
/// | Name | Requirement |
/// |:-|:- |
/// | [`crate::attribute::DB_CLIENT_CONNECTIONS_POOL_NAME`] | `Required`
#[cfg(feature = "semconv_experimental")]
pub const DB_CLIENT_CONNECTIONS_TIMEOUTS: &str = "db.client.connections.timeouts";
/// ## Description
///
/// Deprecated, use `db.client.connection.count` instead
/// ## Metadata
/// | | |
/// |:-|:-
/// | Instrument: | `updowncounter` |
/// | Unit: | `{connection}` |
/// | Status: | `Development` |
///
/// ## Attributes
/// | Name | Requirement |
/// |:-|:- |
/// | [`crate::attribute::DB_CLIENT_CONNECTIONS_POOL_NAME`] | `Required`
/// | [`crate::attribute::DB_CLIENT_CONNECTIONS_STATE`] | `Required`
#[cfg(feature = "semconv_experimental")]
pub const DB_CLIENT_CONNECTIONS_USAGE: &str = "db.client.connections.usage";
/// ## Description
///
/// Deprecated, use `db.client.connection.use_time` instead. Note: the unit also changed from `ms` to `s`
/// ## Metadata
/// | | |
/// |:-|:-
/// | Instrument: | `histogram` |
/// | Unit: | `ms` |
/// | Status: | `Development` |
///
/// ## Attributes
/// | Name | Requirement |
/// |:-|:- |
/// | [`crate::attribute::DB_CLIENT_CONNECTIONS_POOL_NAME`] | `Required`
#[cfg(feature = "semconv_experimental")]
pub const DB_CLIENT_CONNECTIONS_USE_TIME: &str = "db.client.connections.use_time";
/// ## Description
///
/// Deprecated, use `db.client.connection.wait_time` instead. Note: the unit also changed from `ms` to `s`
/// ## Metadata
/// | | |
/// |:-|:-
/// | Instrument: | `histogram` |
/// | Unit: | `ms` |
/// | Status: | `Development` |
///
/// ## Attributes
/// | Name | Requirement |
/// |:-|:- |
/// | [`crate::attribute::DB_CLIENT_CONNECTIONS_POOL_NAME`] | `Required`
#[cfg(feature = "semconv_experimental")]
pub const DB_CLIENT_CONNECTIONS_WAIT_TIME: &str = "db.client.connections.wait_time";
/// ## Description
///
/// Deprecated, use `azure.cosmosdb.client.active_instance.count` instead
/// ## Metadata
/// | | |
/// |:-|:-
/// | Instrument: | `updowncounter` |
/// | Unit: | `{instance}` |
/// | Status: | `Development` |
///
/// ## Attributes
/// | Name | Requirement |
/// |:-|:- |
/// | [`crate::attribute::SERVER_ADDRESS`] | `Recommended`
/// | [`crate::attribute::SERVER_PORT`] | `Conditionally_required`: If using a port other than the default port for this DBMS and if `server.address` is set.
#[cfg(feature = "semconv_experimental")]
pub const DB_CLIENT_COSMOSDB_ACTIVE_INSTANCE_COUNT: &str =
"db.client.cosmosdb.active_instance.count";
/// ## Description
///
/// Deprecated, use `azure.cosmosdb.client.operation.request_charge` instead
/// ## Metadata
/// | | |
/// |:-|:-
/// | Instrument: | `histogram` |
/// | Unit: | `{request_unit}` |
/// | Status: | `Development` |
///
/// ## Attributes
/// | Name | Requirement |
/// |:-|:- |
/// | [`crate::attribute::DB_COLLECTION_NAME`] | `Conditionally_required`: If available.
/// | [`crate::attribute::DB_COSMOSDB_CONSISTENCY_LEVEL`] | `Conditionally_required`: If available.
/// | [`crate::attribute::DB_COSMOSDB_REGIONS_CONTACTED`] | `{"recommended": "if available"}`
/// | [`crate::attribute::DB_COSMOSDB_SUB_STATUS_CODE`] | `Conditionally_required`: when response was received and contained sub-code.
/// | [`crate::attribute::DB_NAMESPACE`] | `Conditionally_required`: If available.
/// | [`crate::attribute::DB_OPERATION_NAME`] | `Conditionally_required`: If readily available and if there is a single operation name that describes the database call. The operation name MAY be parsed from the query text, in which case it SHOULD be the single operation name found in the query.
#[cfg(feature = "semconv_experimental")]
pub const DB_CLIENT_COSMOSDB_OPERATION_REQUEST_CHARGE: &str =
"db.client.cosmosdb.operation.request_charge";
/// ## Description
///
/// Duration of database client operations.
///
/// ## Notes
///
/// Batch operations SHOULD be recorded as a single operation
/// ## Metadata
/// | | |
/// |:-|:-
/// | Instrument: | `histogram` |
/// | Unit: | `s` |
/// | Status: | `Release_candidate` |
///
/// ## Attributes
/// | Name | Requirement |
/// |:-|:- |
/// | [`crate::attribute::DB_COLLECTION_NAME`] | `Conditionally_required`: If readily available and if a database call is performed on a single collection.
/// | [`crate::attribute::DB_NAMESPACE`] | `Conditionally_required`: If available.
/// | [`crate::attribute::DB_OPERATION_NAME`] | `Conditionally_required`: If readily available and if there is a single operation name that describes the database call.
/// | [`crate::attribute::DB_QUERY_SUMMARY`] | `{"recommended": "if readily available or if instrumentation supports query summarization."}`
/// | [`crate::attribute::DB_QUERY_TEXT`] | `Opt_in`
/// | [`crate::attribute::DB_RESPONSE_STATUS_CODE`] | `Conditionally_required`: If the operation failed and status code is available.
/// | [`crate::attribute::DB_SYSTEM_NAME`] | `Required`
/// | [`crate::attribute::ERROR_TYPE`] | `Conditionally_required`: If and only if the operation failed.
/// | [`crate::attribute::NETWORK_PEER_ADDRESS`] | `{"recommended": "if applicable for this database system."}`
/// | [`crate::attribute::NETWORK_PEER_PORT`] | `{"recommended": "if and only if `network.peer.address` is set."}`
/// | [`crate::attribute::SERVER_ADDRESS`] | `Recommended`
/// | [`crate::attribute::SERVER_PORT`] | `Conditionally_required`: If using a port other than the default port for this DBMS and if `server.address` is set.
#[cfg(feature = "semconv_experimental")]
pub const DB_CLIENT_OPERATION_DURATION: &str = "db.client.operation.duration";
/// ## Description
///
/// The actual number of records returned by the database operation
/// ## Metadata
/// | | |
/// |:-|:-
/// | Instrument: | `histogram` |
/// | Unit: | `{row}` |
/// | Status: | `Development` |
///
/// ## Attributes
/// | Name | Requirement |
/// |:-|:- |
/// | [`crate::attribute::DB_COLLECTION_NAME`] | `Conditionally_required`: If readily available and if a database call is performed on a single collection.
/// | [`crate::attribute::DB_NAMESPACE`] | `Conditionally_required`: If available.
/// | [`crate::attribute::DB_OPERATION_NAME`] | `Conditionally_required`: If readily available and if there is a single operation name that describes the database call.
/// | [`crate::attribute::DB_QUERY_SUMMARY`] | `{"recommended": "if readily available or if instrumentation supports query summarization."}`
/// | [`crate::attribute::DB_QUERY_TEXT`] | `Opt_in`
/// | [`crate::attribute::DB_RESPONSE_STATUS_CODE`] | `Conditionally_required`: If the operation failed and status code is available.
/// | [`crate::attribute::DB_SYSTEM_NAME`] | `Required`
/// | [`crate::attribute::ERROR_TYPE`] | `Conditionally_required`: If and only if the operation failed.
/// | [`crate::attribute::NETWORK_PEER_ADDRESS`] | `{"recommended": "if applicable for this database system."}`
/// | [`crate::attribute::NETWORK_PEER_PORT`] | `{"recommended": "if and only if `network.peer.address` is set."}`
/// | [`crate::attribute::SERVER_ADDRESS`] | `Recommended`
/// | [`crate::attribute::SERVER_PORT`] | `Conditionally_required`: If using a port other than the default port for this DBMS and if `server.address` is set.
#[cfg(feature = "semconv_experimental")]
pub const DB_CLIENT_RESPONSE_RETURNED_ROWS: &str = "db.client.response.returned_rows";
/// ## Description
///
/// Measures the time taken to perform a DNS lookup
/// ## Metadata
/// | | |
/// |:-|:-
/// | Instrument: | `histogram` |
/// | Unit: | `s` |
/// | Status: | `Development` |
///
/// ## Attributes
/// | Name | Requirement |
/// |:-|:- |
/// | [`crate::attribute::DNS_QUESTION_NAME`] | `Required`
/// | [`crate::attribute::ERROR_TYPE`] | `Conditionally_required`: if and only if an error has occurred.
#[cfg(feature = "semconv_experimental")]
pub const DNS_LOOKUP_DURATION: &str = "dns.lookup.duration";
/// ## Description
///
/// The number of .NET assemblies that are currently loaded.
///
/// ## Notes
///
/// Meter name: `System.Runtime`; Added in: .NET 9.0.
/// This metric reports the same values as calling [`AppDomain.CurrentDomain.GetAssemblies().Length`](https://learn.microsoft.com/dotnet/api/system.appdomain.getassemblies)
/// ## Metadata
/// | | |
/// |:-|:-
/// | Instrument: | `updowncounter` |
/// | Unit: | `{assembly}` |
/// | Status: | `Stable` |
pub const DOTNET_ASSEMBLY_COUNT: &str = "dotnet.assembly.count";
/// ## Description
///
/// The number of exceptions that have been thrown in managed code.
///
/// ## Notes
///
/// Meter name: `System.Runtime`; Added in: .NET 9.0.
/// This metric reports the same values as counting calls to [`AppDomain.CurrentDomain.FirstChanceException`](https://learn.microsoft.com/dotnet/api/system.appdomain.firstchanceexception)
/// ## Metadata
/// | | |
/// |:-|:-
/// | Instrument: | `counter` |
/// | Unit: | `{exception}` |
/// | Status: | `Stable` |
///
/// ## Attributes
/// | Name | Requirement |
/// |:-|:- |
/// | [`crate::attribute::ERROR_TYPE`] | `Required`
pub const DOTNET_EXCEPTIONS: &str = "dotnet.exceptions";
/// ## Description
///
/// The number of garbage collections that have occurred since the process has started.
///
/// ## Notes
///
/// Meter name: `System.Runtime`; Added in: .NET 9.0.
/// This metric uses the [`GC.CollectionCount(int generation)`](https://learn.microsoft.com/dotnet/api/system.gc.collectioncount) API to calculate exclusive collections per generation
/// ## Metadata
/// | | |
/// |:-|:-
/// | Instrument: | `counter` |
/// | Unit: | `{collection}` |
/// | Status: | `Stable` |
///
/// ## Attributes
/// | Name | Requirement |
/// |:-|:- |
/// | [`crate::attribute::DOTNET_GC_HEAP_GENERATION`] | `Required`
pub const DOTNET_GC_COLLECTIONS: &str = "dotnet.gc.collections";
/// ## Description
///
/// The *approximate* number of bytes allocated on the managed GC heap since the process has started. The returned value does not include any native allocations.
///
/// ## Notes
///
/// Meter name: `System.Runtime`; Added in: .NET 9.0.
/// This metric reports the same values as calling [`GC.GetTotalAllocatedBytes()`](https://learn.microsoft.com/dotnet/api/system.gc.gettotalallocatedbytes)
/// ## Metadata
/// | | |
/// |:-|:-