Expand description
Detect whether the current process runs in Kubernetes, a container, a VM, or on bare metal.
Enums§
- EnvScope
- Detected environment scope.
Functions§
- detect_
scope - Perform detection in this order: 0) Kubernetes
- is_
kubernetes - Returns true if we’re in a Kubernetes Pod (via env‐var or serviceaccount token).
- parse_
container - Try to identify container via files or cgroup.
- parse_
vm_ cpuinfo - Detect “hypervisor” flag in
/proc/cpuinfo. - parse_
vm_ dmi_ field - Try to identify VM via DMI (
/sys/class/dmi/id/{product_name,sys_vendor}).