Skip to content

Commit

Permalink
config/statistics: Add discrete modifiers
Browse files Browse the repository at this point in the history
  • Loading branch information
sirainen committed Sep 3, 2024
1 parent b0421cc commit 445385a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
1 change: 1 addition & 0 deletions data/updates.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ export const updates = {
mail_crypt_fs_maybe: '2.4.0',
mail_location_keep_noselect: '2.4.0',
mail_location_no_noselect: '2.4.0',
metric_group_by_discrete_modifiers_added: '2.4.0',
migration_imapc_features: '2.4.0',
pbkdf2_hashing: '2.4.0',
process_title_imap_process: '2.4.0',
Expand Down
13 changes: 13 additions & 0 deletions docs/core/config/statistics.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,13 +79,26 @@ is a very common use case, not specifying an aggregation function is treated
as an alias for discrete aggregation. In other words, `field` and
`field:discrete` produce the same behavior.

[[added,metric_group_by_discrete_modifiers_added]] An additional parameter
can be added to provide modifiers to the discrete value. This is done as
[[link,settings_variables,%variables]] and their modifiers. The following
variables are provided:

* `%{value}` - The original value
* `%{domain}` - Text after the `@` character, or empty string if there is no `@`.

Example:

```[dovecot.conf]
metric imap_command {
filter = event=imap_command_finished
group_by = cmd_name tagged_reply_state
}
metric login_domains {
filter = event=auth_request_finished
fields = user
group_by = discrete:%L{domain}
}
```

This example configuration will generate statistics for each IMAP command.
Expand Down

0 comments on commit 445385a

Please sign in to comment.