Skip to main content
Metric filter policies control which metrics pass through Edge. Use them to drop noisy metrics and cut cardinality costs.

Basic Structure

Every metric policy has:
  • match: One or more matchers that identify target metrics
  • keep: Boolean (true to keep, false to drop)
Unlike log policies, metric policies don’t support percentage sampling or rate limiting. The keep value is a simple boolean.

Matchers

Matchers identify which metrics a policy applies to. When a policy has multiple matchers, all must match (AND logic).

Metric Fields

Match on well-known metric fields:

Metric Type

Match on metric type:

Aggregation Temporality

Match on how metrics report aggregated values:

Datapoint Attributes

Match on data point attributes (dimensions/labels):

Resource Attributes

Match on resource attributes:

Scope Attributes

Match on instrumentation scope attributes:

Match Types

Exact Match

Match the exact string value:

Regex Match

Match using RE2 regular expressions:

Exists Match

Match on field presence:

Negation

Invert any match with negate:

Policy Precedence

When multiple policies match the same metric, keep: false takes precedence over keep: true.

Examples

Drop Debug Metrics

Drop System Load Metrics

Drop Histogram Metrics

Drop by Datapoint Attribute

Drop by Service

Drop High-Cardinality Metrics

Keep Only Specific Metrics

Using negation to drop everything except what you want:

Combined Conditions

Common Use Cases

Cost Reduction

Drop metrics you don’t query:
  • Debug and internal metrics
  • Per-request ID dimensions (high cardinality)
  • Redundant system metrics
  • Metrics from test/dev environments

Cardinality Control

High-cardinality metrics (many unique label combinations) are expensive. Drop metrics with:
  • Unique request IDs as labels
  • User IDs as labels
  • Timestamps as labels
  • Unbounded string values as labels

Compliance

Drop metrics that might contain sensitive information:
  • Metrics with PII in labels
  • Metrics from sensitive services
  • Internal topology information

Best Practices

  1. Start with observability: Know what you’re dropping before you drop it
  2. Use exact matches when possible: Faster than regex
  3. Target high-volume metrics: Focus on metrics that cost the most
  4. Be careful with negation: It makes it easy to drop metrics you meant to keep
  5. Test in staging: Verify policies before production deployment

Next Steps

Log Filter

Filter logs

Log Transform

Transform log data