Package com.amazonaws.xray.utils
Class DockerUtils
- java.lang.Object
-
- com.amazonaws.xray.utils.DockerUtils
-
public class DockerUtils extends java.lang.Object
Utility class to get metadata for dockerized containers
-
-
Constructor Summary
Constructors Constructor Description DockerUtils()
DockerUtils(java.net.URL cgroupLocation)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description @Nullable java.lang.String
getContainerId()
Reads the docker-generated cgroup file that lists the full (untruncated) docker container ID at the end of each line.
-
-
-
Method Detail
-
getContainerId
public @Nullable java.lang.String getContainerId() throws java.io.IOException
Reads the docker-generated cgroup file that lists the full (untruncated) docker container ID at the end of each line. This method takes advantage of that fact by just reading the 64-character ID from the end of the first line.- Returns:
- the untruncated Docker container ID, or null if it can't be read
- Throws:
java.io.IOException
- if the file cannot be read
-
-