Skip to content

Commit

Permalink
metrics: add provider rollups
Browse files Browse the repository at this point in the history
Introduces the following new metrics:

* total_messages_(delivered|fail|transfail)_by_provider
  (labels: provider) - gives aggregates for a given provider/site.
* total_messages_(delivered|fail|transfail)_by_provider_and_source
  (labels: provider, source, pool) - gives aggregates for a given source
  to a specific provider/site.

These queued_count metrics sum the scheduled and ready queue counter
based on the provider, and provider_and_pool:

* queued_count_by_provider
  (labels: provider)
* queued_count_by_provider_and_pool
  (labels: provider, prool)

The provider label in this context is taken from the provider_name that
is set on the associated queue, or if none is set, the site name without
any source or protocol decoration.  This way it is relatively easy to
see at a glance the total queued volume for a given provider/site,
and also to see that broken down by the source *pool*.

And connection counts in a similar veing to the queued_counts:

* connection_count_by_provider
  (labels: provider) - number of connections currently established to
  a provider
* connection_count_by_provider_and_pool
  (labels: provider, pool) - number of connections currently established
  from a pool to a provider.

A new `kcli provider-summary` command shows a provider-centric view of
the queues, using these provider and pool based rollups.

refs: #274
  • Loading branch information
wez committed Sep 13, 2024
1 parent 64fac57 commit ab12b9b
Show file tree
Hide file tree
Showing 10 changed files with 719 additions and 63 deletions.
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions crates/kcli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ clap = {version="4.5", features=["derive", "wrap_help"]}
clap-markdown = "0.1"
dns-resolver = {path="../dns-resolver"}
futures = "0.3"
futures-util = "0.3"
humantime = "2.1"
lexicmp = "0.1"
message = {path="../message", default-features=false}
Expand Down
3 changes: 3 additions & 0 deletions crates/kcli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ mod bounce_cancel;
mod bounce_list;
mod inspect_message;
mod logfilter;
mod provider_summary;
mod queue_summary;
mod rebind;
mod suspend;
Expand Down Expand Up @@ -64,6 +65,7 @@ enum SubCommand {
SuspendReadyQCancel(suspend_ready_q_cancel::SuspendReadyQCancelCommand),
SetLogFilter(logfilter::SetLogFilterCommand),
InspectMessage(inspect_message::InspectMessageCommand),
ProviderSummary(provider_summary::ProviderSummaryCommand),
QueueSummary(queue_summary::QueueSummaryCommand),
TraceSmtpClient(trace_smtp_client::TraceSmtpClientCommand),
TraceSmtpServer(trace_smtp_server::TraceSmtpServerCommand),
Expand Down Expand Up @@ -123,6 +125,7 @@ impl SubCommand {
Self::SuspendReadyQList(cmd) => cmd.run(endpoint).await,
Self::SetLogFilter(cmd) => cmd.run(endpoint).await,
Self::InspectMessage(cmd) => cmd.run(endpoint).await,
Self::ProviderSummary(cmd) => cmd.run(endpoint).await,
Self::QueueSummary(cmd) => cmd.run(endpoint).await,
Self::TraceSmtpClient(cmd) => cmd.run(endpoint).await,
Self::TraceSmtpServer(cmd) => cmd.run(endpoint).await,
Expand Down
Loading

0 comments on commit ab12b9b

Please sign in to comment.