-
Notifications
You must be signed in to change notification settings - Fork 62
/
Copy pathStatsdConfig.cs
143 lines (118 loc) · 5.17 KB
/
StatsdConfig.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
namespace StatsdClient
{
/// <summary>
/// The configuration options for DogStatsdService.
/// </summary>
public class StatsdConfig
{
/// <summary>
/// The default port for UDP.
/// </summary>
public const int DefaultStatsdPort = 8125;
/// <summary>
/// The default UDP maximum packet size.
/// </summary>
public const int DefaultStatsdMaxUDPPacketSize = 1432;
/// <summary>
/// The name of the environment variable defining the global tags to be applied to every metric, event, and service check.
/// </summary>
public const string EntityIdEnvVar = "DD_ENTITY_ID";
/// <summary>
/// The name of the environment variable defining the port of the targeted StatsD server.
/// </summary>
public const string DogStatsdPortEnvVar = "DD_DOGSTATSD_PORT";
/// <summary>
/// The name of the environment variable defining the host name of the targeted StatsD server.
/// </summary>
public const string AgentHostEnvVar = "DD_AGENT_HOST";
/// <summary>
/// The name of the environment variable defining the name of the pipe. INTERNAL USAGE ONLY.
/// </summary>
public const string AgentPipeNameEnvVar = "DD_DOGSTATSD_PIPE_NAME";
/// <summary>
/// The name of the environment variable defining the service name
/// </summary>
public const string ServiceEnvVar = "DD_SERVICE";
/// <summary>
/// The name of the environment variable defining the environment name
/// </summary>
public const string EnvironmentEnvVar = "DD_ENV";
/// <summary>
/// The name of the environment variable defining the version of the service
/// </summary>
public const string VersionEnvVar = "DD_VERSION";
internal const string ServiceTagKey = "service";
internal const string EnvironmentTagKey = "env";
internal const string VersionTagKey = "version";
/// <summary>
/// Initializes a new instance of the <see cref="StatsdConfig"/> class.
/// </summary>
public StatsdConfig()
{
StatsdPort = 0;
StatsdMaxUDPPacketSize = DefaultStatsdMaxUDPPacketSize;
Advanced = new AdvancedStatsConfig();
}
/// <summary>
/// Gets or sets the host name of the targeted StatsD server.
/// </summary>
/// <value>The host name of the targeted StatsD server.</value>
public string StatsdServerName { get; set; }
/// <summary>
/// Gets or sets the name of the pipe. INTERNAL USAGE ONLY.
/// </summary>
public string PipeName { get; set; }
/// <summary>
/// Gets or sets the port of the targeted StatsD server.
/// </summary>
/// <value>The port of the targeted StatsD server.</value>
public int StatsdPort { get; set; }
/// <summary>
/// Gets or sets the maximum UDP packet size.
/// </summary>
/// <value>The maximum UDP packet size.</value>
public int StatsdMaxUDPPacketSize { get; set; }
/// <summary>
/// Gets or sets the maximum Unix domain socket packet size.
/// </summary>
/// <value>The maximum Unix domain socket packet size.</value>
public int StatsdMaxUnixDomainSocketPacketSize { get; set; } = 8192;
/// <summary>
/// Gets or sets a value indicating whether we truncate the metric if it is too long.
/// </summary>
/// <value>The value indicating whether we truncate the metric if it is too long.</value>
public bool StatsdTruncateIfTooLong { get; set; } = true;
/// <summary>
/// Gets or sets the prefix to apply to every metric, event, and service check.
/// </summary>
/// <value>The prefix to apply to every metric, event, and service check.</value>
public string Prefix { get; set; }
/// <summary>
/// Gets the advanced configuration.
/// </summary>
/// <value>The advanced configuration</value>
public AdvancedStatsConfig Advanced { get; }
/// <summary>
/// Gets or sets the environment tag
/// </summary>
public string Environment { get; set; }
/// <summary>
/// Gets or sets the service version tag
/// </summary>
public string ServiceVersion { get; set; }
/// <summary>
/// Gets or sets the service name tag
/// </summary>
public string ServiceName { get; set; }
/// <summary>
/// Gets or sets the global tags to be applied to every metric, event, and service check.
/// </summary>
/// <value>The global tags to be applied to every metric, event, and service check.</value>
public string[] ConstantTags { get; set; }
/// <summary>
/// Gets or sets a value defining the client side aggregation config.
/// If the value is null, the client side aggregation is not enabled.
/// </summary>
public ClientSideAggregationConfig ClientSideAggregation { get; set; } = new ClientSideAggregationConfig();
}
}