diff --git a/src/Elastic.Apm/Api/Service.cs b/src/Elastic.Apm/Api/Service.cs index 058640b7a..4a827d2bd 100644 --- a/src/Elastic.Apm/Api/Service.cs +++ b/src/Elastic.Apm/Api/Service.cs @@ -96,7 +96,9 @@ static bool CheckForLoadedAssembly(string name) // Legacy mechanism: if the profiler is loaded add a `p` suffix to Agent.Version service.Agent.Version += "-p"; // Check if profiler was injected via K8S hook. - if (new EnvironmentVariables(logger).SafeCheckValue("ELASTIC_APM_ACTIVATION_METHOD", "K8S")) + var envvars =new EnvironmentVariables(logger); + if (envvars.SafeCheckValue("ELASTIC_APM_ACTIVATION_METHOD", "K8S") + || envvars.SafeCheckValue("ELASTIC_APM_ACTIVATION_METHOD", "K8S_ATTACH")) activationMethod = Consts.ActivationK8SAttach; else activationMethod = Consts.ActivationMethodProfiler;