/
metrics.go
122 lines (112 loc) · 3.9 KB
/
metrics.go
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
package metrics
const (
TotalEnvelopesReceivedKey = "TotalEnvelopesReceived"
LastEnvelopReceivedTimestampKey = "LastEnvelopReceivedTimestamp"
TotalMetricsReceivedKey = "TotalMetricsReceived"
LastMetricReceivedTimestampKey = "LastMetricReceivedTimestamp"
TotalContainerMetricsReceivedKey = "TotalContainerMetricsReceived"
TotalContainerMetricsProcessedKey = "TotalContainerMetricsProcessed"
LastContainerMetricReceivedTimestampKey = "LastContainerMetricReceivedTimestamp"
TotalCounterEventsReceivedKey = "TotalCounterEventsReceived"
TotalCounterEventsProcessedKey = "TotalCounterEventsProcessed"
LastCounterEventReceivedTimestampKey = "LastCounterEventReceivedTimestamp"
TotalHttpStartStopReceivedKey = "TotalHttpStartStopReceived"
TotalHttpStartStopProcessedKey = "TotalHttpStartStopProcessed"
LastHttpStartStopReceivedTimestampKey = "LastHttpStartStopReceivedTimestamp"
TotalValueMetricsReceivedKey = "TotalValueMetricsReceived"
TotalValueMetricsProcessedKey = "TotalValueMetricsProcessed"
LastValueMetricReceivedTimestampKey = "LastValueMetricReceivedTimestamp"
SlowConsumerAlertKey = "SlowConsumerAlert"
LastSlowConsumerAlertTimestampKey = "LastSlowConsumerAlertTimestamp"
)
type InternalMetrics struct {
TotalEnvelopesReceived int64
LastEnvelopReceivedTimestamp int64
TotalMetricsReceived int64
LastMetricReceivedTimestamp int64
TotalContainerMetricsReceived int64
TotalContainerMetricsProcessed int64
TotalContainerMetricsCached int64
LastContainerMetricReceivedTimestamp int64
TotalCounterEventsReceived int64
TotalCounterEventsProcessed int64
TotalCounterEventsCached int64
LastCounterEventReceivedTimestamp int64
TotalHttpStartStopReceived int64
TotalHttpStartStopProcessed int64
TotalHttpStartStopCached int64
LastHttpStartStopReceivedTimestamp int64
TotalValueMetricsReceived int64
TotalValueMetricsProcessed int64
TotalValueMetricsCached int64
LastValueMetricReceivedTimestamp int64
SlowConsumerAlert bool
LastSlowConsumerAlertTimestamp int64
}
type ContainerMetrics []*ContainerMetric
type ContainerMetric struct {
Origin string
Timestamp int64
Deployment string
Job string
Index string
IP string
Tags map[string]string
ApplicationId string
InstanceIndex int32
CpuPercentage float64
MemoryBytes uint64
DiskBytes uint64
MemoryBytesQuota uint64
DiskBytesQuota uint64
}
type CounterEvents []*CounterEvent
type CounterEvent struct {
Origin string
Timestamp int64
Deployment string
Job string
Index string
IP string
Tags map[string]string
Name string
Delta uint64
Total uint64
}
type HttpStartStops []*HttpStartStop
type HttpStartStop struct {
Origin string
Timestamp int64
Deployment string
Job string
Index string
IP string
Tags map[string]string
RequestId string
Method string
Uri string
RemoteAddress string
UserAgent string
StatusCode int32
ContentLength int64
ApplicationId string
InstanceIndex int32
InstanceId string
ClientStartTimestamp int64
ClientStopTimestamp int64
ServerStartTimestamp int64
ServerStopTimestamp int64
}
type ValueMetrics []*ValueMetric
type ValueMetric struct {
Origin string
Timestamp int64
Deployment string
Job string
Index string
IP string
Tags map[string]string
Name string
Value float64
Unit string
}