diff --git a/docs/src/user-guide/observability.md b/docs/src/user-guide/observability.md index 84ac08af8..fead01849 100644 --- a/docs/src/user-guide/observability.md +++ b/docs/src/user-guide/observability.md @@ -14,7 +14,6 @@ This optional interface will serve Prometheus metrics from `/metrics`. It will b | `connections_opened` | `source` | [counter](#counter) | Counts the total number of connections that clients have opened against this source. | | `shotover_chain_requests_batch_size` | `chain` | [histogram](#histogram) | The number of requests in each request batch passing through `chain`. | | `shotover_chain_responses_batch_size` | `chain` | [histogram](#histogram) | The number of responses in each response batch passing through `chain`. | -| `shotover_available_connections_count` | `source` | [gauge](#gauge) | The number of connections currently connected to `source` | | `shotover_source_to_sink_latency_seconds` | `sink` | [histogram](#histogram) | The milliseconds between reading a request from a source TCP connection and writing it to a sink TCP connection | | `shotover_sink_to_source_latency_seconds` | `source` | [histogram](#histogram) | The milliseconds between reading a response from a sink TCP connection and writing it to a source TCP connection | diff --git a/shotover-proxy/tests/runner/observability_int_tests.rs b/shotover-proxy/tests/runner/observability_int_tests.rs index 79eaac1d5..dab8f7591 100644 --- a/shotover-proxy/tests/runner/observability_int_tests.rs +++ b/shotover-proxy/tests/runner/observability_int_tests.rs @@ -14,6 +14,7 @@ async fn test_metrics() { # TYPE connections_opened counter # TYPE shotover_available_connections_count gauge # TYPE shotover_chain_failures_count counter +# TYPE shotover_chain_messages_per_batch_count summary # TYPE shotover_chain_requests_batch_size summary # TYPE shotover_chain_responses_batch_size summary # TYPE shotover_chain_total_count counter @@ -25,6 +26,16 @@ async fn test_metrics() { connections_opened{source="redis"} shotover_available_connections_count{source="redis"} shotover_chain_failures_count{chain="redis"} +shotover_chain_messages_per_batch_count_count{chain="redis"} +shotover_chain_messages_per_batch_count_sum{chain="redis"} +shotover_chain_messages_per_batch_count{chain="redis",quantile="0"} +shotover_chain_messages_per_batch_count{chain="redis",quantile="0.1"} +shotover_chain_messages_per_batch_count{chain="redis",quantile="0.5"} +shotover_chain_messages_per_batch_count{chain="redis",quantile="0.9"} +shotover_chain_messages_per_batch_count{chain="redis",quantile="0.95"} +shotover_chain_messages_per_batch_count{chain="redis",quantile="0.99"} +shotover_chain_messages_per_batch_count{chain="redis",quantile="0.999"} +shotover_chain_messages_per_batch_count{chain="redis",quantile="1"} shotover_chain_requests_batch_size_count{chain="redis"} shotover_chain_requests_batch_size_sum{chain="redis"} shotover_chain_requests_batch_size{chain="redis",quantile="0"} diff --git a/shotover/src/transforms/chain.rs b/shotover/src/transforms/chain.rs index 2dfd5db34..35a9b2e91 100644 --- a/shotover/src/transforms/chain.rs +++ b/shotover/src/transforms/chain.rs @@ -246,6 +246,9 @@ impl TransformChainBuilder { } ).collect(); + // This is deprecated but give users some time to migrate to the requests/responses versions that have replaced this metric + histogram!("shotover_chain_messages_per_batch_count", "chain" => name).record(0); + let chain_requests_batch_size = histogram!("shotover_chain_requests_batch_size", "chain" => name); let chain_responses_batch_size =