Skip to content

Commit 270a993

Browse files
committed
move constants to versioned module namespace
1 parent 1f6417e commit 270a993

File tree

5 files changed

+795
-765
lines changed

5 files changed

+795
-765
lines changed

semantic_conventions/lib/opentelemetry/semantic_conventions.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,7 @@ module SemanticConventions
1010
end
1111
end
1212

13+
require_relative 'semantic_conventions/1.10.0/trace'
1314
require_relative 'semantic_conventions/trace'
15+
require_relative 'semantic_conventions/1.10.0/resource'
1416
require_relative 'semantic_conventions/resource'
Lines changed: 301 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,301 @@
1+
# frozen_string_literal: true
2+
3+
# Copyright The OpenTelemetry Authors
4+
#
5+
# SPDX-License-Identifier: Apache-2.0
6+
7+
module OpenTelemetry
8+
module SemanticConventions_1_10_0 # rubocop:disable Naming/ClassAndModuleCamelCase
9+
# https://github.com/open-telemetry/opentelemetry-specification/tree/v1.10.0/specification
10+
module Resource
11+
# Name of the cloud provider
12+
CLOUD_PROVIDER = 'cloud.provider'
13+
14+
# The cloud account ID the resource is assigned to
15+
CLOUD_ACCOUNT_ID = 'cloud.account.id'
16+
17+
# The geographical region the resource is running
18+
# @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)
19+
CLOUD_REGION = 'cloud.region'
20+
21+
# Cloud regions often have multiple, isolated locations known as zones to increase availability. Availability zone represents the zone where the resource is running
22+
# @note Availability zones are called "zones" on Alibaba Cloud and Google Cloud
23+
CLOUD_AVAILABILITY_ZONE = 'cloud.availability_zone'
24+
25+
# The cloud platform in use
26+
# @note The prefix of the service SHOULD match the one specified in `cloud.provider`
27+
CLOUD_PLATFORM = 'cloud.platform'
28+
29+
# The Amazon Resource Name (ARN) of an [ECS container instance](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ECS_instances.html)
30+
AWS_ECS_CONTAINER_ARN = 'aws.ecs.container.arn'
31+
32+
# The ARN of an [ECS cluster](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/clusters.html)
33+
AWS_ECS_CLUSTER_ARN = 'aws.ecs.cluster.arn'
34+
35+
# The [launch type](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/launch_types.html) for an ECS task
36+
AWS_ECS_LAUNCHTYPE = 'aws.ecs.launchtype'
37+
38+
# The ARN of an [ECS task definition](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definitions.html)
39+
AWS_ECS_TASK_ARN = 'aws.ecs.task.arn'
40+
41+
# The task definition family this task definition is a member of
42+
AWS_ECS_TASK_FAMILY = 'aws.ecs.task.family'
43+
44+
# The revision for this task definition
45+
AWS_ECS_TASK_REVISION = 'aws.ecs.task.revision'
46+
47+
# The ARN of an EKS cluster
48+
AWS_EKS_CLUSTER_ARN = 'aws.eks.cluster.arn'
49+
50+
# The name(s) of the AWS log group(s) an application is writing to
51+
# @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
52+
AWS_LOG_GROUP_NAMES = 'aws.log.group.names'
53+
54+
# The Amazon Resource Name(s) (ARN) of the AWS log group(s)
55+
# @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)
56+
AWS_LOG_GROUP_ARNS = 'aws.log.group.arns'
57+
58+
# The name(s) of the AWS log stream(s) an application is writing to
59+
AWS_LOG_STREAM_NAMES = 'aws.log.stream.names'
60+
61+
# The ARN(s) of the AWS log stream(s)
62+
# @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
63+
AWS_LOG_STREAM_ARNS = 'aws.log.stream.arns'
64+
65+
# Container name used by container runtime
66+
CONTAINER_NAME = 'container.name'
67+
68+
# 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
69+
CONTAINER_ID = 'container.id'
70+
71+
# The container runtime managing this container
72+
CONTAINER_RUNTIME = 'container.runtime'
73+
74+
# Name of the image the container was built on
75+
CONTAINER_IMAGE_NAME = 'container.image.name'
76+
77+
# Container image tag
78+
CONTAINER_IMAGE_TAG = 'container.image.tag'
79+
80+
# Name of the [deployment environment](https://en.wikipedia.org/wiki/Deployment_environment) (aka deployment tier)
81+
DEPLOYMENT_ENVIRONMENT = 'deployment.environment'
82+
83+
# A unique identifier representing the device
84+
# @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
85+
DEVICE_ID = 'device.id'
86+
87+
# The model identifier for the device
88+
# @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
89+
DEVICE_MODEL_IDENTIFIER = 'device.model.identifier'
90+
91+
# The marketing name for the device model
92+
# @note It's recommended this value represents a human readable version of the device model rather than a machine readable alternative
93+
DEVICE_MODEL_NAME = 'device.model.name'
94+
95+
# The name of the device manufacturer
96+
# @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`
97+
DEVICE_MANUFACTURER = 'device.manufacturer'
98+
99+
# The name of the single function that this runtime instance executes
100+
# @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)
101+
FAAS_NAME = 'faas.name'
102+
103+
# The unique ID of the single function that this runtime instance executes
104+
# @note Depending on the cloud provider, use:
105+
#
106+
# * **AWS Lambda:** The function [ARN](https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html).
107+
# Take care not to use the "invoked ARN" directly but replace any
108+
# [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
109+
# different aliases.
110+
# * **GCP:** The [URI of the resource](https://cloud.google.com/iam/docs/full-resource-names)
111+
# * **Azure:** The [Fully Qualified Resource ID](https://docs.microsoft.com/en-us/rest/api/resources/resources/get-by-id).
112+
#
113+
# On some providers, it may not be possible to determine the full ID at startup,
114+
# which is why this field cannot be made required. For example, on AWS the account ID
115+
# part of the ARN is not available without calling another AWS API
116+
# which may be deemed too slow for a short-running lambda function.
117+
# As an alternative, consider setting `faas.id` as a span attribute instead
118+
FAAS_ID = 'faas.id'
119+
120+
# The immutable version of the function being executed
121+
# @note Depending on the cloud provider and platform, use:
122+
#
123+
# * **AWS Lambda:** The [function version](https://docs.aws.amazon.com/lambda/latest/dg/configuration-versions.html)
124+
# (an integer represented as a decimal string).
125+
# * **Google Cloud Run:** The [revision](https://cloud.google.com/run/docs/managing/revisions)
126+
# (i.e., the function name plus the revision suffix).
127+
# * **Google Cloud Functions:** The value of the
128+
# [`K_REVISION` environment variable](https://cloud.google.com/functions/docs/env-var#runtime_environment_variables_set_automatically).
129+
# * **Azure Functions:** Not applicable. Do not set this attribute
130+
FAAS_VERSION = 'faas.version'
131+
132+
# The execution environment ID as a string, that will be potentially reused for other invocations to the same function/function version
133+
# @note * **AWS Lambda:** Use the (full) log stream name
134+
FAAS_INSTANCE = 'faas.instance'
135+
136+
# The amount of memory available to the serverless function in MiB
137+
# @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
138+
FAAS_MAX_MEMORY = 'faas.max_memory'
139+
140+
# Unique host ID. For Cloud, this must be the instance_id assigned by the cloud provider
141+
HOST_ID = 'host.id'
142+
143+
# 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
144+
HOST_NAME = 'host.name'
145+
146+
# Type of host. For Cloud, this must be the machine type
147+
HOST_TYPE = 'host.type'
148+
149+
# The CPU architecture the host system is running on
150+
HOST_ARCH = 'host.arch'
151+
152+
# Name of the VM image or OS install the host was instantiated from
153+
HOST_IMAGE_NAME = 'host.image.name'
154+
155+
# VM image ID. For Cloud, this value is from the provider
156+
HOST_IMAGE_ID = 'host.image.id'
157+
158+
# The version string of the VM image as defined in [Version Attributes](README.md#version-attributes)
159+
HOST_IMAGE_VERSION = 'host.image.version'
160+
161+
# The name of the cluster
162+
K8S_CLUSTER_NAME = 'k8s.cluster.name'
163+
164+
# The name of the Node
165+
K8S_NODE_NAME = 'k8s.node.name'
166+
167+
# The UID of the Node
168+
K8S_NODE_UID = 'k8s.node.uid'
169+
170+
# The name of the namespace that the pod is running in
171+
K8S_NAMESPACE_NAME = 'k8s.namespace.name'
172+
173+
# The UID of the Pod
174+
K8S_POD_UID = 'k8s.pod.uid'
175+
176+
# The name of the Pod
177+
K8S_POD_NAME = 'k8s.pod.name'
178+
179+
# The name of the Container from Pod specification, must be unique within a Pod. Container runtime usually uses different globally unique name (`container.name`)
180+
K8S_CONTAINER_NAME = 'k8s.container.name'
181+
182+
# Number of times the container was restarted. This attribute can be used to identify a particular container (running or stopped) within a container spec
183+
K8S_CONTAINER_RESTART_COUNT = 'k8s.container.restart_count'
184+
185+
# The UID of the ReplicaSet
186+
K8S_REPLICASET_UID = 'k8s.replicaset.uid'
187+
188+
# The name of the ReplicaSet
189+
K8S_REPLICASET_NAME = 'k8s.replicaset.name'
190+
191+
# The UID of the Deployment
192+
K8S_DEPLOYMENT_UID = 'k8s.deployment.uid'
193+
194+
# The name of the Deployment
195+
K8S_DEPLOYMENT_NAME = 'k8s.deployment.name'
196+
197+
# The UID of the StatefulSet
198+
K8S_STATEFULSET_UID = 'k8s.statefulset.uid'
199+
200+
# The name of the StatefulSet
201+
K8S_STATEFULSET_NAME = 'k8s.statefulset.name'
202+
203+
# The UID of the DaemonSet
204+
K8S_DAEMONSET_UID = 'k8s.daemonset.uid'
205+
206+
# The name of the DaemonSet
207+
K8S_DAEMONSET_NAME = 'k8s.daemonset.name'
208+
209+
# The UID of the Job
210+
K8S_JOB_UID = 'k8s.job.uid'
211+
212+
# The name of the Job
213+
K8S_JOB_NAME = 'k8s.job.name'
214+
215+
# The UID of the CronJob
216+
K8S_CRONJOB_UID = 'k8s.cronjob.uid'
217+
218+
# The name of the CronJob
219+
K8S_CRONJOB_NAME = 'k8s.cronjob.name'
220+
221+
# The operating system type
222+
OS_TYPE = 'os.type'
223+
224+
# Human readable (not intended to be parsed) OS version information, like e.g. reported by `ver` or `lsb_release -a` commands
225+
OS_DESCRIPTION = 'os.description'
226+
227+
# Human readable operating system name
228+
OS_NAME = 'os.name'
229+
230+
# The version string of the operating system as defined in [Version Attributes](../../resource/semantic_conventions/README.md#version-attributes)
231+
OS_VERSION = 'os.version'
232+
233+
# Process identifier (PID)
234+
PROCESS_PID = 'process.pid'
235+
236+
# 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`
237+
PROCESS_EXECUTABLE_NAME = 'process.executable.name'
238+
239+
# 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`
240+
PROCESS_EXECUTABLE_PATH = 'process.executable.path'
241+
242+
# 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`
243+
PROCESS_COMMAND = 'process.command'
244+
245+
# 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
246+
PROCESS_COMMAND_LINE = 'process.command_line'
247+
248+
# 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`
249+
PROCESS_COMMAND_ARGS = 'process.command_args'
250+
251+
# The username of the user that owns the process
252+
PROCESS_OWNER = 'process.owner'
253+
254+
# The name of the runtime of this process. For compiled native binaries, this SHOULD be the name of the compiler
255+
PROCESS_RUNTIME_NAME = 'process.runtime.name'
256+
257+
# The version of the runtime of this process, as returned by the runtime without modification
258+
PROCESS_RUNTIME_VERSION = 'process.runtime.version'
259+
260+
# An additional description about the runtime of the process, for example a specific vendor customization of the runtime environment
261+
PROCESS_RUNTIME_DESCRIPTION = 'process.runtime.description'
262+
263+
# Logical name of the service
264+
# @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`
265+
SERVICE_NAME = 'service.name'
266+
267+
# A namespace for `service.name`
268+
# @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
269+
SERVICE_NAMESPACE = 'service.namespace'
270+
271+
# The string ID of the service instance
272+
# @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)
273+
SERVICE_INSTANCE_ID = 'service.instance.id'
274+
275+
# The version string of the service API or implementation
276+
SERVICE_VERSION = 'service.version'
277+
278+
# The name of the telemetry SDK as defined above
279+
TELEMETRY_SDK_NAME = 'telemetry.sdk.name'
280+
281+
# The language of the telemetry SDK
282+
TELEMETRY_SDK_LANGUAGE = 'telemetry.sdk.language'
283+
284+
# The version string of the telemetry SDK
285+
TELEMETRY_SDK_VERSION = 'telemetry.sdk.version'
286+
287+
# The version string of the auto instrumentation agent, if used
288+
TELEMETRY_AUTO_VERSION = 'telemetry.auto.version'
289+
290+
# The name of the web engine
291+
WEBENGINE_NAME = 'webengine.name'
292+
293+
# The version of the web engine
294+
WEBENGINE_VERSION = 'webengine.version'
295+
296+
# Additional description of the web engine (e.g. detailed version and edition information)
297+
WEBENGINE_DESCRIPTION = 'webengine.description'
298+
299+
end
300+
end
301+
end

0 commit comments

Comments
 (0)