Skip to content
This repository was archived by the owner on Jul 31, 2023. It is now read-only.

Commit fff365e

Browse files
committed
add constant keys for resources.
1 parent 54a91f5 commit fff365e

File tree

1 file changed

+66
-0
lines changed

1 file changed

+66
-0
lines changed

resource/resourcekeys/const.go

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
// Copyright 2019, OpenCensus Authors
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
// Package resourcekeys contains well known type and label keys for resources.
16+
package resourcekeys // import "go.opencensus.io/resource/resourcekeys"
17+
18+
// Constants for Kubernetes resources.
19+
const (
20+
K8SType = "k8s"
21+
22+
// A uniquely identifying name for the Kubernetes cluster. Kubernetes
23+
// does not have cluster names as an internal concept so this may be
24+
// set to any meaningful value within the environment. For example,
25+
// GKE clusters have a name which can be used for this label.
26+
K8SKeyClusterName = "k8s.cluster.name"
27+
K8SKeyNamespaceName = "k8s.namespace.name"
28+
K8SKeyPodName = "k8s.pod.name"
29+
)
30+
31+
// Constants for Container resources.
32+
const (
33+
ContainerType = "container"
34+
35+
// A uniquely identifying name for the Container.
36+
ContainerKeyName = "container.name"
37+
ContainerKeyImageName = "container.image.name"
38+
ContainerKeyImageTag = "container.image.tag"
39+
)
40+
41+
// Constants for Cloud resources.
42+
const (
43+
CloudType = "cloud"
44+
45+
// A uniquely identifying name for the Container.
46+
CloudKeyProvider = "cloud.provider"
47+
CloudKeyAccountID = "cloud.account.id"
48+
CloudKeyRegion = "cloud.region"
49+
CloudKeyZone = "cloud.zone"
50+
CloudProviderAWS = "aws"
51+
CloudProviderGCP = "gcp"
52+
CloudProviderAZURE = "azure"
53+
)
54+
55+
// Constants for Host resources.
56+
const (
57+
HostType = "host"
58+
59+
// A uniquely identifying name for the host.
60+
HostKeyName = "host.name"
61+
62+
// A hostname as returned by the 'hostname' command on host machine.
63+
HostKeyHostName = "host.hostname"
64+
HostKeyID = "host.id"
65+
HostKeyType = "host.type"
66+
)

0 commit comments

Comments
 (0)