This repository was archived by the owner on Jun 11, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.yaml.example
122 lines (120 loc) · 4.12 KB
/
config.yaml.example
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
newrelic:
instance_ids_cmd: ./adjust --query $APP_ID | jq .monitoring
fetch:
- name: active_canary_hostnames
api: insights
query: >
SELECT
uniques(podName) AS podNames,
uniqueCount(podName) AS count
FROM K8sContainerSample
SINCE 1 minute AGO
WHERE namespace = 'ns'
AND deploymentName = 'canary'
- name: active_canary_instances
api: apm_instances_list
hostnames: "active_canary_hostnames.get_column_value('podNames')"
- name: canary_insights_metrics
api: insights
query: >
SELECT
average(cpuUsedCores) AS cpuUsedCores,
average(cpuRequestedCores) AS cpuRequestedCores,
average(memoryUsedBytes) AS memoryUsedBytes,
average(memoryRequestedBytes) AS memoryRequestedBytes
FROM K8sContainerSample
SINCE '{from_time}'
UNTIL '{to_time}'
WHERE namespace = 'ns'
AND deploymentName = 'canary'
FACET podName
TIMESERIES
LIMIT 1000
- name: canary_apm_metrics
api: apm_metrics_data
instance_ids: "active_canary_instances.ids"
metrics:
- name: HttpDispatcher
values:
- requests_per_minute
- average_response_time
- name: Errors/all
values:
- error_count
- name: active_production_hostnames
api: insights
query: >
SELECT
uniques(podName) AS podNames,
uniqueCount(podName) AS count
FROM K8sContainerSample
SINCE 1 minute AGO
WHERE namespace = 'ns'
AND deploymentName = 'production'
- name: active_production_instances
api: apm_instances_list
hostnames: "active_production_hostnames.get_column_value('podNames')"
- name: production_insights_metrics
api: insights
query: >
SELECT
average(cpuUsedCores) AS cpuUsedCores,
average(cpuRequestedCores) AS cpuRequestedCores,
average(memoryUsedBytes) AS memoryUsedBytes,
average(memoryRequestedBytes) AS memoryRequestedBytes
FROM K8sContainerSample
SINCE '{from_time}'
UNTIL '{to_time}'
WHERE namespace = 'ns'
AND deploymentName = 'production'
FACET podName
TIMESERIES
LIMIT 1000
- name: production_apm_metrics
api: apm_metrics_data
instance_ids: "active_production_instances.ids"
metrics:
- name: HttpDispatcher
values:
- requests_per_minute
- average_response_time
- name: Errors/all
values:
- error_count
metrics:
- name: canary_throughput
unit: rpm
values: "canary_apm_metrics.get_metric('HttpDispatcher').requests_per_minute"
- name: canary_response_time
unit: seconds
values: "canary_apm_metrics.get_metric('HttpDispatcher').average_response_time"
- name: canary_error_rate
unit: count
values: "canary_apm_metrics.get_metric('Errors/all').error_count"
- name: canary_cpu_used
unit: cores
values: "canary_insights_metrics.get_column_value('cpuUsedCores')"
- name: canary_mem_used
unit: bytes
values: "canary_insights_metrics.get_column_value('memoryUsedBytes')"
- name: canary_instance_count
unit: count
value: "active_canary_hostnames.get_column_value('count')"
- name: production_throughput
unit: rpm
values: "production_apm_metrics.get_metric('HttpDispatcher').requests_per_minute"
- name: production_response_time
unit: seconds
values: "production_apm_metrics.get_metric('HttpDispatcher').average_response_time"
- name: production_error_rate
unit: count
values: "production_apm_metrics.get_metric('Errors/all').error_count"
- name: production_cpu_used
unit: cores
values: "production_insights_metrics.get_column_value('cpuUsedCores')"
- name: production_mem_used
unit: bytes
values: "production_insights_metrics.get_column_value('memoryUsedBytes')"
- name: production_instance_count
unit: count
value: "active_production_hostnames.get_column_value('count')"