lib/opentelemetry/resource/detector/container.rb in opentelemetry-resource-detector-container-0.1.0 vs lib/opentelemetry/resource/detector/container.rb in opentelemetry-resource-detector-container-0.1.1
- old
+ new
@@ -35,10 +35,10 @@
# Returns the container.id if it can be determined from cgroup
# or nil if container.id could not be determined
#
# @return [String] container.id
# May be nil.
- def container_id # rubocop:disable Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity
+ def container_id
[CGROUP_V2_PATH, CGROUP_V1_PATH].each do |cgroup|
unless File.readable?(cgroup)
OpenTelemetry.handle_error(message: "Container resource detector - #{cgroup} could not be read.")
next
end