|
20 | 20 | backlog = Gauge("backlog", "Request backlog", ["namespace", "serviceName", "podName", "level"])
|
21 | 21 | cpu = Gauge("cpu_seconds", "CPU usage", ["namespace", "serviceName", "podName"])
|
22 | 22 | memory = Gauge("memory_usage_bytes", "Memory usage", ["namespace", "serviceName", "podName"])
|
| 23 | +request_exchanges = Counter("request_exchanges", "Request exchanges between services", ["origin", "destination"]) |
23 | 24 |
|
24 | 25 |
|
25 | 26 | class Gazer:
|
@@ -76,6 +77,7 @@ def ipv4_request_event(self, cpu, data, size):
|
76 | 77 | if not rpod['isService']:
|
77 | 78 | return
|
78 | 79 | request_received.labels(rpod['namespace'], rpod['serviceName'], rpod['name']).inc()
|
| 80 | + request_exchanges.labels(pod['serviceName'], rpod['serviceName']).inc() |
79 | 81 |
|
80 | 82 | ms.labels(pod['namespace'], pod['serviceName'], pod['name']).observe(event['MS'] / 1000000)
|
81 | 83 | tx_kb.labels(pod['namespace'], pod['serviceName'], pod['name']).observe(event['TX_KB'])
|
@@ -123,7 +125,8 @@ def poll_syn_backlog(self):
|
123 | 125 | if saddr in config_watcher.config:
|
124 | 126 | pod = config_watcher.config[saddr]
|
125 | 127 |
|
126 |
| - backlog.labels(pod['namespace'], pod['serviceName'], pod['name'], row[0].slot).set(row[1].value) |
| 128 | + backlog.labels(pod['namespace'], pod['serviceName'], pod['name'], int(row[0].slot)).set( |
| 129 | + int(row[1].value)) |
127 | 130 |
|
128 | 131 | if self.console_mode:
|
129 | 132 | self.syn_df = self.syn_df.append({
|
@@ -181,10 +184,3 @@ def poll_data_in_bg(self):
|
181 | 184 | poll_syn_backlog.join()
|
182 | 185 | poll_requests.join()
|
183 | 186 | poll_kube_api.join()
|
184 |
| - |
185 |
| -def extract_number(text): |
186 |
| - res = [int(i) for i in text.split() if i.isdigit()] |
187 |
| - if len(res) == 1: |
188 |
| - return int(res) |
189 |
| - else: |
190 |
| - return 0 |
0 commit comments