Package com.amazonaws.xray.utils
Class DockerUtils
java.lang.Object
com.amazonaws.xray.utils.DockerUtils
Utility class to get metadata for dockerized containers
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription@Nullable String
Reads the docker-generated cgroup file that lists the full (untruncated) docker container ID at the end of each line.
-
Constructor Details
-
DockerUtils
public DockerUtils() -
DockerUtils
-
-
Method Details
-
getContainerId
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:
IOException
- if the file cannot be read
-