Skip to content

Add metrics processor for excluding based on metric label #2176

@sffc

Description

@sffc

I'm running the ops agent on a GCE instance. The instance is running an application that uses a large number of loopback devices, like /dev/loop1, /dev/loop2, etc. I do not want metrics to be stored for these loopback devices because it accounts for a substantial portion of the storage cost of my application's metrics.

Currently, all I can find is to disable the entire agent.googleapis.com/disk/* class of metrics, which is a blunt instrument that throws out metrics I want to track, like disk utilization on the main device /dev/sda2.

I'd like to be able to write a processor like this:

metrics:
  processors:
    metrics_filter:
      type: exclude_by_label
      label: device
      label_pattern: /dev/loop*
      metrics_pattern:
      - agent.googleapis.com/disk/*

Explanation: this is a new metrics filter type named exclude_by_label. It takes a label option, indicating the label to consider as part of the filter, and a label_pattern option, indicating pattern to be matched. If the value of the label matches the pattern, then the metric entry should be excluded. I kept metrics_pattern to indicate the metrics to which to apply the filter.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions