-
Notifications
You must be signed in to change notification settings - Fork 0
/
metrics.py
31 lines (29 loc) · 1.01 KB
/
metrics.py
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
import socket
from aioprometheus_thin.configs import MetricsTypes
CONST_LABELS = {'host': socket.gethostname()}
CUSTOM_METRICS_LIST = [
{
'name': 'builds_success_rate_gauge',
'description': 'Builds success rate out of all builds.',
'metric_type': MetricsTypes.gauge,
'const_labels': CONST_LABELS
},
{
'name': 'builds_complete_duration',
'description': 'Builds completion duration, will marked as -1 if failed or incomplete',
'metric_type': MetricsTypes.gauge,
'const_labels': CONST_LABELS
},
{
'name': 'deployments_complete_duration',
'description': 'Deployments completion duration, will marked as -1 if failed or incomplete',
'metric_type': MetricsTypes.gauge,
'const_labels': CONST_LABELS
},
{
'name': 'deployments_success_rate_gauge',
'description': 'Deployments success rate out of all builds.',
'metric_type': MetricsTypes.gauge,
'const_labels': CONST_LABELS
}
]