-
Notifications
You must be signed in to change notification settings - Fork 57
/
AppInsightsForKubernetesOptions.cs
48 lines (42 loc) · 2.03 KB
/
AppInsightsForKubernetesOptions.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
using System;
using Microsoft.ApplicationInsights.Kubernetes;
namespace Microsoft.Extensions.DependencyInjection
{
/// <summary>
/// Object model of configuration for Application Insights for Kubernetes.
/// </summary>
public class AppInsightsForKubernetesOptions
{
/// <summary>
/// Configuration section name.
/// </summary>
public const string SectionName = "AppInsightsForKubernetes";
/// <summary>
/// Maximum time to wait for spinning up the container.
/// </summary>
public TimeSpan InitializationTimeout { get; set; } = TimeSpan.FromMinutes(2);
/// <summary>
/// Gets or sets the processor for telemetry key. This is introduced to allow customization of
/// telemetry keys.
/// </summary>
public Func<string, string>? TelemetryKeyProcessor { get; set; }
/// <summary>
/// Gets or sets the time-span for exponent interval base. This will be used as the interval between querying the Kubernetes cluster for properties.
/// For example, in y = power(2, x), 2 is the base, and the interval will then be 2 seconds, 4 seconds, 8 seconds, 16 seconds ... until it reached the
/// <see cref="ClusterInfoRefreshInterval" />.
/// The base is default to 2 seconds.
/// </summary>
public TimeSpan ExponentIntervalBase { get; set; } = TimeSpan.FromSeconds(2);
/// <summary>
/// Get or sets how frequent to refresh the cluster info.
/// For example: 00:10:00 for 10 minutes.
/// The default value is 10 minutes.
/// </summary>
public TimeSpan ClusterInfoRefreshInterval { get; set; } = TimeSpan.FromMinutes(10);
/// <summary>
/// Gets or sets an environment check action to determine if the the current process is inside a Kubernetes cluster.
/// When set to null (also the default), a built-in checker will be used.
/// </summary>
public IClusterEnvironmentCheck? ClusterCheckAction { get; set; } = null;
}
}