-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdescriptors.go
221 lines (218 loc) · 6.29 KB
/
descriptors.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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
package typesense_prometheus_exporter
import "github.com/prometheus/client_golang/prometheus"
func getMetricsDesc() map[string]*prometheus.Desc {
return map[string]*prometheus.Desc{
"system_cpu1_active_percentage": prometheus.NewDesc(
"typesense_metrics_system_cpu1_active_percentage",
"System CPU core 1 active percentage",
metricLabels, nil,
),
"system_cpu2_active_percentage": prometheus.NewDesc(
"typesense_metrics_system_cpu2_active_percentage",
"System CPU core 2 active percentage",
metricLabels, nil,
),
"system_cpu3_active_percentage": prometheus.NewDesc(
"typesense_metrics_system_cpu3_active_percentage",
"System CPU core 3 active percentage",
metricLabels, nil,
),
"system_cpu4_active_percentage": prometheus.NewDesc(
"typesense_metrics_system_cpu4_active_percentage",
"System CPU core 4 active percentage",
metricLabels, nil,
),
"system_cpu_active_percentage": prometheus.NewDesc(
"typesense_metrics_system_cpu_active_percentage",
"System overall CPU active percentage",
metricLabels, nil,
),
"system_disk_total_bytes": prometheus.NewDesc(
"typesense_metrics_system_disk_total_bytes",
"Total system disk space in bytes",
metricLabels, nil,
),
"system_disk_used_bytes": prometheus.NewDesc(
"typesense_metrics_system_disk_used_bytes",
"Used system disk space in bytes",
metricLabels, nil,
),
"system_memory_total_bytes": prometheus.NewDesc(
"typesense_metrics_system_memory_total_bytes",
"Total system memory in bytes",
metricLabels, nil,
),
"system_memory_used_bytes": prometheus.NewDesc(
"typesense_metrics_system_memory_used_bytes",
"Used system memory in bytes",
metricLabels, nil,
),
"system_memory_total_swap_bytes": prometheus.NewDesc(
"typesense_metrics_system_memory_total_swap_bytes",
"Total system swap memory in bytes",
metricLabels, nil,
),
"system_memory_used_swap_bytes": prometheus.NewDesc(
"typesense_metrics_system_memory_used_swap_bytes",
"Used system swap memory in bytes",
metricLabels, nil,
),
"system_network_received_bytes": prometheus.NewDesc(
"typesense_metrics_system_network_received_bytes",
"Total network received bytes",
metricLabels, nil,
),
"system_network_sent_bytes": prometheus.NewDesc(
"typesense_metrics_system_network_sent_bytes",
"Total network sent bytes",
metricLabels, nil,
),
"typesense_memory_active_bytes": prometheus.NewDesc(
"typesense_metrics_memory_active_bytes",
"Typesense active memory usage in bytes",
metricLabels, nil,
),
"typesense_memory_allocated_bytes": prometheus.NewDesc(
"typesense_metrics_memory_allocated_bytes",
"Typesense allocated memory in bytes",
metricLabels, nil,
),
"typesense_memory_fragmentation_ratio": prometheus.NewDesc(
"typesense_metrics_memory_fragmentation_ratio",
"Typesense memory fragmentation ratio",
metricLabels, nil,
),
"typesense_memory_mapped_bytes": prometheus.NewDesc(
"typesense_metrics_memory_mapped_bytes",
"Typesense memory mapped in bytes",
metricLabels, nil,
),
"typesense_memory_metadata_bytes": prometheus.NewDesc(
"typesense_metrics_memory_metadata_bytes",
"Typesense memory metadata size in bytes",
metricLabels, nil,
),
"typesense_memory_resident_bytes": prometheus.NewDesc(
"typesense_metrics_memory_resident_bytes",
"Typesense resident memory usage in bytes",
metricLabels, nil,
),
"typesense_memory_retained_bytes": prometheus.NewDesc(
"typesense_metrics_memory_retained_bytes",
"Typesense retained memory in bytes",
metricLabels, nil,
),
}
}
func getStatsDesc() map[string]*prometheus.Desc {
return map[string]*prometheus.Desc{
"uptime": prometheus.NewDesc(
"typesense_stats_uptime_seconds",
"Uptime in seconds",
metricLabels,
nil,
),
"memory.used": prometheus.NewDesc(
"typesense_stats_memory_used_bytes",
"Memory used in bytes",
metricLabels,
nil,
),
"memory.total": prometheus.NewDesc(
"typesense_stats_memory_total_bytes",
"Total memory in bytes",
metricLabels,
nil,
),
"memory.available": prometheus.NewDesc(
"typesense_stats_memory_available_bytes",
"Available memory in bytes",
metricLabels,
nil,
),
"memory.resident": prometheus.NewDesc(
"typesense_stats_memory_resident_bytes",
"Resident memory in bytes",
metricLabels,
nil,
),
"delete_latency_ms": prometheus.NewDesc(
"typesense_stats_delete_latency_ms",
"Latency of delete operations",
metricLabels,
nil,
),
"delete_requests_per_second": prometheus.NewDesc(
"typesense_stats_delete_requests_per_second",
"Delete requests per second",
metricLabels,
nil,
),
"import_latency_ms": prometheus.NewDesc(
"typesense_stats_import_latency_ms",
"Latency of import operations",
metricLabels,
nil,
),
"import_requests_per_second": prometheus.NewDesc(
"typesense_stats_import_requests_per_second",
"Import requests per second",
metricLabels,
nil,
),
"overloaded_requests_per_second": prometheus.NewDesc(
"typesense_stats_overloaded_requests_per_second",
"Overloaded requests per second",
metricLabels,
nil,
),
"pending_write_batches": prometheus.NewDesc(
"typesense_stats_pending_write_batches",
"Pending write batches",
metricLabels,
nil,
),
"search_latency_ms": prometheus.NewDesc(
"typesense_stats_search_latency_ms",
"Latency of search operations",
metricLabels,
nil,
),
"search_requests_per_second": prometheus.NewDesc(
"typesense_stats_search_requests_per_second",
"Search requests per second",
metricLabels,
nil,
),
"total_requests_per_second": prometheus.NewDesc(
"typesense_stats_total_requests_per_second",
"Total requests per second",
metricLabels,
nil,
),
"write_latency_ms": prometheus.NewDesc(
"typesense_stats_write_latency_ms",
"Latency of write operations",
metricLabels,
nil,
),
"write_requests_per_second": prometheus.NewDesc(
"typesense_stats_write_requests_per_second",
"Write requests per second",
metricLabels,
nil,
),
"latency_ms": prometheus.NewDesc(
"typesense_stats_latency_ms",
"Latency for specific endpoints",
endpointLabels,
nil,
),
"requests_per_second": prometheus.NewDesc(
"typesense_stats_requests_per_second",
"Requests per second for specific endpoints",
endpointLabels,
nil,
),
}
}