Skip to content

Commit

Permalink
Readd old metric as deprecated
Browse files Browse the repository at this point in the history
  • Loading branch information
rukai committed Sep 23, 2024
1 parent de8802f commit 0ab6be1
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
1 change: 0 additions & 1 deletion docs/src/user-guide/observability.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 |

Expand Down
11 changes: 11 additions & 0 deletions shotover-proxy/tests/runner/observability_int_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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"}
Expand Down
3 changes: 3 additions & 0 deletions shotover/src/transforms/chain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand Down

0 comments on commit 0ab6be1

Please sign in to comment.