Filtering metrics

Create whitelists and blacklists using regular expressions to filter metrics reported by DSE Metrics Collector.

Use the dsetool insights_filters command to filter metrics deemed unimportant or sensitive, and focus on specific metrics important to your organization.

Apply filters with one of these options:
--global
Filters metrics reported locally and insights data files.
--insights_only
Filters insights data files only (for diagnostic purposes).

Use a regular expression (regex) to specify which metrics to include or exclude from the filter. The regex is not anchored, so a substring match like Keyspace blocks anything with keyspace in the metric name. You can also specify a full regex such as org.apache.cassandra.metrics.Keyspace.+ to filter metrics from a specific keyspace. For details, see example filters.

The following tables describe whitelist and blacklist combinations to grant or deny access to a metric using a regex. When evaluating a regex, the blacklist always overrides the whitelist.

Table 1. Blacklist and whitelist combinations to grant access
Regex Blacklist Whitelist Access
No metric indicated. - -
Metric included in whitelist without any blacklist entries. - Match
Metric not included in blacklist without any whitelist entries. No match -
Metric included in whitelist without any matches in blacklist. No match Match
Table 2. Blacklist and whitelist combinations to deny access
Regex Blacklist Whitelist Access
Metric not included in whitelist without any blacklist entries. - No match X
Metric included in blacklist without any whitelist entries. Match - X
Metric not included in whitelist. No match No match X
Metric included in blacklist without a match in the whitelist. Match No match X
Metric included in both blacklist and whitelist. Match Match X

Example filters

Show all active filters

dsetool insights_filters --show_filters

Remove all active filters

dsetool insights_filters --remove_all_filters

Add a global filter to deny all metrics for a specific keyspace

dsetool insights_filters --add --global --deny "org\\.apache\\.cassandra\\.metrics\\.(keyspace_name|table_name).*(keyspace_name).*"

Add a global filter to deny all metrics matching KeyspaceMetrics

dsetool insights_filters --add --global --deny .+KeyspaceMetrics.+ 

Remove a global filter to allow metrics for a specific keyspace that has an existing deny filter

dsetool insights_filters --remove --global --deny "org\\.apache\\.cassandra\\.metrics\\.(keyspace_name|table_name).*(keyspace_name).*"

Add a filter to insights data files that deny grace period metrics

dsetool insights_filters --add --insights_only --deny .+gc.+