|
| 1 | +/* |
| 2 | + * Copyright The OpenTelemetry Authors |
| 3 | + * |
| 4 | + * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | + * you may not use this file except in compliance with the License. |
| 6 | + * You may obtain a copy of the License at |
| 7 | + * |
| 8 | + * https://www.apache.org/licenses/LICENSE-2.0 |
| 9 | + * |
| 10 | + * Unless required by applicable law or agreed to in writing, software |
| 11 | + * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | + * See the License for the specific language governing permissions and |
| 14 | + * limitations under the License. |
| 15 | + */ |
| 16 | + |
| 17 | +/** |
| 18 | + * The CPU architecture the host system is running on. |
| 19 | + * |
| 20 | + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. |
| 21 | + */ |
| 22 | +export const ATTR_HOST_ARCH = 'host.arch' as const; |
| 23 | +/** |
| 24 | + * 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. |
| 25 | + * |
| 26 | + * @example fdbf79e8af94cb7f9e8df36789187052 |
| 27 | + * |
| 28 | + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. |
| 29 | + */ |
| 30 | +export const ATTR_HOST_ID = 'host.id' as const; |
| 31 | +/** |
| 32 | + * 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. |
| 33 | + * |
| 34 | + * @example opentelemetry-test |
| 35 | + * |
| 36 | + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. |
| 37 | + */ |
| 38 | +export const ATTR_HOST_NAME = 'host.name' as const; |
| 39 | +/** |
| 40 | + * The operating system type. |
| 41 | + * |
| 42 | + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. |
| 43 | + */ |
| 44 | +export const ATTR_OS_TYPE = 'os.type' as const; |
| 45 | +/** |
| 46 | + * The version string of the operating system as defined in [Version Attributes](/docs/resource/README.md#version-attributes). |
| 47 | + * |
| 48 | + * @example 14.2.1 |
| 49 | + * @example 18.04.1 |
| 50 | + * |
| 51 | + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. |
| 52 | + */ |
| 53 | +export const ATTR_OS_VERSION = 'os.version' as const; |
| 54 | +/** |
| 55 | + * 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`. |
| 56 | + * |
| 57 | + * @example cmd/otelcol |
| 58 | + * |
| 59 | + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. |
| 60 | + */ |
| 61 | +export const ATTR_PROCESS_COMMAND = 'process.command' as const; |
| 62 | +/** |
| 63 | + * 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`. |
| 64 | + * |
| 65 | + * @example ["cmd/otecol", "--config=config.yaml"] |
| 66 | + * |
| 67 | + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. |
| 68 | + */ |
| 69 | +export const ATTR_PROCESS_COMMAND_ARGS = 'process.command_args' as const; |
| 70 | +/** |
| 71 | + * 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`. |
| 72 | + * |
| 73 | + * @example otelcol |
| 74 | + * |
| 75 | + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. |
| 76 | + */ |
| 77 | +export const ATTR_PROCESS_EXECUTABLE_NAME = 'process.executable.name' as const; |
| 78 | +/** |
| 79 | + * 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`. |
| 80 | + * |
| 81 | + * @example /usr/bin/cmd/otelcol |
| 82 | + * |
| 83 | + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. |
| 84 | + */ |
| 85 | +export const ATTR_PROCESS_EXECUTABLE_PATH = 'process.executable.path' as const; |
| 86 | +/** |
| 87 | + * The username of the user that owns the process. |
| 88 | + * |
| 89 | + * @example root |
| 90 | + * |
| 91 | + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. |
| 92 | + */ |
| 93 | +export const ATTR_PROCESS_OWNER = 'process.owner' as const; |
| 94 | +/** |
| 95 | + * Process identifier (PID). |
| 96 | + * |
| 97 | + * @example 1234 |
| 98 | + * |
| 99 | + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. |
| 100 | + */ |
| 101 | +export const ATTR_PROCESS_PID = 'process.pid' as const; |
| 102 | +/** |
| 103 | + * An additional description about the runtime of the process, for example a specific vendor customization of the runtime environment. |
| 104 | + * |
| 105 | + * @example "Eclipse OpenJ9 Eclipse OpenJ9 VM openj9-0.21.0" |
| 106 | + * |
| 107 | + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. |
| 108 | + */ |
| 109 | +export const ATTR_PROCESS_RUNTIME_DESCRIPTION = |
| 110 | + 'process.runtime.description' as const; |
| 111 | +/** |
| 112 | + * The name of the runtime of this process. |
| 113 | + * |
| 114 | + * @example OpenJDK Runtime Environment |
| 115 | + * |
| 116 | + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. |
| 117 | + */ |
| 118 | +export const ATTR_PROCESS_RUNTIME_NAME = 'process.runtime.name' as const; |
| 119 | +/** |
| 120 | + * The version of the runtime of this process, as returned by the runtime without modification. |
| 121 | + * |
| 122 | + * @example "14.0.2" |
| 123 | + * |
| 124 | + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. |
| 125 | + */ |
| 126 | +export const ATTR_PROCESS_RUNTIME_VERSION = 'process.runtime.version' as const; |
| 127 | +/** |
| 128 | + * The string ID of the service instance. |
| 129 | + * |
| 130 | + * @example 627cc493-f310-47de-96bd-71410b7dec09 |
| 131 | + * |
| 132 | + * @note **MUST** be unique for each instance of the same `service.namespace,service.name` pair (in other words |
| 133 | + * `service.namespace,service.name,service.instance.id` triplet **MUST** be globally unique). The ID helps to |
| 134 | + * distinguish instances of the same service that exist at the same time (e.g. instances of a horizontally scaled |
| 135 | + * service). |
| 136 | + * |
| 137 | + * Implementations, such as SDKs, are recommended to generate a random Version 1 or Version 4 [RFC |
| 138 | + * 4122](https://www.ietf.org/rfc/rfc4122.txt) UUID, but are free to use an inherent unique ID as the source of |
| 139 | + * this value if stability is desirable. In that case, the ID **SHOULD** be used as source of a UUID Version 5 and |
| 140 | + * **SHOULD** use the following UUID as the namespace: `4d63009a-8d0f-11ee-aad7-4c796ed8e320`. |
| 141 | + * |
| 142 | + * UUIDs are typically recommended, as only an opaque value for the purposes of identifying a service instance is |
| 143 | + * needed. Similar to what can be seen in the man page for the |
| 144 | + * [`/etc/machine-id`](https://www.freedesktop.org/software/systemd/man/latest/machine-id.html) file, the underlying |
| 145 | + * data, such as pod name and namespace should be treated as confidential, being the user's choice to expose it |
| 146 | + * or not via another resource attribute. |
| 147 | + * |
| 148 | + * For applications running behind an application server (like unicorn), we do not recommend using one identifier |
| 149 | + * for all processes participating in the application. Instead, it's recommended each division (e.g. a worker |
| 150 | + * thread in unicorn) to have its own instance.id. |
| 151 | + * |
| 152 | + * It's not recommended for a Collector to set `service.instance.id` if it can't unambiguously determine the |
| 153 | + * service instance that is generating that telemetry. For instance, creating an UUID based on `pod.name` will |
| 154 | + * likely be wrong, as the Collector might not know from which container within that pod the telemetry originated. |
| 155 | + * However, Collectors can set the `service.instance.id` if they can unambiguously determine the service instance |
| 156 | + * for that telemetry. This is typically the case for scraping receivers, as they know the target address and |
| 157 | + * port. |
| 158 | + * |
| 159 | + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. |
| 160 | + */ |
| 161 | +export const ATTR_SERVICE_INSTANCE_ID = 'service.instance.id' as const; |
0 commit comments