-
Notifications
You must be signed in to change notification settings - Fork 1
/
MetricsConfig.cs
76 lines (69 loc) · 2.33 KB
/
MetricsConfig.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
using System.Collections.Generic;
namespace Cognite.Extractor.Metrics
{
/// <summary>
/// Metrics configuration object
/// </summary>
public class MetricsConfig
{
/// <summary>
/// Start a metrics server in the extractor for Prometheus scrape (optional)
/// </summary>
/// <value>A <see cref="MetricsServerConfig"/> config object</value>
public MetricsServerConfig? Server { get; set; }
#pragma warning disable CA2227 // Collection properties should be read only
/// <summary>
/// A list of Prometheus push gateway destinations (optional)
/// </summary>
/// <value>A list <see cref="PushGatewayConfig"/> of config objects</value>
public IList<PushGatewayConfig>? PushGateways { get; set; }
#pragma warning restore CA2227 // Collection properties should be read only
}
/// <summary>
/// Metrics server configuration
/// </summary>
public class MetricsServerConfig
{
/// <summary>
/// Host name
/// </summary>
/// <value>Host name for the server. Example: localhost (without scheme and port)</value>
public string? Host { get; set; }
/// <summary>
/// Port
/// </summary>
/// <value>Server port</value>
public int Port { get; set; }
}
/// <summary>
/// Push gateway configuration
/// </summary>
public class PushGatewayConfig
{
/// <summary>
/// Gateway host
/// </summary>
/// <value>Absolute Uri for the host. Example: http://localhost:9091</value>
public string? Host { get; set; }
/// <summary>
/// Job name
/// </summary>
/// <value>Name of the job</value>
public string? Job { get; set; }
/// <summary>
/// Username for basic authentication (optional)
/// </summary>
/// <value>Username</value>
public string? Username { get; set; }
/// <summary>
/// Password for basic authentication (optional)
/// </summary>
/// <value>Password</value>
public string? Password { get; set; }
/// <summary>
/// Interval in seconds for pushing data to the gateway.
/// </summary>
/// <value></value>
public int PushInterval { get; internal set; } = 1;
}
}