-
Notifications
You must be signed in to change notification settings - Fork 0
/
resource.go
257 lines (206 loc) · 9.52 KB
/
resource.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
// Copyright The OpenTelemetry Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package semconv // import "go.opentelemetry.io/otel/semconv"
import "go.opentelemetry.io/otel/attribute"
// Semantic conventions for service resource attribute keys.
const (
// Name of the service.
ServiceNameKey = attribute.Key("service.name")
// A namespace for `service.name`. This needs to have 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.
ServiceNamespaceKey = attribute.Key("service.namespace")
// A unique identifier of the service instance. In conjunction with the
// `service.name` and `service.namespace` this must be unique.
ServiceInstanceIDKey = attribute.Key("service.instance.id")
// The version of the service API.
ServiceVersionKey = attribute.Key("service.version")
)
// Semantic conventions for telemetry SDK resource attribute keys.
const (
// The name of the telemetry SDK.
//
// The default OpenTelemetry SDK provided by the OpenTelemetry project
// MUST set telemetry.sdk.name to the value `opentelemetry`.
//
// If another SDK is used, this attribute MUST be set to the import path
// of that SDK's package.
//
// The value `opentelemetry` is reserved and MUST NOT be used by
// non-OpenTelemetry SDKs.
TelemetrySDKNameKey = attribute.Key("telemetry.sdk.name")
// The language of the telemetry SDK.
TelemetrySDKLanguageKey = attribute.Key("telemetry.sdk.language")
// The version string of the telemetry SDK.
TelemetrySDKVersionKey = attribute.Key("telemetry.sdk.version")
)
// Semantic conventions for telemetry SDK resource attributes.
var (
TelemetrySDKLanguageGo = TelemetrySDKLanguageKey.String("go")
)
// Semantic conventions for container resource attribute keys.
const (
// A uniquely identifying name for the Container.
ContainerNameKey = attribute.Key("container.name")
// Container ID, usually a UUID, as for example used to
// identify Docker containers. The UUID might be abbreviated.
ContainerIDKey = attribute.Key("container.id")
// Name of the image the container was built on.
ContainerImageNameKey = attribute.Key("container.image.name")
// Container image tag.
ContainerImageTagKey = attribute.Key("container.image.tag")
)
// Semantic conventions for Function-as-a-Service resource attribute keys.
const (
// A uniquely identifying name for the FaaS.
FaaSNameKey = attribute.Key("faas.name")
// The unique name of the function being executed.
FaaSIDKey = attribute.Key("faas.id")
// The version of the function being executed.
FaaSVersionKey = attribute.Key("faas.version")
// The execution environment identifier.
FaaSInstanceKey = attribute.Key("faas.instance")
)
// Semantic conventions for operating system process resource attribute keys.
const (
// Process identifier (PID).
ProcessPIDKey = attribute.Key("process.pid")
// 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`.
ProcessExecutableNameKey = attribute.Key("process.executable.name")
// 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`.
ProcessExecutablePathKey = attribute.Key("process.executable.path")
// 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`.
ProcessCommandKey = attribute.Key("process.command")
// The full command used to launch the process. The value can be either
// a list of strings representing the ordered list of arguments, or a
// single string representing the full command. On Linux based systems,
// can be set to the list of null-delimited strings extracted from
// `proc/[pid]/cmdline`. On Windows, can be set to the result of
// `GetCommandLineW`.
ProcessCommandLineKey = attribute.Key("process.command_line")
// 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`.
ProcessCommandArgsKey = attribute.Key("process.command_args")
// The username of the user that owns the process.
ProcessOwnerKey = attribute.Key("process.owner")
// The name of the runtime of this process. For compiled native
// binaries, this SHOULD be the name of the compiler.
ProcessRuntimeNameKey = attribute.Key("process.runtime.name")
// The version of the runtime of this process, as returned by the
// runtime without modification.
ProcessRuntimeVersionKey = attribute.Key("process.runtime.version")
// An additional description about the runtime of the process, for
// example a specific vendor customization of the runtime environment.
ProcessRuntimeDescriptionKey = attribute.Key("process.runtime.description")
)
// Semantic conventions for Kubernetes resource attribute keys.
const (
// A uniquely identifying name for the Kubernetes cluster. Kubernetes
// does not have cluster names as an internal concept so this may be
// set to any meaningful value within the environment. For example,
// GKE clusters have a name which can be used for this attribute.
K8SClusterNameKey = attribute.Key("k8s.cluster.name")
// The name of the Node.
K8SNodeNameKey = attribute.Key("k8s.node.name")
// The UID of the Node.
K8SNodeUIDKey = attribute.Key("k8s.node.uid")
// The name of the namespace that the pod is running in.
K8SNamespaceNameKey = attribute.Key("k8s.namespace.name")
// The uid of the Pod.
K8SPodUIDKey = attribute.Key("k8s.pod.uid")
// The name of the pod.
K8SPodNameKey = attribute.Key("k8s.pod.name")
// The name of the Container in a Pod template.
K8SContainerNameKey = attribute.Key("k8s.container.name")
// The uid of the ReplicaSet.
K8SReplicaSetUIDKey = attribute.Key("k8s.replicaset.uid")
// The name of the ReplicaSet.
K8SReplicaSetNameKey = attribute.Key("k8s.replicaset.name")
// The uid of the Deployment.
K8SDeploymentUIDKey = attribute.Key("k8s.deployment.uid")
// The name of the deployment.
K8SDeploymentNameKey = attribute.Key("k8s.deployment.name")
// The uid of the StatefulSet.
K8SStatefulSetUIDKey = attribute.Key("k8s.statefulset.uid")
// The name of the StatefulSet.
K8SStatefulSetNameKey = attribute.Key("k8s.statefulset.name")
// The uid of the DaemonSet.
K8SDaemonSetUIDKey = attribute.Key("k8s.daemonset.uid")
// The name of the DaemonSet.
K8SDaemonSetNameKey = attribute.Key("k8s.daemonset.name")
// The uid of the Job.
K8SJobUIDKey = attribute.Key("k8s.job.uid")
// The name of the Job.
K8SJobNameKey = attribute.Key("k8s.job.name")
// The uid of the CronJob.
K8SCronJobUIDKey = attribute.Key("k8s.cronjob.uid")
// The name of the CronJob.
K8SCronJobNameKey = attribute.Key("k8s.cronjob.name")
)
// Semantic conventions for OS resource attribute keys.
const (
// The operating system type.
OSTypeKey = attribute.Key("os.type")
// Human readable (not intended to be parsed) OS version information.
OSDescriptionKey = attribute.Key("os.description")
)
// Semantic conventions for host resource attribute keys.
const (
// A uniquely identifying name for the host: 'hostname', FQDN, or user specified name
HostNameKey = attribute.Key("host.name")
// Unique host ID. For cloud environments this will be the instance ID.
HostIDKey = attribute.Key("host.id")
// Type of host. For cloud environments this will be the machine type.
HostTypeKey = attribute.Key("host.type")
// Name of the OS or VM image the host is running.
HostImageNameKey = attribute.Key("host.image.name")
// Identifier of the image the host is running.
HostImageIDKey = attribute.Key("host.image.id")
// Version of the image the host is running.
HostImageVersionKey = attribute.Key("host.image.version")
)
// Semantic conventions for cloud environment resource attribute keys.
const (
// Name of the cloud provider.
CloudProviderKey = attribute.Key("cloud.provider")
// The account ID from the cloud provider used for authorization.
CloudAccountIDKey = attribute.Key("cloud.account.id")
// Geographical region where this resource is.
CloudRegionKey = attribute.Key("cloud.region")
// Zone of the region where this resource is.
CloudZoneKey = attribute.Key("cloud.zone")
)
// Semantic conventions for common cloud provider resource attributes.
var (
CloudProviderAWS = CloudProviderKey.String("aws")
CloudProviderAzure = CloudProviderKey.String("azure")
CloudProviderGCP = CloudProviderKey.String("gcp")
)
// Semantic conventions for deployment attributes.
const (
// Name of the deployment environment (aka deployment tier); e.g. (staging, production).
DeploymentEnvironmentKey = attribute.Key("deployment.environment")
)