Class K8sResource
- java.lang.Object
-
- io.opencensus.contrib.resource.util.K8sResource
-
public class K8sResource extends java.lang.Object
Helper class for Kubernetes deployment serviceResource
.- Since:
- 0.20
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
CLUSTER_NAME_KEY
Key for the name of the cluster.static java.lang.String
DEPLOYMENT_NAME_KEY
Key for the name of the deployment.static java.lang.String
NAMESPACE_NAME_KEY
Key for the name of the namespace.static java.lang.String
POD_NAME_KEY
Key for the name of the pod.private static com.google.common.base.Splitter
splitter
static java.lang.String
TYPE
The type of thisResource
.
-
Constructor Summary
Constructors Modifier Constructor Description private
K8sResource()
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static Resource
create(java.lang.String clusterName, java.lang.String namespace, java.lang.String podName)
Deprecated.in favor ofcreate(String, String, String, String)
.static Resource
create(java.lang.String clusterName, java.lang.String namespace, java.lang.String podName, java.lang.String deploymentName)
Returns aResource
that describes Kubernetes deployment service.(package private) static Resource
detect()
(package private) static java.lang.String
getDeploymentNameFromPodName(java.lang.String podName)
-
-
-
Field Detail
-
TYPE
public static final java.lang.String TYPE
The type of thisResource
.- Since:
- 0.20
- See Also:
- Constant Field Values
-
CLUSTER_NAME_KEY
public static final java.lang.String CLUSTER_NAME_KEY
Key for the name of the cluster.- Since:
- 0.20
- See Also:
- Constant Field Values
-
NAMESPACE_NAME_KEY
public static final java.lang.String NAMESPACE_NAME_KEY
Key for the name of the namespace.- Since:
- 0.20
- See Also:
- Constant Field Values
-
POD_NAME_KEY
public static final java.lang.String POD_NAME_KEY
Key for the name of the pod.- Since:
- 0.20
- See Also:
- Constant Field Values
-
DEPLOYMENT_NAME_KEY
public static final java.lang.String DEPLOYMENT_NAME_KEY
Key for the name of the deployment.- Since:
- 0.24
- See Also:
- Constant Field Values
-
splitter
private static final com.google.common.base.Splitter splitter
-
-
Method Detail
-
create
@Deprecated public static Resource create(java.lang.String clusterName, java.lang.String namespace, java.lang.String podName)
Deprecated.in favor ofcreate(String, String, String, String)
.Returns aResource
that describes Kubernetes deployment service.- Parameters:
clusterName
- the k8s cluster name.namespace
- the k8s namespace.podName
- the k8s pod name.- Returns:
- a
Resource
that describes a k8s container. - Since:
- 0.20
-
create
public static Resource create(java.lang.String clusterName, java.lang.String namespace, java.lang.String podName, java.lang.String deploymentName)
Returns aResource
that describes Kubernetes deployment service.- Parameters:
clusterName
- the k8s cluster name.namespace
- the k8s namespace.podName
- the k8s pod name.deploymentName
- the k8s deployment name.- Returns:
- a
Resource
that describes a k8s container. - Since:
- 0.24
-
detect
static Resource detect()
-
getDeploymentNameFromPodName
static java.lang.String getDeploymentNameFromPodName(java.lang.String podName)
-
-