Module resource

Module resource 

Available on crate feature opentelemetry only.
Expand description

§Resource Semantic Conventions

The resource semantic conventions define a set of standardized attributes to be used in Resources.

§Usage

use opentelemetry::KeyValue;
use opentelemetry_sdk::{trace::SdkTracerProvider, Resource};
use opentelemetry_semantic_conventions as semconv;

let _tracer = SdkTracerProvider::builder()
    .with_resource(Resource::builder_empty().with_service_name("my-service").build())
    .build();

Constants§

ANDROID_OS_API_LEVELsemconv_experimental
Uniquely identifies the framework API revision offered by a version (os.version) of the android operating system. More information can be found here.
APP_INSTALLATION_IDsemconv_experimental
A unique identifier representing the installation of an application on a specific device
AWS_ECS_CLUSTER_ARNsemconv_experimental
The ARN of an ECS cluster.
AWS_ECS_CONTAINER_ARNsemconv_experimental
The Amazon Resource Name (ARN) of an ECS container instance.
AWS_ECS_LAUNCHTYPEsemconv_experimental
The launch type for an ECS task.
AWS_ECS_TASK_ARNsemconv_experimental
The ARN of a running ECS task.
AWS_ECS_TASK_FAMILYsemconv_experimental
The family name of the ECS task definition used to create the ECS task.
AWS_ECS_TASK_IDsemconv_experimental
The ID of a running ECS task. The ID MUST be extracted from task.arn.
AWS_ECS_TASK_REVISIONsemconv_experimental
The revision for the task definition used to create the ECS task.
AWS_EKS_CLUSTER_ARNsemconv_experimental
The ARN of an EKS cluster.
AWS_LOG_GROUP_ARNSsemconv_experimental
The Amazon Resource Name(s) (ARN) of the AWS log group(s).
AWS_LOG_GROUP_NAMESsemconv_experimental
The name(s) of the AWS log group(s) an application is writing to.
AWS_LOG_STREAM_ARNSsemconv_experimental
The ARN(s) of the AWS log stream(s).
AWS_LOG_STREAM_NAMESsemconv_experimental
The name(s) of the AWS log stream(s) an application is writing to.
BROWSER_BRANDSsemconv_experimental
Array of brand name and version separated by a space
BROWSER_LANGUAGEsemconv_experimental
Preferred language of the user using the browser
BROWSER_MOBILEsemconv_experimental
A boolean that is true if the browser is running on a mobile device
BROWSER_PLATFORMsemconv_experimental
The platform on which the browser is running
CICD_PIPELINE_NAMEsemconv_experimental
The human readable name of the pipeline within a CI/CD system.
CICD_PIPELINE_RUN_IDsemconv_experimental
The unique identifier of a pipeline run within a CI/CD system.
CICD_PIPELINE_RUN_URL_FULLsemconv_experimental
The URL of the pipeline run, providing the complete address in order to locate and identify the pipeline run.
CICD_WORKER_IDsemconv_experimental
The unique identifier of a worker within a CICD system.
CICD_WORKER_NAMEsemconv_experimental
The name of a worker within a CICD system.
CICD_WORKER_URL_FULLsemconv_experimental
The URL of the worker, providing the complete address in order to locate and identify the worker.
CLOUDFOUNDRY_APP_IDsemconv_experimental
The guid of the application.
CLOUDFOUNDRY_APP_NAMEsemconv_experimental
The name of the application.
CLOUDFOUNDRY_ORG_IDsemconv_experimental
The guid of the CloudFoundry org the application is running in.
CLOUDFOUNDRY_ORG_NAMEsemconv_experimental
The name of the CloudFoundry organization the app is running in.
CLOUDFOUNDRY_PROCESS_IDsemconv_experimental
The UID identifying the process.
CLOUDFOUNDRY_PROCESS_TYPEsemconv_experimental
The type of process.
CLOUDFOUNDRY_SPACE_IDsemconv_experimental
The guid of the CloudFoundry space the application is running in.
CLOUDFOUNDRY_SPACE_NAMEsemconv_experimental
The name of the CloudFoundry space the application is running in.
CLOUDFOUNDRY_SYSTEM_IDsemconv_experimental
A guid or another name describing the event source.
CLOUDFOUNDRY_SYSTEM_INSTANCE_IDsemconv_experimental
A guid describing the concrete instance of the event source.
CLOUD_ACCOUNT_IDsemconv_experimental
The cloud account ID the resource is assigned to.
CLOUD_AVAILABILITY_ZONEsemconv_experimental
Cloud regions often have multiple, isolated locations known as zones to increase availability. Availability zone represents the zone where the resource is running.
CLOUD_PLATFORMsemconv_experimental
The cloud platform in use.
CLOUD_PROVIDERsemconv_experimental
Name of the cloud provider.
CLOUD_REGIONsemconv_experimental
The geographical region within a cloud provider. When associated with a resource, this attribute specifies the region where the resource operates. When calling services or APIs deployed on a cloud, this attribute identifies the region where the called destination is deployed.
CLOUD_RESOURCE_IDsemconv_experimental
Cloud provider-specific native identifier of the monitored cloud resource (e.g. an ARN on AWS, a fully qualified resource ID on Azure, a full resource name on GCP)
CONTAINER_COMMANDsemconv_experimental
The command used to run the container (i.e. the command name).
CONTAINER_COMMAND_ARGSsemconv_experimental
All the command arguments (including the command/executable itself) run by the container.
CONTAINER_COMMAND_LINEsemconv_experimental
The full command run by the container as a single string representing the full command.
CONTAINER_IDsemconv_experimental
Container ID. Usually a UUID, as for example used to identify Docker containers. The UUID might be abbreviated.
CONTAINER_IMAGE_IDsemconv_experimental
Runtime specific image identifier. Usually a hash algorithm followed by a UUID.
CONTAINER_IMAGE_NAMEsemconv_experimental
Name of the image the container was built on.
CONTAINER_IMAGE_REPO_DIGESTSsemconv_experimental
Repo digests of the container image as provided by the container runtime.
CONTAINER_IMAGE_TAGSsemconv_experimental
Container image tags. An example can be found in Docker Image Inspect. Should be only the <tag> section of the full name for example from registry.example.com/my-org/my-image:<tag>.
CONTAINER_LABELsemconv_experimental
Container labels, key being the label name, the value being the label value.
CONTAINER_NAMEsemconv_experimental
Container name used by container runtime.
CONTAINER_RUNTIMEsemconv_experimental
The container runtime managing this container.
DEPLOYMENT_ENVIRONMENT_NAMEsemconv_experimental
Name of the deployment environment (aka deployment tier).
DEVICE_IDsemconv_experimental
A unique identifier representing the device
DEVICE_MANUFACTURERsemconv_experimental
The name of the device manufacturer
DEVICE_MODEL_IDENTIFIERsemconv_experimental
The model identifier for the device
DEVICE_MODEL_NAMEsemconv_experimental
The marketing name for the device model
FAAS_INSTANCEsemconv_experimental
The execution environment ID as a string, that will be potentially reused for other invocations to the same function/function version.
FAAS_MAX_MEMORYsemconv_experimental
The amount of memory available to the serverless function converted to Bytes.
FAAS_NAMEsemconv_experimental
The name of the single function that this runtime instance executes.
FAAS_VERSIONsemconv_experimental
The immutable version of the function being executed.
GCP_APPHUB_APPLICATION_CONTAINERsemconv_experimental
The container within GCP where the AppHub application is defined.
GCP_APPHUB_APPLICATION_IDsemconv_experimental
The name of the application as configured in AppHub.
GCP_APPHUB_APPLICATION_LOCATIONsemconv_experimental
The GCP zone or region where the application is defined.
GCP_APPHUB_SERVICE_CRITICALITY_TYPEsemconv_experimental
Criticality of a service indicates its importance to the business.
GCP_APPHUB_SERVICE_ENVIRONMENT_TYPEsemconv_experimental
Environment of a service is the stage of a software lifecycle.
GCP_APPHUB_SERVICE_IDsemconv_experimental
The name of the service as configured in AppHub.
GCP_APPHUB_WORKLOAD_CRITICALITY_TYPEsemconv_experimental
Criticality of a workload indicates its importance to the business.
GCP_APPHUB_WORKLOAD_ENVIRONMENT_TYPEsemconv_experimental
Environment of a workload is the stage of a software lifecycle.
GCP_APPHUB_WORKLOAD_IDsemconv_experimental
The name of the workload as configured in AppHub.
GCP_CLOUD_RUN_JOB_EXECUTIONsemconv_experimental
The name of the Cloud Run execution being run for the Job, as set by the CLOUD_RUN_EXECUTION environment variable.
GCP_CLOUD_RUN_JOB_TASK_INDEXsemconv_experimental
The index for a task within an execution as provided by the CLOUD_RUN_TASK_INDEX environment variable.
GCP_GCE_INSTANCE_HOSTNAMEsemconv_experimental
The hostname of a GCE instance. This is the full value of the default or custom hostname.
GCP_GCE_INSTANCE_NAMEsemconv_experimental
The instance name of a GCE instance. This is the value provided by host.name, the visible name of the instance in the Cloud Console UI, and the prefix for the default hostname of the instance as defined by the default internal DNS name.
HEROKU_APP_IDsemconv_experimental
Unique identifier for the application
HEROKU_RELEASE_COMMITsemconv_experimental
Commit hash for the current release
HEROKU_RELEASE_CREATION_TIMESTAMPsemconv_experimental
Time and date the release was created
HOST_ARCHsemconv_experimental
The CPU architecture the host system is running on.
HOST_CPU_CACHE_L2_SIZEsemconv_experimental
The amount of level 2 memory cache available to the processor (in Bytes).
HOST_CPU_FAMILYsemconv_experimental
Family or generation of the CPU.
HOST_CPU_MODEL_IDsemconv_experimental
Model identifier. It provides more granular information about the CPU, distinguishing it from other CPUs within the same family.
HOST_CPU_MODEL_NAMEsemconv_experimental
Model designation of the processor.
HOST_CPU_STEPPINGsemconv_experimental
Stepping or core revisions.
HOST_CPU_VENDOR_IDsemconv_experimental
Processor manufacturer identifier. A maximum 12-character string.
HOST_IDsemconv_experimental
Unique host ID. For Cloud, this must be the instance_id assigned by the cloud provider. For non-containerized systems, this should be the machine-id. See the table below for the sources to use to determine the machine-id based on operating system.
HOST_IMAGE_IDsemconv_experimental
VM image ID or host OS image ID. For Cloud, this value is from the provider.
HOST_IMAGE_NAMEsemconv_experimental
Name of the VM image or OS install the host was instantiated from.
HOST_IMAGE_VERSIONsemconv_experimental
The version string of the VM image or host OS as defined in Version Attributes.
HOST_IPsemconv_experimental
Available IP addresses of the host, excluding loopback interfaces.
HOST_MACsemconv_experimental
Available MAC addresses of the host, excluding loopback interfaces.
HOST_NAMEsemconv_experimental
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.
HOST_TYPEsemconv_experimental
Type of host. For Cloud, this must be the machine type.
K8S_CLUSTER_NAMEsemconv_experimental
The name of the cluster.
K8S_CLUSTER_UIDsemconv_experimental
A pseudo-ID for the cluster, set to the UID of the kube-system namespace.
K8S_CONTAINER_NAMEsemconv_experimental
The name of the Container from Pod specification, must be unique within a Pod. Container runtime usually uses different globally unique name (container.name).
K8S_CONTAINER_RESTART_COUNTsemconv_experimental
Number of times the container was restarted. This attribute can be used to identify a particular container (running or stopped) within a container spec.
K8S_CONTAINER_STATUS_LAST_TERMINATED_REASONsemconv_experimental
Last terminated reason of the Container.
K8S_CRONJOB_ANNOTATIONsemconv_experimental
The cronjob annotation placed on the CronJob, the key being the annotation name, the value being the annotation value.
K8S_CRONJOB_LABELsemconv_experimental
The label placed on the CronJob, the key being the label name, the value being the label value.
K8S_CRONJOB_NAMEsemconv_experimental
The name of the CronJob.
K8S_CRONJOB_UIDsemconv_experimental
The UID of the CronJob.
K8S_DAEMONSET_ANNOTATIONsemconv_experimental
The annotation placed on the DaemonSet, the key being the annotation name, the value being the annotation value, even if the value is empty.
K8S_DAEMONSET_LABELsemconv_experimental
The label placed on the DaemonSet, the key being the label name, the value being the label value, even if the value is empty.
K8S_DAEMONSET_NAMEsemconv_experimental
The name of the DaemonSet.
K8S_DAEMONSET_UIDsemconv_experimental
The UID of the DaemonSet.
K8S_DEPLOYMENT_ANNOTATIONsemconv_experimental
The annotation placed on the Deployment, the key being the annotation name, the value being the annotation value, even if the value is empty.
K8S_DEPLOYMENT_LABELsemconv_experimental
The label placed on the Deployment, the key being the label name, the value being the label value, even if the value is empty.
K8S_DEPLOYMENT_NAMEsemconv_experimental
The name of the Deployment.
K8S_DEPLOYMENT_UIDsemconv_experimental
The UID of the Deployment.
K8S_HPA_NAMEsemconv_experimental
The name of the horizontal pod autoscaler.
K8S_HPA_SCALETARGETREF_API_VERSIONsemconv_experimental
The API version of the target resource to scale for the HorizontalPodAutoscaler.
K8S_HPA_SCALETARGETREF_KINDsemconv_experimental
The kind of the target resource to scale for the HorizontalPodAutoscaler.
K8S_HPA_SCALETARGETREF_NAMEsemconv_experimental
The name of the target resource to scale for the HorizontalPodAutoscaler.
K8S_HPA_UIDsemconv_experimental
The UID of the horizontal pod autoscaler.
K8S_JOB_ANNOTATIONsemconv_experimental
The annotation placed on the Job, the key being the annotation name, the value being the annotation value, even if the value is empty.
K8S_JOB_LABELsemconv_experimental
The label placed on the Job, the key being the label name, the value being the label value, even if the value is empty.
K8S_JOB_NAMEsemconv_experimental
The name of the Job.
K8S_JOB_UIDsemconv_experimental
The UID of the Job.
K8S_NAMESPACE_ANNOTATIONsemconv_experimental
The annotation placed on the Namespace, the key being the annotation name, the value being the annotation value, even if the value is empty.
K8S_NAMESPACE_LABELsemconv_experimental
The label placed on the Namespace, the key being the label name, the value being the label value, even if the value is empty.
K8S_NAMESPACE_NAMEsemconv_experimental
The name of the namespace that the pod is running in.
K8S_NODE_ANNOTATIONsemconv_experimental
The annotation placed on the Node, the key being the annotation name, the value being the annotation value, even if the value is empty.
K8S_NODE_LABELsemconv_experimental
The label placed on the Node, the key being the label name, the value being the label value, even if the value is empty.
K8S_NODE_NAMEsemconv_experimental
The name of the Node.
K8S_NODE_UIDsemconv_experimental
The UID of the Node.
K8S_POD_ANNOTATIONsemconv_experimental
The annotation placed on the Pod, the key being the annotation name, the value being the annotation value.
K8S_POD_LABELsemconv_experimental
The label placed on the Pod, the key being the label name, the value being the label value.
K8S_POD_NAMEsemconv_experimental
The name of the Pod.
K8S_POD_UIDsemconv_experimental
The UID of the Pod.
K8S_REPLICASET_ANNOTATIONsemconv_experimental
The annotation placed on the ReplicaSet, the key being the annotation name, the value being the annotation value, even if the value is empty.
K8S_REPLICASET_LABELsemconv_experimental
The label placed on the ReplicaSet, the key being the label name, the value being the label value, even if the value is empty.
K8S_REPLICASET_NAMEsemconv_experimental
The name of the ReplicaSet.
K8S_REPLICASET_UIDsemconv_experimental
The UID of the ReplicaSet.
K8S_REPLICATIONCONTROLLER_NAMEsemconv_experimental
The name of the replication controller.
K8S_REPLICATIONCONTROLLER_UIDsemconv_experimental
The UID of the replication controller.
K8S_RESOURCEQUOTA_NAMEsemconv_experimental
The name of the resource quota.
K8S_RESOURCEQUOTA_UIDsemconv_experimental
The UID of the resource quota.
K8S_STATEFULSET_ANNOTATIONsemconv_experimental
The annotation placed on the StatefulSet, the key being the annotation name, the value being the annotation value, even if the value is empty.
K8S_STATEFULSET_LABELsemconv_experimental
The label placed on the StatefulSet, the key being the label name, the value being the label value, even if the value is empty.
K8S_STATEFULSET_NAMEsemconv_experimental
The name of the StatefulSet.
K8S_STATEFULSET_UIDsemconv_experimental
The UID of the StatefulSet.
MAINFRAME_LPAR_NAMEsemconv_experimental
Name of the logical partition that hosts a systems with a mainframe operating system.
OCI_MANIFEST_DIGESTsemconv_experimental
The digest of the OCI image manifest. For container images specifically is the digest by which the container image is known.
OS_BUILD_IDsemconv_experimental
Unique identifier for a particular build or compilation of the operating system.
OS_DESCRIPTIONsemconv_experimental
Human readable (not intended to be parsed) OS version information, like e.g. reported by ver or lsb_release -a commands.
OS_NAMEsemconv_experimental
Human readable operating system name.
OS_TYPEsemconv_experimental
The operating system type.
OS_VERSIONsemconv_experimental
The version string of the operating system as defined in Version Attributes.
OTEL_SCOPE_NAME
The name of the instrumentation scope - (InstrumentationScope.Name in OTLP).
OTEL_SCOPE_VERSION
The version of the instrumentation scope - (InstrumentationScope.Version in OTLP).
PROCESS_COMMANDsemconv_experimental
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.
PROCESS_COMMAND_ARGSsemconv_experimental
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. SHOULD NOT be collected by default unless there is sanitization that excludes sensitive data.
PROCESS_COMMAND_LINEsemconv_experimental
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. SHOULD NOT be collected by default unless there is sanitization that excludes sensitive data.
PROCESS_EXECUTABLE_NAMEsemconv_experimental
The name of the process executable. On Linux based systems, this SHOULD be set to the base name of the target of /proc/[pid]/exe. On Windows, this SHOULD be set to the base name of GetProcessImageFileNameW.
PROCESS_EXECUTABLE_PATHsemconv_experimental
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.
PROCESS_LINUX_CGROUPsemconv_experimental
The control group associated with the process.
PROCESS_OWNERsemconv_experimental
The username of the user that owns the process.
PROCESS_PARENT_PIDsemconv_experimental
Parent Process identifier (PPID).
PROCESS_PIDsemconv_experimental
Process identifier (PID).
PROCESS_RUNTIME_DESCRIPTIONsemconv_experimental
An additional description about the runtime of the process, for example a specific vendor customization of the runtime environment.
PROCESS_RUNTIME_NAMEsemconv_experimental
The name of the runtime of this process.
PROCESS_RUNTIME_VERSIONsemconv_experimental
The version of the runtime of this process, as returned by the runtime without modification.
SERVICE_INSTANCE_IDsemconv_experimental
The string ID of the service instance.
SERVICE_NAME
Logical name of the service.
SERVICE_NAMESPACEsemconv_experimental
A namespace for service.name.
SERVICE_VERSION
The version string of the service API or implementation. The format is not defined by these conventions.
TELEMETRY_DISTRO_NAMEsemconv_experimental
The name of the auto instrumentation agent or distribution, if used.
TELEMETRY_DISTRO_VERSIONsemconv_experimental
The version string of the auto instrumentation agent or distribution, if used.
TELEMETRY_SDK_LANGUAGE
The language of the telemetry SDK.
TELEMETRY_SDK_NAME
The name of the telemetry SDK as defined above.
TELEMETRY_SDK_VERSION
The version string of the telemetry SDK.
USER_AGENT_ORIGINAL
Value of the HTTP User-Agent header sent by the client.
VCS_REF_HEAD_NAMEsemconv_experimental
The name of the reference such as branch or tag in the repository.
VCS_REF_HEAD_REVISIONsemconv_experimental
The revision, literally revised version, The revision most often refers to a commit object in Git, or a revision number in SVN.
VCS_REF_TYPEsemconv_experimental
The type of the reference in the repository.
VCS_REPOSITORY_NAMEsemconv_experimental
The human readable name of the repository. It SHOULD NOT include any additional identifier like Group/SubGroup in GitLab or organization in GitHub.
VCS_REPOSITORY_URL_FULLsemconv_experimental
The canonical URL of the repository providing the complete HTTP(S) address in order to locate and identify the repository through a browser.
WEBENGINE_DESCRIPTIONsemconv_experimental
Additional description of the web engine (e.g. detailed version and edition information).
WEBENGINE_NAMEsemconv_experimental
The name of the web engine.
WEBENGINE_VERSIONsemconv_experimental
The version of the web engine.
ZOS_SMF_IDsemconv_experimental
The System Management Facility (SMF) Identifier uniquely identified a z/OS system within a SYSPLEX or mainframe environment and is used for system and performance analysis.
ZOS_SYSPLEX_NAMEsemconv_experimental
The name of the SYSPLEX to which the z/OS system belongs too.