mirror of https://github.com/Sonarr/Sonarr
Detect Docker when using control group v2
This commit is contained in:
parent
366b2b8b52
commit
77a4ba4925
|
@ -77,7 +77,9 @@ namespace NzbDrone.Common.EnvironmentInfo
|
||||||
FullName = Name;
|
FullName = Name;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (IsLinux && File.Exists("/proc/1/cgroup") && File.ReadAllText("/proc/1/cgroup").Contains("/docker/"))
|
if (IsLinux &&
|
||||||
|
((File.Exists("/proc/1/cgroup") && File.ReadAllText("/proc/1/cgroup").Contains("/docker/")) ||
|
||||||
|
(File.Exists("/proc/1/mountinfo") && File.ReadAllText("/proc/1/mountinfo").Contains("/docker/"))))
|
||||||
{
|
{
|
||||||
IsDocker = true;
|
IsDocker = true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -145,6 +145,7 @@ namespace NzbDrone.Common.Instrumentation.Sentry
|
||||||
{
|
{
|
||||||
SentrySdk.ConfigureScope(scope =>
|
SentrySdk.ConfigureScope(scope =>
|
||||||
{
|
{
|
||||||
|
scope.SetTag("is_docker", $"{osInfo.IsDocker}");
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue