feat(go): expose async sink publish latency histogram

This commit is contained in:
lingniu
2026-07-03 19:02:24 +08:00
parent 018015f9de
commit afb301cb7a
6 changed files with 15 additions and 2 deletions

View File

@@ -83,6 +83,9 @@ func TestAsyncSinkRecordsQueueMetrics(t *testing.T) {
`vehicle_async_sink_queue_depth{sink="nats"}`,
`vehicle_async_sink_publish_total{kind="raw",sink="nats",status="ok"} 1`,
`vehicle_async_sink_publish_total{kind="fields",sink="nats",status="ok"} 1`,
`vehicle_async_sink_publish_duration_ms_histogram_bucket{le="+Inf",kind="raw",sink="nats",status="ok"} 1`,
`vehicle_async_sink_publish_duration_ms_histogram_count{kind="raw",sink="nats",status="ok"} 1`,
`vehicle_async_sink_publish_duration_ms_histogram_sum{kind="raw",sink="nats",status="ok"}`,
} {
if !strings.Contains(text, want) {
t.Fatalf("async sink metric missing %s:\n%s", want, text)