Class K8sResource
java.lang.Object
io.opencensus.contrib.resource.util.K8sResource
Helper class for Kubernetes deployment service
Resource
.- Since:
- 0.20
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
Key for the name of the cluster.static final String
Key for the name of the deployment.static final String
Key for the name of the namespace.static final String
Key for the name of the pod.private static final com.google.common.base.Splitter
static final String
The type of thisResource
. -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
TYPE
The type of thisResource
.- Since:
- 0.20
- See Also:
-
CLUSTER_NAME_KEY
Key for the name of the cluster.- Since:
- 0.20
- See Also:
-
NAMESPACE_NAME_KEY
Key for the name of the namespace.- Since:
- 0.20
- See Also:
-
POD_NAME_KEY
Key for the name of the pod.- Since:
- 0.20
- See Also:
-
DEPLOYMENT_NAME_KEY
Key for the name of the deployment.- Since:
- 0.24
- See Also:
-
splitter
private static final com.google.common.base.Splitter splitter
-
-
Constructor Details
-
K8sResource
private K8sResource()
-
-
Method Details
-
create
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(String clusterName, String namespace, String podName, 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
-
getDeploymentNameFromPodName
-
create(String, String, String, String)
.