in src/ApplicationInsights.Kubernetes/TelemetryInitializers/KubernetesTelemetryInitializer.cs [34:55]
public KubernetesTelemetryInitializer(
IK8sEnvironmentFactory k8sEnvFactory,
IOptions<AppInsightsForKubernetesOptions> options,
SDKVersionUtils sdkVersionUtils,
ITelemetryKeyCache telemetryKeyCache)
{
_k8sEnvironment = null;
// Options can't be null.
Debug.Assert(options != null, "Options can't be null.");
_options = Arguments.IsNotNull(options?.Value, nameof(options));
_logger.LogDebug(@"Initialize Application Insights for Kubernetes telemetry initializer with Options:
{0}", JsonConvert.SerializeObject(_options));
_telemetryKeyCache = telemetryKeyCache ?? throw new ArgumentNullException(nameof(telemetryKeyCache));
_sdkVersionUtils = Arguments.IsNotNull(sdkVersionUtils, nameof(sdkVersionUtils));
_timeoutAt = DateTime.Now.Add(_options.InitializationTimeout);
_k8sEnvFactory = Arguments.IsNotNull(k8sEnvFactory, nameof(k8sEnvFactory));
_ = SetK8sEnvironment();
}