Improve device traffic dashboard and domain attribution metrics
Build and Deploy Gateway / build-and-push (push) Successful in 14s
Build and Deploy Gateway / deploy (push) Successful in 14s

This commit is contained in:
2026-08-08 03:15:45 +03:00
parent 6e701d4fc6
commit 6b17f1982b
14 changed files with 289 additions and 69 deletions
+9
View File
@@ -29,6 +29,11 @@ const snapshot = {
domainTraffic: {
observedAt,
overflowConnections: '2',
attributionEvents: {
unresolved_host: '3',
unknown_device: '4',
unsupported_source: '5',
},
series: [{
deviceId: 'dev_0011223344556677',
domain: 'chatgpt.com',
@@ -54,6 +59,10 @@ test('Prometheus exposition keeps exact counters, stable identity and escaped na
assert.match(output, /harbor_device_domain_traffic_bytes_total\{device_id="dev_0011223344556677",domain="chatgpt\.com",service="OpenAI \/ ChatGPT",source="proxy",direction="download"\} 345/);
assert.match(output, /harbor_domain_traffic_last_observed_timestamp_seconds 1786183200/);
assert.match(output, /harbor_domain_traffic_overflow_connections_total 2/);
assert.match(output, /# TYPE harbor_domain_traffic_attribution_events_total counter/);
assert.match(output, /harbor_domain_traffic_attribution_events_total\{outcome="unresolved_host"\} 3/);
assert.match(output, /harbor_domain_traffic_attribution_events_total\{outcome="unknown_device"\} 4/);
assert.match(output, /harbor_domain_traffic_attribution_events_total\{outcome="unsupported_source"\} 5/);
assert.doesNotMatch(output, /harbor_device_domain_traffic_bytes_total\{[^\n]*name=/);
assert.equal(output.endsWith('\n'), true);
});