-
Notifications
You must be signed in to change notification settings - Fork 628
/
__init__.py
2217 lines (1690 loc) · 67.9 KB
/
__init__.py
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
# Copyright The OpenTelemetry Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# pylint: disable=too-many-lines
from enum import Enum
from deprecated import deprecated
@deprecated(
version="1.25.0",
reason="Use attributes defined in the :py:const:`opentelemetry.semconv.attributes` and :py:const:`opentelemetry.semconv._incubating.attributes` modules instead.",
) # type: ignore
class SpanAttributes:
SCHEMA_URL = "https://opentelemetry.io/schemas/1.21.0"
"""
The URL of the OpenTelemetry schema for these keys and values.
"""
CLIENT_ADDRESS = "client.address"
"""
Client address - unix domain socket name, IPv4 or IPv6 address.
Note: When observed from the server side, and when communicating through an intermediary, `client.address` SHOULD represent client address behind any intermediaries (e.g. proxies) if it's available.
"""
CLIENT_PORT = "client.port"
"""
Client port number.
Note: When observed from the server side, and when communicating through an intermediary, `client.port` SHOULD represent client port behind any intermediaries (e.g. proxies) if it's available.
"""
CLIENT_SOCKET_ADDRESS = "client.socket.address"
"""
Immediate client peer address - unix domain socket name, IPv4 or IPv6 address.
"""
CLIENT_SOCKET_PORT = "client.socket.port"
"""
Immediate client peer port number.
"""
HTTP_METHOD = "http.method"
"""
Deprecated, use `http.request.method` instead.
"""
HTTP_STATUS_CODE = "http.status_code"
"""
Deprecated, use `http.response.status_code` instead.
"""
HTTP_SCHEME = "http.scheme"
"""
Deprecated, use `url.scheme` instead.
"""
HTTP_URL = "http.url"
"""
Deprecated, use `url.full` instead.
"""
HTTP_TARGET = "http.target"
"""
Deprecated, use `url.path` and `url.query` instead.
"""
HTTP_REQUEST_CONTENT_LENGTH = "http.request_content_length"
"""
Deprecated, use `http.request.body.size` instead.
"""
HTTP_RESPONSE_CONTENT_LENGTH = "http.response_content_length"
"""
Deprecated, use `http.response.body.size` instead.
"""
NET_SOCK_PEER_NAME = "net.sock.peer.name"
"""
Deprecated, use `server.socket.domain` on client spans.
"""
NET_SOCK_PEER_ADDR = "net.sock.peer.addr"
"""
Deprecated, use `server.socket.address` on client spans and `client.socket.address` on server spans.
"""
NET_SOCK_PEER_PORT = "net.sock.peer.port"
"""
Deprecated, use `server.socket.port` on client spans and `client.socket.port` on server spans.
"""
NET_PEER_NAME = "net.peer.name"
"""
Deprecated, use `server.address` on client spans and `client.address` on server spans.
"""
NET_PEER_PORT = "net.peer.port"
"""
Deprecated, use `server.port` on client spans and `client.port` on server spans.
"""
NET_HOST_NAME = "net.host.name"
"""
Deprecated, use `server.address`.
"""
NET_HOST_PORT = "net.host.port"
"""
Deprecated, use `server.port`.
"""
NET_SOCK_HOST_ADDR = "net.sock.host.addr"
"""
Deprecated, use `server.socket.address`.
"""
NET_SOCK_HOST_PORT = "net.sock.host.port"
"""
Deprecated, use `server.socket.port`.
"""
NET_TRANSPORT = "net.transport"
"""
Deprecated, use `network.transport`.
"""
NET_PROTOCOL_NAME = "net.protocol.name"
"""
Deprecated, use `network.protocol.name`.
"""
NET_PROTOCOL_VERSION = "net.protocol.version"
"""
Deprecated, use `network.protocol.version`.
"""
NET_SOCK_FAMILY = "net.sock.family"
"""
Deprecated, use `network.transport` and `network.type`.
"""
DESTINATION_DOMAIN = "destination.domain"
"""
The domain name of the destination system.
Note: This value may be a host name, a fully qualified domain name, or another host naming format.
"""
DESTINATION_ADDRESS = "destination.address"
"""
Peer address, for example IP address or UNIX socket name.
"""
DESTINATION_PORT = "destination.port"
"""
Peer port number.
"""
EXCEPTION_TYPE = "exception.type"
"""
The type of the exception (its fully-qualified class name, if applicable). The dynamic type of the exception should be preferred over the static type in languages that support it.
"""
EXCEPTION_MESSAGE = "exception.message"
"""
The exception message.
"""
EXCEPTION_STACKTRACE = "exception.stacktrace"
"""
A stacktrace as a string in the natural representation for the language runtime. The representation is to be determined and documented by each language SIG.
"""
HTTP_REQUEST_METHOD = "http.request.method"
"""
HTTP request method.
Note: HTTP request method value SHOULD be "known" to the instrumentation.
By default, this convention defines "known" methods as the ones listed in [RFC9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-methods)
and the PATCH method defined in [RFC5789](https://www.rfc-editor.org/rfc/rfc5789.html).
If the HTTP request method is not known to instrumentation, it MUST set the `http.request.method` attribute to `_OTHER` and, except if reporting a metric, MUST
set the exact method received in the request line as value of the `http.request.method_original` attribute.
If the HTTP instrumentation could end up converting valid HTTP request methods to `_OTHER`, then it MUST provide a way to override
the list of known HTTP methods. If this override is done via environment variable, then the environment variable MUST be named
OTEL_INSTRUMENTATION_HTTP_KNOWN_METHODS and support a comma-separated list of case-sensitive known HTTP methods
(this list MUST be a full override of the default known method, it is not a list of known methods in addition to the defaults).
HTTP method names are case-sensitive and `http.request.method` attribute value MUST match a known HTTP method name exactly.
Instrumentations for specific web frameworks that consider HTTP methods to be case insensitive, SHOULD populate a canonical equivalent.
Tracing instrumentations that do so, MUST also set `http.request.method_original` to the original value.
"""
HTTP_RESPONSE_STATUS_CODE = "http.response.status_code"
"""
[HTTP response status code](https://tools.ietf.org/html/rfc7231#section-6).
"""
NETWORK_PROTOCOL_NAME = "network.protocol.name"
"""
[OSI Application Layer](https://osi-model.com/application-layer/) or non-OSI equivalent. The value SHOULD be normalized to lowercase.
"""
NETWORK_PROTOCOL_VERSION = "network.protocol.version"
"""
Version of the application layer protocol used. See note below.
Note: `network.protocol.version` refers to the version of the protocol used and might be different from the protocol client's version. If the HTTP client used has a version of `0.27.2`, but sends HTTP version `1.1`, this attribute should be set to `1.1`.
"""
SERVER_ADDRESS = "server.address"
"""
Host identifier of the ["URI origin"](https://www.rfc-editor.org/rfc/rfc9110.html#name-uri-origin) HTTP request is sent to.
Note: Determined by using the first of the following that applies
- Host identifier of the [request target](https://www.rfc-editor.org/rfc/rfc9110.html#target.resource)
if it's sent in absolute-form
- Host identifier of the `Host` header
SHOULD NOT be set if capturing it would require an extra DNS lookup.
"""
SERVER_PORT = "server.port"
"""
Port identifier of the ["URI origin"](https://www.rfc-editor.org/rfc/rfc9110.html#name-uri-origin) HTTP request is sent to.
Note: When [request target](https://www.rfc-editor.org/rfc/rfc9110.html#target.resource) is absolute URI, `server.port` MUST match URI port identifier, otherwise it MUST match `Host` header port identifier.
"""
HTTP_ROUTE = "http.route"
"""
The matched route (path template in the format used by the respective server framework). See note below.
Note: MUST NOT be populated when this is not supported by the HTTP server framework as the route attribute should have low-cardinality and the URI path can NOT substitute it.
SHOULD include the [application root](/docs/http/http-spans.md#http-server-definitions) if there is one.
"""
URL_SCHEME = "url.scheme"
"""
The [URI scheme](https://www.rfc-editor.org/rfc/rfc3986#section-3.1) component identifying the used protocol.
"""
EVENT_NAME = "event.name"
"""
The name identifies the event.
"""
EVENT_DOMAIN = "event.domain"
"""
The domain identifies the business context for the events.
Note: Events across different domains may have same `event.name`, yet be
unrelated events.
"""
LOG_RECORD_UID = "log.record.uid"
"""
A unique identifier for the Log Record.
Note: If an id is provided, other log records with the same id will be considered duplicates and can be removed safely. This means, that two distinguishable log records MUST have different values.
The id MAY be an [Universally Unique Lexicographically Sortable Identifier (ULID)](https://github.com/ulid/spec), but other identifiers (e.g. UUID) may be used as needed.
"""
FEATURE_FLAG_KEY = "feature_flag.key"
"""
The unique identifier of the feature flag.
"""
FEATURE_FLAG_PROVIDER_NAME = "feature_flag.provider_name"
"""
The name of the service provider that performs the flag evaluation.
"""
FEATURE_FLAG_VARIANT = "feature_flag.variant"
"""
SHOULD be a semantic identifier for a value. If one is unavailable, a stringified version of the value can be used.
Note: A semantic identifier, commonly referred to as a variant, provides a means
for referring to a value without including the value itself. This can
provide additional context for understanding the meaning behind a value.
For example, the variant `red` maybe be used for the value `#c05543`.
A stringified version of the value can be used in situations where a
semantic identifier is unavailable. String representation of the value
should be determined by the implementer.
"""
LOG_IOSTREAM = "log.iostream"
"""
The stream associated with the log. See below for a list of well-known values.
"""
LOG_FILE_NAME = "log.file.name"
"""
The basename of the file.
"""
LOG_FILE_PATH = "log.file.path"
"""
The full path to the file.
"""
LOG_FILE_NAME_RESOLVED = "log.file.name_resolved"
"""
The basename of the file, with symlinks resolved.
"""
LOG_FILE_PATH_RESOLVED = "log.file.path_resolved"
"""
The full path to the file, with symlinks resolved.
"""
SERVER_SOCKET_ADDRESS = "server.socket.address"
"""
Physical server IP address or Unix socket address. If set from the client, should simply use the socket's peer address, and not attempt to find any actual server IP (i.e., if set from client, this may represent some proxy server instead of the logical server).
"""
POOL = "pool"
"""
Name of the buffer pool.
Note: Pool names are generally obtained via [BufferPoolMXBean#getName()](https://docs.oracle.com/en/java/javase/11/docs/api/java.management/java/lang/management/BufferPoolMXBean.html#getName()).
"""
TYPE = "type"
"""
The type of memory.
"""
SERVER_SOCKET_DOMAIN = "server.socket.domain"
"""
The domain name of an immediate peer.
Note: Typically observed from the client side, and represents a proxy or other intermediary domain name.
"""
SERVER_SOCKET_PORT = "server.socket.port"
"""
Physical server port.
"""
SOURCE_DOMAIN = "source.domain"
"""
The domain name of the source system.
Note: This value may be a host name, a fully qualified domain name, or another host naming format.
"""
SOURCE_ADDRESS = "source.address"
"""
Source address, for example IP address or Unix socket name.
"""
SOURCE_PORT = "source.port"
"""
Source port number.
"""
AWS_LAMBDA_INVOKED_ARN = "aws.lambda.invoked_arn"
"""
The full invoked ARN as provided on the `Context` passed to the function (`Lambda-Runtime-Invoked-Function-Arn` header on the `/runtime/invocation/next` applicable).
Note: This may be different from `cloud.resource_id` if an alias is involved.
"""
CLOUDEVENTS_EVENT_ID = "cloudevents.event_id"
"""
The [event_id](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#id) uniquely identifies the event.
"""
CLOUDEVENTS_EVENT_SOURCE = "cloudevents.event_source"
"""
The [source](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#source-1) identifies the context in which an event happened.
"""
CLOUDEVENTS_EVENT_SPEC_VERSION = "cloudevents.event_spec_version"
"""
The [version of the CloudEvents specification](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#specversion) which the event uses.
"""
CLOUDEVENTS_EVENT_TYPE = "cloudevents.event_type"
"""
The [event_type](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#type) contains a value describing the type of event related to the originating occurrence.
"""
CLOUDEVENTS_EVENT_SUBJECT = "cloudevents.event_subject"
"""
The [subject](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#subject) of the event in the context of the event producer (identified by source).
"""
OPENTRACING_REF_TYPE = "opentracing.ref_type"
"""
Parent-child Reference type.
Note: The causal relationship between a child Span and a parent Span.
"""
DB_SYSTEM = "db.system"
"""
An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers.
"""
DB_CONNECTION_STRING = "db.connection_string"
"""
The connection string used to connect to the database. It is recommended to remove embedded credentials.
"""
DB_USER = "db.user"
"""
Username for accessing the database.
"""
DB_JDBC_DRIVER_CLASSNAME = "db.jdbc.driver_classname"
"""
The fully-qualified class name of the [Java Database Connectivity (JDBC)](https://docs.oracle.com/javase/8/docs/technotes/guides/jdbc/) driver used to connect.
"""
DB_NAME = "db.name"
"""
This attribute is used to report the name of the database being accessed. For commands that switch the database, this should be set to the target database (even if the command fails).
Note: In some SQL databases, the database name to be used is called "schema name". In case there are multiple layers that could be considered for database name (e.g. Oracle instance name and schema name), the database name to be used is the more specific layer (e.g. Oracle schema name).
"""
DB_STATEMENT = "db.statement"
"""
The database statement being executed.
"""
DB_OPERATION = "db.operation"
"""
The name of the operation being executed, e.g. the [MongoDB command name](https://docs.mongodb.com/manual/reference/command/#database-operations) such as `findAndModify`, or the SQL keyword.
Note: When setting this to an SQL keyword, it is not recommended to attempt any client-side parsing of `db.statement` just to get this property, but it should be set if the operation name is provided by the library being instrumented. If the SQL statement has an ambiguous operation, or performs more than one operation, this value may be omitted.
"""
NETWORK_TRANSPORT = "network.transport"
"""
[OSI Transport Layer](https://osi-model.com/transport-layer/) or [Inter-process Communication method](https://en.wikipedia.org/wiki/Inter-process_communication). The value SHOULD be normalized to lowercase.
"""
NETWORK_TYPE = "network.type"
"""
[OSI Network Layer](https://osi-model.com/network-layer/) or non-OSI equivalent. The value SHOULD be normalized to lowercase.
"""
DB_MSSQL_INSTANCE_NAME = "db.mssql.instance_name"
"""
The Microsoft SQL Server [instance name](https://docs.microsoft.com/en-us/sql/connect/jdbc/building-the-connection-url?view=sql-server-ver15) connecting to. This name is used to determine the port of a named instance.
Note: If setting a `db.mssql.instance_name`, `server.port` is no longer required (but still recommended if non-standard).
"""
DB_CASSANDRA_PAGE_SIZE = "db.cassandra.page_size"
"""
The fetch size used for paging, i.e. how many rows will be returned at once.
"""
DB_CASSANDRA_CONSISTENCY_LEVEL = "db.cassandra.consistency_level"
"""
The consistency level of the query. Based on consistency values from [CQL](https://docs.datastax.com/en/cassandra-oss/3.0/cassandra/dml/dmlConfigConsistency.html).
"""
DB_CASSANDRA_TABLE = "db.cassandra.table"
"""
The name of the primary table that the operation is acting upon, including the keyspace name (if applicable).
Note: This mirrors the db.sql.table attribute but references cassandra rather than sql. It is not recommended to attempt any client-side parsing of `db.statement` just to get this property, but it should be set if it is provided by the library being instrumented. If the operation is acting upon an anonymous table, or more than one table, this value MUST NOT be set.
"""
DB_CASSANDRA_IDEMPOTENCE = "db.cassandra.idempotence"
"""
Whether or not the query is idempotent.
"""
DB_CASSANDRA_SPECULATIVE_EXECUTION_COUNT = (
"db.cassandra.speculative_execution_count"
)
"""
The number of times a query was speculatively executed. Not set or `0` if the query was not executed speculatively.
"""
DB_CASSANDRA_COORDINATOR_ID = "db.cassandra.coordinator.id"
"""
The ID of the coordinating node for a query.
"""
DB_CASSANDRA_COORDINATOR_DC = "db.cassandra.coordinator.dc"
"""
The data center of the coordinating node for a query.
"""
DB_REDIS_DATABASE_INDEX = "db.redis.database_index"
"""
The index of the database being accessed as used in the [`SELECT` command](https://redis.io/commands/select), provided as an integer. To be used instead of the generic `db.name` attribute.
"""
DB_MONGODB_COLLECTION = "db.mongodb.collection"
"""
The collection being accessed within the database stated in `db.name`.
"""
URL_FULL = "url.full"
"""
Absolute URL describing a network resource according to [RFC3986](https://www.rfc-editor.org/rfc/rfc3986).
Note: For network calls, URL usually has `scheme://host[:port][path][?query][#fragment]` format, where the fragment is not transmitted over HTTP, but if it is known, it should be included nevertheless.
`url.full` MUST NOT contain credentials passed via URL in form of `https://username:password@www.example.com/`. In such case username and password should be redacted and attribute's value should be `https://REDACTED:REDACTED@www.example.com/`.
`url.full` SHOULD capture the absolute URL when it is available (or can be reconstructed) and SHOULD NOT be validated or modified except for sanitizing purposes.
"""
DB_SQL_TABLE = "db.sql.table"
"""
The name of the primary table that the operation is acting upon, including the database name (if applicable).
Note: It is not recommended to attempt any client-side parsing of `db.statement` just to get this property, but it should be set if it is provided by the library being instrumented. If the operation is acting upon an anonymous table, or more than one table, this value MUST NOT be set.
"""
DB_COSMOSDB_CLIENT_ID = "db.cosmosdb.client_id"
"""
Unique Cosmos client instance id.
"""
DB_COSMOSDB_OPERATION_TYPE = "db.cosmosdb.operation_type"
"""
CosmosDB Operation Type.
"""
USER_AGENT_ORIGINAL = "user_agent.original"
"""
Full user-agent string is generated by Cosmos DB SDK.
Note: The user-agent value is generated by SDK which is a combination of<br> `sdk_version` : Current version of SDK. e.g. 'cosmos-netstandard-sdk/3.23.0'<br> `direct_pkg_version` : Direct package version used by Cosmos DB SDK. e.g. '3.23.1'<br> `number_of_client_instances` : Number of cosmos client instances created by the application. e.g. '1'<br> `type_of_machine_architecture` : Machine architecture. e.g. 'X64'<br> `operating_system` : Operating System. e.g. 'Linux 5.4.0-1098-azure 104 18'<br> `runtime_framework` : Runtime Framework. e.g. '.NET Core 3.1.32'<br> `failover_information` : Generated key to determine if region failover enabled.
Format Reg-{D (Disabled discovery)}-S(application region)|L(List of preferred regions)|N(None, user did not configure it).
Default value is "NS".
"""
DB_COSMOSDB_CONNECTION_MODE = "db.cosmosdb.connection_mode"
"""
Cosmos client connection mode.
"""
DB_COSMOSDB_CONTAINER = "db.cosmosdb.container"
"""
Cosmos DB container name.
"""
DB_COSMOSDB_REQUEST_CONTENT_LENGTH = "db.cosmosdb.request_content_length"
"""
Request payload size in bytes.
"""
DB_COSMOSDB_STATUS_CODE = "db.cosmosdb.status_code"
"""
Cosmos DB status code.
"""
DB_COSMOSDB_SUB_STATUS_CODE = "db.cosmosdb.sub_status_code"
"""
Cosmos DB sub status code.
"""
DB_COSMOSDB_REQUEST_CHARGE = "db.cosmosdb.request_charge"
"""
RU consumed for that operation.
"""
OTEL_STATUS_CODE = "otel.status_code"
"""
Name of the code, either "OK" or "ERROR". MUST NOT be set if the status code is UNSET.
"""
OTEL_STATUS_DESCRIPTION = "otel.status_description"
"""
Description of the Status if it has a value, otherwise not set.
"""
FAAS_TRIGGER = "faas.trigger"
"""
Type of the trigger which caused this function invocation.
Note: For the server/consumer span on the incoming side,
`faas.trigger` MUST be set.
Clients invoking FaaS instances usually cannot set `faas.trigger`,
since they would typically need to look in the payload to determine
the event type. If clients set it, it should be the same as the
trigger that corresponding incoming would have (i.e., this has
nothing to do with the underlying transport used to make the API
call to invoke the lambda, which is often HTTP).
"""
FAAS_INVOCATION_ID = "faas.invocation_id"
"""
The invocation ID of the current function invocation.
"""
CLOUD_RESOURCE_ID = "cloud.resource_id"
"""
Cloud provider-specific native identifier of the monitored cloud resource (e.g. an [ARN](https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) on AWS, a [fully qualified resource ID](https://learn.microsoft.com/en-us/rest/api/resources/resources/get-by-id) on Azure, a [full resource name](https://cloud.google.com/apis/design/resource_names#full_resource_name) on GCP).
Note: On some cloud providers, it may not be possible to determine the full ID at startup,
so it may be necessary to set `cloud.resource_id` as a span attribute instead.
The exact value to use for `cloud.resource_id` depends on the cloud provider.
The following well-known definitions MUST be used if you set this attribute and they apply:
* **AWS Lambda:** The function [ARN](https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html).
Take care not to use the "invoked ARN" directly but replace any
[alias suffix](https://docs.aws.amazon.com/lambda/latest/dg/configuration-aliases.html)
with the resolved function version, as the same runtime instance may be invokable with
multiple different aliases.
* **GCP:** The [URI of the resource](https://cloud.google.com/iam/docs/full-resource-names)
* **Azure:** The [Fully Qualified Resource ID](https://docs.microsoft.com/en-us/rest/api/resources/resources/get-by-id) of the invoked function,
*not* the function app, having the form
`/subscriptions/<SUBSCIPTION_GUID>/resourceGroups/<RG>/providers/Microsoft.Web/sites/<FUNCAPP>/functions/<FUNC>`.
This means that a span attribute MUST be used, as an Azure function app can host multiple functions that would usually share
a TracerProvider.
"""
FAAS_DOCUMENT_COLLECTION = "faas.document.collection"
"""
The name of the source on which the triggering operation was performed. For example, in Cloud Storage or S3 corresponds to the bucket name, and in Cosmos DB to the database name.
"""
FAAS_DOCUMENT_OPERATION = "faas.document.operation"
"""
Describes the type of the operation that was performed on the data.
"""
FAAS_DOCUMENT_TIME = "faas.document.time"
"""
A string containing the time when the data was accessed in the [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format expressed in [UTC](https://www.w3.org/TR/NOTE-datetime).
"""
FAAS_DOCUMENT_NAME = "faas.document.name"
"""
The document name/table subjected to the operation. For example, in Cloud Storage or S3 is the name of the file, and in Cosmos DB the table name.
"""
URL_PATH = "url.path"
"""
The [URI path](https://www.rfc-editor.org/rfc/rfc3986#section-3.3) component.
Note: When missing, the value is assumed to be `/`.
"""
URL_QUERY = "url.query"
"""
The [URI query](https://www.rfc-editor.org/rfc/rfc3986#section-3.4) component.
Note: Sensitive content provided in query string SHOULD be scrubbed when instrumentations can identify it.
"""
MESSAGING_SYSTEM = "messaging.system"
"""
A string identifying the messaging system.
"""
MESSAGING_OPERATION = "messaging.operation"
"""
A string identifying the kind of messaging operation as defined in the [Operation names](#operation-names) section above.
Note: If a custom value is used, it MUST be of low cardinality.
"""
MESSAGING_BATCH_MESSAGE_COUNT = "messaging.batch.message_count"
"""
The number of messages sent, received, or processed in the scope of the batching operation.
Note: Instrumentations SHOULD NOT set `messaging.batch.message_count` on spans that operate with a single message. When a messaging client library supports both batch and single-message API for the same operation, instrumentations SHOULD use `messaging.batch.message_count` for batching APIs and SHOULD NOT use it for single-message APIs.
"""
MESSAGING_CLIENT_ID = "messaging.client_id"
"""
A unique identifier for the client that consumes or produces a message.
"""
MESSAGING_DESTINATION_NAME = "messaging.destination.name"
"""
The message destination name.
Note: Destination name SHOULD uniquely identify a specific queue, topic or other entity within the broker. If
the broker does not have such notion, the destination name SHOULD uniquely identify the broker.
"""
MESSAGING_DESTINATION_TEMPLATE = "messaging.destination.template"
"""
Low cardinality representation of the messaging destination name.
Note: Destination names could be constructed from templates. An example would be a destination name involving a user name or product id. Although the destination name in this case is of high cardinality, the underlying template is of low cardinality and can be effectively used for grouping and aggregation.
"""
MESSAGING_DESTINATION_TEMPORARY = "messaging.destination.temporary"
"""
A boolean that is true if the message destination is temporary and might not exist anymore after messages are processed.
"""
MESSAGING_DESTINATION_ANONYMOUS = "messaging.destination.anonymous"
"""
A boolean that is true if the message destination is anonymous (could be unnamed or have auto-generated name).
"""
MESSAGING_MESSAGE_ID = "messaging.message.id"
"""
A value used by the messaging system as an identifier for the message, represented as a string.
"""
MESSAGING_MESSAGE_CONVERSATION_ID = "messaging.message.conversation_id"
"""
The [conversation ID](#conversations) identifying the conversation to which the message belongs, represented as a string. Sometimes called "Correlation ID".
"""
MESSAGING_MESSAGE_PAYLOAD_SIZE_BYTES = (
"messaging.message.payload_size_bytes"
)
"""
The (uncompressed) size of the message payload in bytes. Also use this attribute if it is unknown whether the compressed or uncompressed payload size is reported.
"""
MESSAGING_MESSAGE_PAYLOAD_COMPRESSED_SIZE_BYTES = (
"messaging.message.payload_compressed_size_bytes"
)
"""
The compressed size of the message payload in bytes.
"""
FAAS_TIME = "faas.time"
"""
A string containing the function invocation time in the [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format expressed in [UTC](https://www.w3.org/TR/NOTE-datetime).
"""
FAAS_CRON = "faas.cron"
"""
A string containing the schedule period as [Cron Expression](https://docs.oracle.com/cd/E12058_01/doc/doc.1014/e12030/cron_expressions.htm).
"""
FAAS_COLDSTART = "faas.coldstart"
"""
A boolean that is true if the serverless function is executed for the first time (aka cold-start).
"""
FAAS_INVOKED_NAME = "faas.invoked_name"
"""
The name of the invoked function.
Note: SHOULD be equal to the `faas.name` resource attribute of the invoked function.
"""
FAAS_INVOKED_PROVIDER = "faas.invoked_provider"
"""
The cloud provider of the invoked function.
Note: SHOULD be equal to the `cloud.provider` resource attribute of the invoked function.
"""
FAAS_INVOKED_REGION = "faas.invoked_region"
"""
The cloud region of the invoked function.
Note: SHOULD be equal to the `cloud.region` resource attribute of the invoked function.
"""
NETWORK_CONNECTION_TYPE = "network.connection.type"
"""
The internet connection type.
"""
NETWORK_CONNECTION_SUBTYPE = "network.connection.subtype"
"""
This describes more details regarding the connection.type. It may be the type of cell technology connection, but it could be used for describing details about a wifi connection.
"""
NETWORK_CARRIER_NAME = "network.carrier.name"
"""
The name of the mobile carrier.
"""
NETWORK_CARRIER_MCC = "network.carrier.mcc"
"""
The mobile carrier country code.
"""
NETWORK_CARRIER_MNC = "network.carrier.mnc"
"""
The mobile carrier network code.
"""
NETWORK_CARRIER_ICC = "network.carrier.icc"
"""
The ISO 3166-1 alpha-2 2-character country code associated with the mobile carrier network.
"""
PEER_SERVICE = "peer.service"
"""
The [`service.name`](/docs/resource/README.md#service) of the remote service. SHOULD be equal to the actual `service.name` resource attribute of the remote service if any.
"""
ENDUSER_ID = "enduser.id"
"""
Username or client_id extracted from the access token or [Authorization](https://tools.ietf.org/html/rfc7235#section-4.2) header in the inbound request from outside the system.
"""
ENDUSER_ROLE = "enduser.role"
"""
Actual/assumed role the client is making the request under extracted from token or application security context.
"""
ENDUSER_SCOPE = "enduser.scope"
"""
Scopes or granted authorities the client currently possesses extracted from token or application security context. The value would come from the scope associated with an [OAuth 2.0 Access Token](https://tools.ietf.org/html/rfc6749#section-3.3) or an attribute value in a [SAML 2.0 Assertion](http://docs.oasis-open.org/security/saml/Post2.0/sstc-saml-tech-overview-2.0.html).
"""
THREAD_ID = "thread.id"
"""
Current "managed" thread ID (as opposed to OS thread ID).
"""
THREAD_NAME = "thread.name"
"""
Current thread name.
"""
CODE_FUNCTION = "code.function"
"""
The method or function name, or equivalent (usually rightmost part of the code unit's name).
"""
CODE_NAMESPACE = "code.namespace"
"""
The "namespace" within which `code.function` is defined. Usually the qualified class or module name, such that `code.namespace` + some separator + `code.function` form a unique identifier for the code unit.
"""
CODE_FILEPATH = "code.filepath"
"""
The source code file name that identifies the code unit as uniquely as possible (preferably an absolute file path).
"""
CODE_LINENO = "code.lineno"
"""
The line number in `code.filepath` best representing the operation. It SHOULD point within the code unit named in `code.function`.
"""
CODE_COLUMN = "code.column"
"""
The column number in `code.filepath` best representing the operation. It SHOULD point within the code unit named in `code.function`.
"""
HTTP_REQUEST_METHOD_ORIGINAL = "http.request.method_original"
"""
Original HTTP method sent by the client in the request line.
"""
HTTP_REQUEST_BODY_SIZE = "http.request.body.size"
"""
The size of the request payload body in bytes. This is the number of bytes transferred excluding headers and is often, but not always, present as the [Content-Length](https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length) header. For requests using transport encoding, this should be the compressed size.
"""
HTTP_RESPONSE_BODY_SIZE = "http.response.body.size"
"""
The size of the response payload body in bytes. This is the number of bytes transferred excluding headers and is often, but not always, present as the [Content-Length](https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length) header. For requests using transport encoding, this should be the compressed size.
"""
HTTP_RESEND_COUNT = "http.resend_count"
"""
The ordinal number of request resending attempt (for any reason, including redirects).
Note: The resend count SHOULD be updated each time an HTTP request gets resent by the client, regardless of what was the cause of the resending (e.g. redirection, authorization failure, 503 Server Unavailable, network issues, or any other).
"""
RPC_SYSTEM = "rpc.system"
"""
The value `aws-api`.
"""
RPC_SERVICE = "rpc.service"
"""
The name of the service to which a request is made, as returned by the AWS SDK.
Note: This is the logical name of the service from the RPC interface perspective, which can be different from the name of any implementing class. The `code.namespace` attribute may be used to store the latter (despite the attribute name, it may include a class name; e.g., class with method actually executing the call on the server side, RPC client stub class on the client side).
"""
RPC_METHOD = "rpc.method"
"""
The name of the operation corresponding to the request, as returned by the AWS SDK.
Note: This is the logical name of the method from the RPC interface perspective, which can be different from the name of any implementing method/function. The `code.function` attribute may be used to store the latter (e.g., method actually executing the call on the server side, RPC client stub method on the client side).
"""
AWS_REQUEST_ID = "aws.request_id"
"""
The AWS request ID as returned in the response headers `x-amz-request-id` or `x-amz-requestid`.
"""
AWS_DYNAMODB_TABLE_NAMES = "aws.dynamodb.table_names"
"""
The keys in the `RequestItems` object field.
"""
AWS_DYNAMODB_CONSUMED_CAPACITY = "aws.dynamodb.consumed_capacity"
"""
The JSON-serialized value of each item in the `ConsumedCapacity` response field.
"""
AWS_DYNAMODB_ITEM_COLLECTION_METRICS = (
"aws.dynamodb.item_collection_metrics"
)
"""
The JSON-serialized value of the `ItemCollectionMetrics` response field.
"""
AWS_DYNAMODB_PROVISIONED_READ_CAPACITY = (
"aws.dynamodb.provisioned_read_capacity"
)
"""
The value of the `ProvisionedThroughput.ReadCapacityUnits` request parameter.
"""
AWS_DYNAMODB_PROVISIONED_WRITE_CAPACITY = (
"aws.dynamodb.provisioned_write_capacity"
)
"""
The value of the `ProvisionedThroughput.WriteCapacityUnits` request parameter.
"""
AWS_DYNAMODB_CONSISTENT_READ = "aws.dynamodb.consistent_read"
"""
The value of the `ConsistentRead` request parameter.
"""
AWS_DYNAMODB_PROJECTION = "aws.dynamodb.projection"
"""
The value of the `ProjectionExpression` request parameter.
"""
AWS_DYNAMODB_LIMIT = "aws.dynamodb.limit"
"""
The value of the `Limit` request parameter.
"""
AWS_DYNAMODB_ATTRIBUTES_TO_GET = "aws.dynamodb.attributes_to_get"
"""
The value of the `AttributesToGet` request parameter.
"""
AWS_DYNAMODB_INDEX_NAME = "aws.dynamodb.index_name"
"""
The value of the `IndexName` request parameter.
"""
AWS_DYNAMODB_SELECT = "aws.dynamodb.select"
"""
The value of the `Select` request parameter.
"""
AWS_DYNAMODB_GLOBAL_SECONDARY_INDEXES = (
"aws.dynamodb.global_secondary_indexes"
)
"""
The JSON-serialized value of each item of the `GlobalSecondaryIndexes` request field.
"""
AWS_DYNAMODB_LOCAL_SECONDARY_INDEXES = (
"aws.dynamodb.local_secondary_indexes"
)
"""
The JSON-serialized value of each item of the `LocalSecondaryIndexes` request field.
"""
AWS_DYNAMODB_EXCLUSIVE_START_TABLE = "aws.dynamodb.exclusive_start_table"
"""
The value of the `ExclusiveStartTableName` request parameter.
"""
AWS_DYNAMODB_TABLE_COUNT = "aws.dynamodb.table_count"
"""
The the number of items in the `TableNames` response parameter.
"""
AWS_DYNAMODB_SCAN_FORWARD = "aws.dynamodb.scan_forward"
"""
The value of the `ScanIndexForward` request parameter.
"""
AWS_DYNAMODB_SEGMENT = "aws.dynamodb.segment"
"""
The value of the `Segment` request parameter.
"""
AWS_DYNAMODB_TOTAL_SEGMENTS = "aws.dynamodb.total_segments"
"""
The value of the `TotalSegments` request parameter.
"""
AWS_DYNAMODB_COUNT = "aws.dynamodb.count"
"""
The value of the `Count` response parameter.
"""
AWS_DYNAMODB_SCANNED_COUNT = "aws.dynamodb.scanned_count"
"""
The value of the `ScannedCount` response parameter.
"""
AWS_DYNAMODB_ATTRIBUTE_DEFINITIONS = "aws.dynamodb.attribute_definitions"
"""
The JSON-serialized value of each item in the `AttributeDefinitions` request field.
"""
AWS_DYNAMODB_GLOBAL_SECONDARY_INDEX_UPDATES = (
"aws.dynamodb.global_secondary_index_updates"
)
"""
The JSON-serialized value of each item in the the `GlobalSecondaryIndexUpdates` request field.
"""
AWS_S3_BUCKET = "aws.s3.bucket"
"""
The S3 bucket name the request refers to. Corresponds to the `--bucket` parameter of the [S3 API](https://docs.aws.amazon.com/cli/latest/reference/s3api/index.html) operations.
Note: The `bucket` attribute is applicable to all S3 operations that reference a bucket, i.e. that require the bucket name as a mandatory parameter.
This applies to almost all S3 operations except `list-buckets`.
"""