• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright 2018, OpenCensus 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  *     http://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  * API for resource information population.
19  *
20  * <p>The resource library primarily defines a type "Resource" that captures information about the
21  * entity for which stats or traces are recorded. For example, metrics exposed by a Kubernetes
22  * container can be linked to a resource that specifies the cluster, namespace, pod, and container
23  * name.
24  *
25  * <p>Two environment variables are used to populate resource information:
26  *
27  * <ul>
28  *   <li>OC_RESOURCE_TYPE: A string that describes the type of the resource prefixed by a domain
29  *       namespace. Leading and trailing whitespaces are trimmed. e.g. “kubernetes.io/container”.
30  *   <li>OC_RESOURCE_LABELS: A comma-separated list of labels describing the source in more detail,
31  *       e.g. “key1=val1,key2=val2”. The allowed character set is appropriately constrained.
32  * </ul>
33  *
34  * <p>Type, label keys, and label values MUST contain only printable ASCII (codes between 32 and
35  * 126, inclusive) and less than 256 characters. Type and label keys MUST have a length greater than
36  * zero. They SHOULD start with a domain name and separate hierarchies with / characters, e.g.
37  * k8s.io/namespace/name.
38  *
39  * <p>WARNING: Currently all the public classes under this package are marked as {@link
40  * io.opencensus.common.ExperimentalApi}. DO NOT USE except for experimental purposes.
41  *
42  * <p>Please see
43  * https://github.com/census-instrumentation/opencensus-specs/blob/master/resource/Resource.md for
44  * more details.
45  */
46 @io.opencensus.common.ExperimentalApi
47 package io.opencensus.resource;
48