Coverage for /pythoncovmergedfiles/medio/medio/usr/local/lib/python3.8/site-packages/opentelemetry/semconv/resource/__init__.py: 100%
156 statements
« prev ^ index » next coverage.py v7.2.7, created at 2023-06-07 06:35 +0000
« prev ^ index » next coverage.py v7.2.7, created at 2023-06-07 06:35 +0000
1# Copyright The OpenTelemetry Authors
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7# http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
15from enum import Enum
18class ResourceAttributes:
19 CLOUD_PROVIDER = "cloud.provider"
20 """
21 Name of the cloud provider.
22 """
24 CLOUD_ACCOUNT_ID = "cloud.account.id"
25 """
26 The cloud account ID the resource is assigned to.
27 """
29 CLOUD_REGION = "cloud.region"
30 """
31 The geographical region the resource is running.
32 Note: Refer to your provider's docs to see the available regions, for example [Alibaba Cloud regions](https://www.alibabacloud.com/help/doc-detail/40654.htm), [AWS regions](https://aws.amazon.com/about-aws/global-infrastructure/regions_az/), [Azure regions](https://azure.microsoft.com/en-us/global-infrastructure/geographies/), [Google Cloud regions](https://cloud.google.com/about/locations), or [Tencent Cloud regions](https://intl.cloud.tencent.com/document/product/213/6091).
33 """
35 CLOUD_AVAILABILITY_ZONE = "cloud.availability_zone"
36 """
37 Cloud regions often have multiple, isolated locations known as zones to increase availability. Availability zone represents the zone where the resource is running.
38 Note: Availability zones are called "zones" on Alibaba Cloud and Google Cloud.
39 """
41 CLOUD_PLATFORM = "cloud.platform"
42 """
43 The cloud platform in use.
44 Note: The prefix of the service SHOULD match the one specified in `cloud.provider`.
45 """
47 AWS_ECS_CONTAINER_ARN = "aws.ecs.container.arn"
48 """
49 The Amazon Resource Name (ARN) of an [ECS container instance](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ECS_instances.html).
50 """
52 AWS_ECS_CLUSTER_ARN = "aws.ecs.cluster.arn"
53 """
54 The ARN of an [ECS cluster](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/clusters.html).
55 """
57 AWS_ECS_LAUNCHTYPE = "aws.ecs.launchtype"
58 """
59 The [launch type](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/launch_types.html) for an ECS task.
60 """
62 AWS_ECS_TASK_ARN = "aws.ecs.task.arn"
63 """
64 The ARN of an [ECS task definition](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definitions.html).
65 """
67 AWS_ECS_TASK_FAMILY = "aws.ecs.task.family"
68 """
69 The task definition family this task definition is a member of.
70 """
72 AWS_ECS_TASK_REVISION = "aws.ecs.task.revision"
73 """
74 The revision for this task definition.
75 """
77 AWS_EKS_CLUSTER_ARN = "aws.eks.cluster.arn"
78 """
79 The ARN of an EKS cluster.
80 """
82 AWS_LOG_GROUP_NAMES = "aws.log.group.names"
83 """
84 The name(s) of the AWS log group(s) an application is writing to.
85 Note: Multiple log groups must be supported for cases like multi-container applications, where a single application has sidecar containers, and each write to their own log group.
86 """
88 AWS_LOG_GROUP_ARNS = "aws.log.group.arns"
89 """
90 The Amazon Resource Name(s) (ARN) of the AWS log group(s).
91 Note: See the [log group ARN format documentation](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/iam-access-control-overview-cwl.html#CWL_ARN_Format).
92 """
94 AWS_LOG_STREAM_NAMES = "aws.log.stream.names"
95 """
96 The name(s) of the AWS log stream(s) an application is writing to.
97 """
99 AWS_LOG_STREAM_ARNS = "aws.log.stream.arns"
100 """
101 The ARN(s) of the AWS log stream(s).
102 Note: See the [log stream ARN format documentation](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/iam-access-control-overview-cwl.html#CWL_ARN_Format). One log group can contain several log streams, so these ARNs necessarily identify both a log group and a log stream.
103 """
105 CONTAINER_NAME = "container.name"
106 """
107 Container name used by container runtime.
108 """
110 CONTAINER_ID = "container.id"
111 """
112 Container ID. Usually a UUID, as for example used to [identify Docker containers](https://docs.docker.com/engine/reference/run/#container-identification). The UUID might be abbreviated.
113 """
115 CONTAINER_RUNTIME = "container.runtime"
116 """
117 The container runtime managing this container.
118 """
120 CONTAINER_IMAGE_NAME = "container.image.name"
121 """
122 Name of the image the container was built on.
123 """
125 CONTAINER_IMAGE_TAG = "container.image.tag"
126 """
127 Container image tag.
128 """
130 DEPLOYMENT_ENVIRONMENT = "deployment.environment"
131 """
132 Name of the [deployment environment](https://en.wikipedia.org/wiki/Deployment_environment) (aka deployment tier).
133 """
135 DEVICE_ID = "device.id"
136 """
137 A unique identifier representing the device.
138 Note: The device identifier MUST only be defined using the values outlined below. This value is not an advertising identifier and MUST NOT be used as such. On iOS (Swift or Objective-C), this value MUST be equal to the [vendor identifier](https://developer.apple.com/documentation/uikit/uidevice/1620059-identifierforvendor). On Android (Java or Kotlin), this value MUST be equal to the Firebase Installation ID or a globally unique UUID which is persisted across sessions in your application. More information can be found [here](https://developer.android.com/training/articles/user-data-ids) on best practices and exact implementation details. Caution should be taken when storing personal data or anything which can identify a user. GDPR and data protection laws may apply, ensure you do your own due diligence.
139 """
141 DEVICE_MODEL_IDENTIFIER = "device.model.identifier"
142 """
143 The model identifier for the device.
144 Note: It's recommended this value represents a machine readable version of the model identifier rather than the market or consumer-friendly name of the device.
145 """
147 DEVICE_MODEL_NAME = "device.model.name"
148 """
149 The marketing name for the device model.
150 Note: It's recommended this value represents a human readable version of the device model rather than a machine readable alternative.
151 """
153 DEVICE_MANUFACTURER = "device.manufacturer"
154 """
155 The name of the device manufacturer.
156 Note: The Android OS provides this field via [Build](https://developer.android.com/reference/android/os/Build#MANUFACTURER). iOS apps SHOULD hardcode the value `Apple`.
157 """
159 FAAS_NAME = "faas.name"
160 """
161 The name of the single function that this runtime instance executes.
162 Note: This is the name of the function as configured/deployed on the FaaS platform and is usually different from the name of the callback function (which may be stored in the [`code.namespace`/`code.function`](../../trace/semantic_conventions/span-general.md#source-code-attributes) span attributes).
163 """
165 FAAS_ID = "faas.id"
166 """
167 The unique ID of the single function that this runtime instance executes.
168 Note: Depending on the cloud provider, use:
170* **AWS Lambda:** The function [ARN](https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html).
171Take care not to use the "invoked ARN" directly but replace any
172[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 invocable with multiple
173different aliases.
174* **GCP:** The [URI of the resource](https://cloud.google.com/iam/docs/full-resource-names)
175* **Azure:** The [Fully Qualified Resource ID](https://docs.microsoft.com/en-us/rest/api/resources/resources/get-by-id).
177On some providers, it may not be possible to determine the full ID at startup,
178which is why this field cannot be made required. For example, on AWS the account ID
179part of the ARN is not available without calling another AWS API
180which may be deemed too slow for a short-running lambda function.
181As an alternative, consider setting `faas.id` as a span attribute instead.
182 """
184 FAAS_VERSION = "faas.version"
185 """
186 The immutable version of the function being executed.
187 Note: Depending on the cloud provider and platform, use:
189* **AWS Lambda:** The [function version](https://docs.aws.amazon.com/lambda/latest/dg/configuration-versions.html)
190 (an integer represented as a decimal string).
191* **Google Cloud Run:** The [revision](https://cloud.google.com/run/docs/managing/revisions)
192 (i.e., the function name plus the revision suffix).
193* **Google Cloud Functions:** The value of the
194 [`K_REVISION` environment variable](https://cloud.google.com/functions/docs/env-var#runtime_environment_variables_set_automatically).
195* **Azure Functions:** Not applicable. Do not set this attribute.
196 """
198 FAAS_INSTANCE = "faas.instance"
199 """
200 The execution environment ID as a string, that will be potentially reused for other invocations to the same function/function version.
201 Note: * **AWS Lambda:** Use the (full) log stream name.
202 """
204 FAAS_MAX_MEMORY = "faas.max_memory"
205 """
206 The amount of memory available to the serverless function in MiB.
207 Note: It's recommended to set this attribute since e.g. too little memory can easily stop a Java AWS Lambda function from working correctly. On AWS Lambda, the environment variable `AWS_LAMBDA_FUNCTION_MEMORY_SIZE` provides this information.
208 """
210 HOST_ID = "host.id"
211 """
212 Unique host ID. For Cloud, this must be the instance_id assigned by the cloud provider.
213 """
215 HOST_NAME = "host.name"
216 """
217 Name of the host. On Unix systems, it may contain what the hostname command returns, or the fully qualified hostname, or another name specified by the user.
218 """
220 HOST_TYPE = "host.type"
221 """
222 Type of host. For Cloud, this must be the machine type.
223 """
225 HOST_ARCH = "host.arch"
226 """
227 The CPU architecture the host system is running on.
228 """
230 HOST_IMAGE_NAME = "host.image.name"
231 """
232 Name of the VM image or OS install the host was instantiated from.
233 """
235 HOST_IMAGE_ID = "host.image.id"
236 """
237 VM image ID. For Cloud, this value is from the provider.
238 """
240 HOST_IMAGE_VERSION = "host.image.version"
241 """
242 The version string of the VM image as defined in [Version Attributes](README.md#version-attributes).
243 """
245 K8S_CLUSTER_NAME = "k8s.cluster.name"
246 """
247 The name of the cluster.
248 """
250 K8S_NODE_NAME = "k8s.node.name"
251 """
252 The name of the Node.
253 """
255 K8S_NODE_UID = "k8s.node.uid"
256 """
257 The UID of the Node.
258 """
260 K8S_NAMESPACE_NAME = "k8s.namespace.name"
261 """
262 The name of the namespace that the pod is running in.
263 """
265 K8S_POD_UID = "k8s.pod.uid"
266 """
267 The UID of the Pod.
268 """
270 K8S_POD_NAME = "k8s.pod.name"
271 """
272 The name of the Pod.
273 """
275 K8S_CONTAINER_NAME = "k8s.container.name"
276 """
277 The name of the Container from Pod specification, must be unique within a Pod. Container runtime usually uses different globally unique name (`container.name`).
278 """
280 K8S_CONTAINER_RESTART_COUNT = "k8s.container.restart_count"
281 """
282 Number of times the container was restarted. This attribute can be used to identify a particular container (running or stopped) within a container spec.
283 """
285 K8S_REPLICASET_UID = "k8s.replicaset.uid"
286 """
287 The UID of the ReplicaSet.
288 """
290 K8S_REPLICASET_NAME = "k8s.replicaset.name"
291 """
292 The name of the ReplicaSet.
293 """
295 K8S_DEPLOYMENT_UID = "k8s.deployment.uid"
296 """
297 The UID of the Deployment.
298 """
300 K8S_DEPLOYMENT_NAME = "k8s.deployment.name"
301 """
302 The name of the Deployment.
303 """
305 K8S_STATEFULSET_UID = "k8s.statefulset.uid"
306 """
307 The UID of the StatefulSet.
308 """
310 K8S_STATEFULSET_NAME = "k8s.statefulset.name"
311 """
312 The name of the StatefulSet.
313 """
315 K8S_DAEMONSET_UID = "k8s.daemonset.uid"
316 """
317 The UID of the DaemonSet.
318 """
320 K8S_DAEMONSET_NAME = "k8s.daemonset.name"
321 """
322 The name of the DaemonSet.
323 """
325 K8S_JOB_UID = "k8s.job.uid"
326 """
327 The UID of the Job.
328 """
330 K8S_JOB_NAME = "k8s.job.name"
331 """
332 The name of the Job.
333 """
335 K8S_CRONJOB_UID = "k8s.cronjob.uid"
336 """
337 The UID of the CronJob.
338 """
340 K8S_CRONJOB_NAME = "k8s.cronjob.name"
341 """
342 The name of the CronJob.
343 """
345 OS_TYPE = "os.type"
346 """
347 The operating system type.
348 """
350 OS_DESCRIPTION = "os.description"
351 """
352 Human readable (not intended to be parsed) OS version information, like e.g. reported by `ver` or `lsb_release -a` commands.
353 """
355 OS_NAME = "os.name"
356 """
357 Human readable operating system name.
358 """
360 OS_VERSION = "os.version"
361 """
362 The version string of the operating system as defined in [Version Attributes](../../resource/semantic_conventions/README.md#version-attributes).
363 """
365 PROCESS_PID = "process.pid"
366 """
367 Process identifier (PID).
368 """
370 PROCESS_EXECUTABLE_NAME = "process.executable.name"
371 """
372 The name of the process executable. On Linux based systems, can be set to the `Name` in `proc/[pid]/status`. On Windows, can be set to the base name of `GetProcessImageFileNameW`.
373 """
375 PROCESS_EXECUTABLE_PATH = "process.executable.path"
376 """
377 The full path to the process executable. On Linux based systems, can be set to the target of `proc/[pid]/exe`. On Windows, can be set to the result of `GetProcessImageFileNameW`.
378 """
380 PROCESS_COMMAND = "process.command"
381 """
382 The command used to launch the process (i.e. the command name). On Linux based systems, can be set to the zeroth string in `proc/[pid]/cmdline`. On Windows, can be set to the first parameter extracted from `GetCommandLineW`.
383 """
385 PROCESS_COMMAND_LINE = "process.command_line"
386 """
387 The full command used to launch the process as a single string representing the full command. On Windows, can be set to the result of `GetCommandLineW`. Do not set this if you have to assemble it just for monitoring; use `process.command_args` instead.
388 """
390 PROCESS_COMMAND_ARGS = "process.command_args"
391 """
392 All the command arguments (including the command/executable itself) as received by the process. On Linux-based systems (and some other Unixoid systems supporting procfs), can be set according to the list of null-delimited strings extracted from `proc/[pid]/cmdline`. For libc-based executables, this would be the full argv vector passed to `main`.
393 """
395 PROCESS_OWNER = "process.owner"
396 """
397 The username of the user that owns the process.
398 """
400 PROCESS_RUNTIME_NAME = "process.runtime.name"
401 """
402 The name of the runtime of this process. For compiled native binaries, this SHOULD be the name of the compiler.
403 """
405 PROCESS_RUNTIME_VERSION = "process.runtime.version"
406 """
407 The version of the runtime of this process, as returned by the runtime without modification.
408 """
410 PROCESS_RUNTIME_DESCRIPTION = "process.runtime.description"
411 """
412 An additional description about the runtime of the process, for example a specific vendor customization of the runtime environment.
413 """
415 SERVICE_NAME = "service.name"
416 """
417 Logical name of the service.
418 Note: MUST be the same for all instances of horizontally scaled services. If the value was not specified, SDKs MUST fallback to `unknown_service:` concatenated with [`process.executable.name`](process.md#process), e.g. `unknown_service:bash`. If `process.executable.name` is not available, the value MUST be set to `unknown_service`.
419 """
421 SERVICE_NAMESPACE = "service.namespace"
422 """
423 A namespace for `service.name`.
424 Note: A string value having a meaning that helps to distinguish a group of services, for example the team name that owns a group of services. `service.name` is expected to be unique within the same namespace. If `service.namespace` is not specified in the Resource then `service.name` is expected to be unique for all services that have no explicit namespace defined (so the empty/unspecified namespace is simply one more valid namespace). Zero-length namespace string is assumed equal to unspecified namespace.
425 """
427 SERVICE_INSTANCE_ID = "service.instance.id"
428 """
429 The string ID of the service instance.
430 Note: MUST be unique for each instance of the same `service.namespace,service.name` pair (in other words `service.namespace,service.name,service.instance.id` triplet MUST be globally unique). The ID helps to distinguish instances of the same service that exist at the same time (e.g. instances of a horizontally scaled service). It is preferable for the ID to be persistent and stay the same for the lifetime of the service instance, however it is acceptable that the ID is ephemeral and changes during important lifetime events for the service (e.g. service restarts). If the service has no inherent unique ID that can be used as the value of this attribute it is recommended to generate a random Version 1 or Version 4 RFC 4122 UUID (services aiming for reproducible UUIDs may also use Version 5, see RFC 4122 for more recommendations).
431 """
433 SERVICE_VERSION = "service.version"
434 """
435 The version string of the service API or implementation.
436 """
438 TELEMETRY_SDK_NAME = "telemetry.sdk.name"
439 """
440 The name of the telemetry SDK as defined above.
441 """
443 TELEMETRY_SDK_LANGUAGE = "telemetry.sdk.language"
444 """
445 The language of the telemetry SDK.
446 """
448 TELEMETRY_SDK_VERSION = "telemetry.sdk.version"
449 """
450 The version string of the telemetry SDK.
451 """
453 TELEMETRY_AUTO_VERSION = "telemetry.auto.version"
454 """
455 The version string of the auto instrumentation agent, if used.
456 """
458 WEBENGINE_NAME = "webengine.name"
459 """
460 The name of the web engine.
461 """
463 WEBENGINE_VERSION = "webengine.version"
464 """
465 The version of the web engine.
466 """
468 WEBENGINE_DESCRIPTION = "webengine.description"
469 """
470 Additional description of the web engine (e.g. detailed version and edition information).
471 """
474class CloudProviderValues(Enum):
475 ALIBABA_CLOUD = "alibaba_cloud"
476 """Alibaba Cloud."""
478 AWS = "aws"
479 """Amazon Web Services."""
481 AZURE = "azure"
482 """Microsoft Azure."""
484 GCP = "gcp"
485 """Google Cloud Platform."""
487 TENCENT_CLOUD = "tencent_cloud"
488 """Tencent Cloud."""
491class CloudPlatformValues(Enum):
492 ALIBABA_CLOUD_ECS = "alibaba_cloud_ecs"
493 """Alibaba Cloud Elastic Compute Service."""
495 ALIBABA_CLOUD_FC = "alibaba_cloud_fc"
496 """Alibaba Cloud Function Compute."""
498 AWS_EC2 = "aws_ec2"
499 """AWS Elastic Compute Cloud."""
501 AWS_ECS = "aws_ecs"
502 """AWS Elastic Container Service."""
504 AWS_EKS = "aws_eks"
505 """AWS Elastic Kubernetes Service."""
507 AWS_LAMBDA = "aws_lambda"
508 """AWS Lambda."""
510 AWS_ELASTIC_BEANSTALK = "aws_elastic_beanstalk"
511 """AWS Elastic Beanstalk."""
513 AWS_APP_RUNNER = "aws_app_runner"
514 """AWS App Runner."""
516 AZURE_VM = "azure_vm"
517 """Azure Virtual Machines."""
519 AZURE_CONTAINER_INSTANCES = "azure_container_instances"
520 """Azure Container Instances."""
522 AZURE_AKS = "azure_aks"
523 """Azure Kubernetes Service."""
525 AZURE_FUNCTIONS = "azure_functions"
526 """Azure Functions."""
528 AZURE_APP_SERVICE = "azure_app_service"
529 """Azure App Service."""
531 GCP_COMPUTE_ENGINE = "gcp_compute_engine"
532 """Google Cloud Compute Engine (GCE)."""
534 GCP_CLOUD_RUN = "gcp_cloud_run"
535 """Google Cloud Run."""
537 GCP_KUBERNETES_ENGINE = "gcp_kubernetes_engine"
538 """Google Cloud Kubernetes Engine (GKE)."""
540 GCP_CLOUD_FUNCTIONS = "gcp_cloud_functions"
541 """Google Cloud Functions (GCF)."""
543 GCP_APP_ENGINE = "gcp_app_engine"
544 """Google Cloud App Engine (GAE)."""
546 TENCENT_CLOUD_CVM = "tencent_cloud_cvm"
547 """Tencent Cloud Cloud Virtual Machine (CVM)."""
549 TENCENT_CLOUD_EKS = "tencent_cloud_eks"
550 """Tencent Cloud Elastic Kubernetes Service (EKS)."""
552 TENCENT_CLOUD_SCF = "tencent_cloud_scf"
553 """Tencent Cloud Serverless Cloud Function (SCF)."""
556class AwsEcsLaunchtypeValues(Enum):
557 EC2 = "ec2"
558 """ec2."""
560 FARGATE = "fargate"
561 """fargate."""
564class HostArchValues(Enum):
565 AMD64 = "amd64"
566 """AMD64."""
568 ARM32 = "arm32"
569 """ARM32."""
571 ARM64 = "arm64"
572 """ARM64."""
574 IA64 = "ia64"
575 """Itanium."""
577 PPC32 = "ppc32"
578 """32-bit PowerPC."""
580 PPC64 = "ppc64"
581 """64-bit PowerPC."""
583 S390X = "s390x"
584 """IBM z/Architecture."""
586 X86 = "x86"
587 """32-bit x86."""
590class OsTypeValues(Enum):
591 WINDOWS = "windows"
592 """Microsoft Windows."""
594 LINUX = "linux"
595 """Linux."""
597 DARWIN = "darwin"
598 """Apple Darwin."""
600 FREEBSD = "freebsd"
601 """FreeBSD."""
603 NETBSD = "netbsd"
604 """NetBSD."""
606 OPENBSD = "openbsd"
607 """OpenBSD."""
609 DRAGONFLYBSD = "dragonflybsd"
610 """DragonFly BSD."""
612 HPUX = "hpux"
613 """HP-UX (Hewlett Packard Unix)."""
615 AIX = "aix"
616 """AIX (Advanced Interactive eXecutive)."""
618 SOLARIS = "solaris"
619 """SunOS, Oracle Solaris."""
621 Z_OS = "z_os"
622 """IBM z/OS."""
625class TelemetrySdkLanguageValues(Enum):
626 CPP = "cpp"
627 """cpp."""
629 DOTNET = "dotnet"
630 """dotnet."""
632 ERLANG = "erlang"
633 """erlang."""
635 GO = "go"
636 """go."""
638 JAVA = "java"
639 """java."""
641 NODEJS = "nodejs"
642 """nodejs."""
644 PHP = "php"
645 """php."""
647 PYTHON = "python"
648 """python."""
650 RUBY = "ruby"
651 """ruby."""
653 WEBJS = "webjs"
654 """webjs."""
656 SWIFT = "swift"
657 """swift."""