Crate spring_opentelemetry Copy item path Source Expand description global Utilities for working with global telemetry primitives metrics Middleware that adds metrics to a Service
that handles HTTP requests.
refs: https://opentelemetry.io/docs/specs/semconv/http/http-metrics/ trace util KeyValue A key-value pair describing an attribute. OpenTelemetryPlugin Resource An immutable representation of the entity producing telemetry as attributes.
Utilizes Arc
for efficient sharing and cloning. ANDROID_OS_API_LEVEL Uniquely identifies the framework API revision offered by a version (os.version
) of the android operating system. More information can be found here . AWS_ECS_CLUSTER_ARN The ARN of an ECS cluster . AWS_ECS_CONTAINER_ARN The Amazon Resource Name (ARN) of an ECS container instance . AWS_ECS_LAUNCHTYPE The launch type for an ECS task. AWS_ECS_TASK_ARN The ARN of a running ECS task . AWS_ECS_TASK_FAMILY The family name of the ECS task definition used to create the ECS task. AWS_ECS_TASK_ID The ID of a running ECS task. The ID MUST be extracted from task.arn
. AWS_ECS_TASK_REVISION The revision for the task definition used to create the ECS task. AWS_EKS_CLUSTER_ARN The ARN of an EKS cluster. AWS_LOG_GROUP_ARNS The Amazon Resource Name(s) (ARN) of the AWS log group(s). AWS_LOG_GROUP_NAMES The name(s) of the AWS log group(s) an application is writing to. AWS_LOG_STREAM_ARNS The ARN(s) of the AWS log stream(s). AWS_LOG_STREAM_NAMES The name(s) of the AWS log stream(s) an application is writing to. BROWSER_BRANDS Array of brand name and version separated by a space BROWSER_LANGUAGE Preferred language of the user using the browser BROWSER_MOBILE A boolean that is true if the browser is running on a mobile device BROWSER_PLATFORM The platform on which the browser is running CLOUDFOUNDRY_APP_ID The guid of the application. CLOUDFOUNDRY_APP_NAME The name of the application. CLOUDFOUNDRY_ORG_ID The guid of the CloudFoundry org the application is running in. CLOUDFOUNDRY_ORG_NAME The name of the CloudFoundry organization the app is running in. CLOUDFOUNDRY_PROCESS_ID The UID identifying the process. CLOUDFOUNDRY_PROCESS_TYPE The type of process. CLOUDFOUNDRY_SPACE_ID The guid of the CloudFoundry space the application is running in. CLOUDFOUNDRY_SPACE_NAME The name of the CloudFoundry space the application is running in. CLOUDFOUNDRY_SYSTEM_ID A guid or another name describing the event source. CLOUDFOUNDRY_SYSTEM_INSTANCE_ID A guid describing the concrete instance of the event source. CLOUD_ACCOUNT_ID The cloud account ID the resource is assigned to. CLOUD_AVAILABILITY_ZONE Cloud regions often have multiple, isolated locations known as zones to increase availability. Availability zone represents the zone where the resource is running. CLOUD_PLATFORM The cloud platform in use. CLOUD_PROVIDER Name of the cloud provider. CLOUD_REGION The geographical region the resource is running. CLOUD_RESOURCE_ID 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_COMMAND The command used to run the container (i.e. the command name). CONTAINER_COMMAND_ARGS All the command arguments (including the command/executable itself) run by the container. CONTAINER_COMMAND_LINE The full command run by the container as a single string representing the full command. CONTAINER_ID Container ID. Usually a UUID, as for example used to identify Docker containers . The UUID might be abbreviated. CONTAINER_IMAGE_ID Runtime specific image identifier. Usually a hash algorithm followed by a UUID. CONTAINER_IMAGE_NAME Name of the image the container was built on. CONTAINER_IMAGE_REPO_DIGESTS Repo digests of the container image as provided by the container runtime. CONTAINER_IMAGE_TAGS 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_LABEL Container labels, <key>
being the label name, the value being the label value. CONTAINER_NAME Container name used by container runtime. CONTAINER_RUNTIME The container runtime managing this container. DEPLOYMENT_ENVIRONMENT_NAME Name of the deployment environment (aka deployment tier). DEVICE_ID A unique identifier representing the device DEVICE_MANUFACTURER The name of the device manufacturer DEVICE_MODEL_IDENTIFIER The model identifier for the device DEVICE_MODEL_NAME The marketing name for the device model FAAS_INSTANCE The execution environment ID as a string, that will be potentially reused for other invocations to the same function/function version. FAAS_MAX_MEMORY The amount of memory available to the serverless function converted to Bytes. FAAS_NAME The name of the single function that this runtime instance executes. FAAS_VERSION The immutable version of the function being executed. GCP_CLOUD_RUN_JOB_EXECUTION 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_INDEX The index for a task within an execution as provided by the CLOUD_RUN_TASK_INDEX
environment variable. GCP_GCE_INSTANCE_HOSTNAME The hostname of a GCE instance. This is the full value of the default or custom hostname . GCP_GCE_INSTANCE_NAME 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_ID Unique identifier for the application HEROKU_RELEASE_COMMIT Commit hash for the current release HEROKU_RELEASE_CREATION_TIMESTAMP Time and date the release was created HOST_ARCH The CPU architecture the host system is running on. HOST_CPU_CACHE_L2_SIZE The amount of level 2 memory cache available to the processor (in Bytes). HOST_CPU_FAMILY Family or generation of the CPU. HOST_CPU_MODEL_ID Model identifier. It provides more granular information about the CPU, distinguishing it from other CPUs within the same family. HOST_CPU_MODEL_NAME Model designation of the processor. HOST_CPU_STEPPING Stepping or core revisions. HOST_CPU_VENDOR_ID Processor manufacturer identifier. A maximum 12-character string. HOST_ID 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_ID VM image ID or host OS image ID. For Cloud, this value is from the provider. HOST_IMAGE_NAME Name of the VM image or OS install the host was instantiated from. HOST_IMAGE_VERSION The version string of the VM image or host OS as defined in Version Attributes . HOST_IP Available IP addresses of the host, excluding loopback interfaces. HOST_MAC Available MAC addresses of the host, excluding loopback interfaces. HOST_NAME 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_TYPE Type of host. For Cloud, this must be the machine type. K8S_CLUSTER_NAME The name of the cluster. K8S_CLUSTER_UID A pseudo-ID for the cluster, set to the UID of the kube-system
namespace. K8S_CONTAINER_NAME 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_COUNT 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_REASON Last terminated reason of the Container. K8S_CRONJOB_NAME The name of the CronJob. K8S_CRONJOB_UID The UID of the CronJob. K8S_DAEMONSET_NAME The name of the DaemonSet. K8S_DAEMONSET_UID The UID of the DaemonSet. K8S_DEPLOYMENT_NAME The name of the Deployment. K8S_DEPLOYMENT_UID The UID of the Deployment. K8S_HPA_NAME The name of the horizontal pod autoscaler. K8S_HPA_UID The UID of the horizontal pod autoscaler. K8S_JOB_NAME The name of the Job. K8S_JOB_UID The UID of the Job. K8S_NAMESPACE_NAME The name of the namespace that the pod is running in. K8S_NODE_NAME The name of the Node. K8S_NODE_UID The UID of the Node. K8S_POD_ANNOTATION The annotation key-value pairs placed on the Pod, the <key>
being the annotation name, the value being the annotation value. K8S_POD_LABEL The label key-value pairs placed on the Pod, the <key>
being the label name, the value being the label value. K8S_POD_NAME The name of the Pod. K8S_POD_UID The UID of the Pod. K8S_REPLICASET_NAME The name of the ReplicaSet. K8S_REPLICASET_UID The UID of the ReplicaSet. K8S_REPLICATIONCONTROLLER_NAME The name of the replication controller. K8S_REPLICATIONCONTROLLER_UID The UID of the replication controller. K8S_RESOURCEQUOTA_NAME The name of the resource quota. K8S_RESOURCEQUOTA_UID The UID of the resource quota. K8S_STATEFULSET_NAME The name of the StatefulSet. K8S_STATEFULSET_UID The UID of the StatefulSet. OCI_MANIFEST_DIGEST The digest of the OCI image manifest. For container images specifically is the digest by which the container image is known. OS_BUILD_ID Unique identifier for a particular build or compilation of the operating system. OS_DESCRIPTION Human readable (not intended to be parsed) OS version information, like e.g. reported by ver
or lsb_release -a
commands. OS_NAME Human readable operating system name. OS_TYPE The operating system type. OS_VERSION The version string of the operating system as defined in Version Attributes . OTEL_EXPORTER_OTLP_COMPRESSION Compression algorithm to use, defaults to none. OTEL_EXPORTER_OTLP_ENDPOINT Target to which the exporter is going to send signals, defaults to https://localhost:4317.
Learn about the relationship between this constant and metrics/spans/logs at
https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/protocol/exporter.md#endpoint-urls-for-otlphttp OTEL_EXPORTER_OTLP_HEADERS Key-value pairs to be used as headers associated with gRPC or HTTP requests
Example: k1=v1,k2=v2
Note: as of now, this is only supported for HTTP requests. OTEL_EXPORTER_OTLP_LOGS_COMPRESSION Compression algorithm to use, defaults to none. OTEL_EXPORTER_OTLP_LOGS_ENDPOINT Target to which the exporter is going to send logs OTEL_EXPORTER_OTLP_LOGS_HEADERS Key-value pairs to be used as headers associated with gRPC or HTTP requests
for sending logs.
Example: k1=v1,k2=v2
Note: this is only supported for HTTP. OTEL_EXPORTER_OTLP_LOGS_TIMEOUT Maximum time the OTLP exporter will wait for each batch logs export. OTEL_EXPORTER_OTLP_METRICS_COMPRESSION Compression algorithm to use, defaults to none. OTEL_EXPORTER_OTLP_METRICS_ENDPOINT Target to which the exporter is going to send metrics, defaults to https://localhost:4317/v1/metrics.
Learn about the relationship between this constant and default/spans/logs at
https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/protocol/exporter.md#endpoint-urls-for-otlphttp OTEL_EXPORTER_OTLP_METRICS_HEADERS Key-value pairs to be used as headers associated with gRPC or HTTP requests
for sending metrics.
Example: k1=v1,k2=v2
Note: this is only supported for HTTP. OTEL_EXPORTER_OTLP_METRICS_TIMEOUT Max waiting time for the backend to process each metrics batch, defaults to 10s. OTEL_EXPORTER_OTLP_TIMEOUT Max waiting time for the backend to process each signal batch, defaults to 10 seconds. OTEL_EXPORTER_OTLP_TRACES_COMPRESSION Compression algorithm to use, defaults to none. OTEL_EXPORTER_OTLP_TRACES_ENDPOINT Target to which the exporter is going to send spans, defaults to https://localhost:4317/v1/traces.
Learn about the relationship between this constant and default/metrics/logs at
https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/protocol/exporter.md#endpoint-urls-for-otlphttp OTEL_EXPORTER_OTLP_TRACES_HEADERS Key-value pairs to be used as headers associated with gRPC or HTTP requests
for sending spans.
Example: k1=v1,k2=v2
Note: this is only supported for HTTP. OTEL_EXPORTER_OTLP_TRACES_TIMEOUT Max waiting time for the backend to process each spans batch, defaults to 10s. 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_COMMAND 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_ARGS 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
. PROCESS_COMMAND_LINE 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. PROCESS_EXECUTABLE_NAME 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_PATH 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_CGROUP The control group associated with the process. PROCESS_OWNER The username of the user that owns the process. PROCESS_PARENT_PID Parent Process identifier (PPID). PROCESS_PID Process identifier (PID). PROCESS_RUNTIME_DESCRIPTION An additional description about the runtime of the process, for example a specific vendor customization of the runtime environment. PROCESS_RUNTIME_NAME The name of the runtime of this process. PROCESS_RUNTIME_VERSION The version of the runtime of this process, as returned by the runtime without modification. SERVICE_INSTANCE_ID The string ID of the service instance. SERVICE_NAME Logical name of the service. SERVICE_NAMESPACE 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_NAME The name of the auto instrumentation agent or distribution, if used. TELEMETRY_DISTRO_VERSION 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. WEBENGINE_DESCRIPTION Additional description of the web engine (e.g. detailed version and edition information). WEBENGINE_NAME The name of the web engine. WEBENGINE_VERSION The version of the web engine. ResourceConfigurator KeyValues Routers collection