> For the complete documentation index, see [llms.txt](https://docs.fluentbit.io/manual/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.fluentbit.io/manual/3.0/pipeline/processors/metrics-selector.md).

# Metrics Selector

The **metric\_selector** processor allows you to select metrics to include or exclude (similar to the `grep` filter for logs).

## Configuration Parameters <a href="#config" id="config"></a>

The native processor plugin supports the following configuration parameters:

| Key             | Description                                                                                      | Default        |
| --------------- | ------------------------------------------------------------------------------------------------ | -------------- |
| Metric\_Name    | Keep metrics in which the metric of name matches with the actual name or the regular expression. |                |
| Context         | Specify matching context. Currently, metric\_name is only supported.                             | `Metrics_Name` |
| Action          | Specify the action for specified metrics. INCLUDE and EXCLUDE are allowed.                       |                |
| Operation\_Type | Specify the operation type of action for metrics payloads. PREFIX and SUBSTRING are allowed.     |                |

## Configuration Examples <a href="#config_example" id="config_example"></a>

Here is a basic configuration example.

{% tabs %}
{% tab title="fluent-bit.yaml" %}

```yaml
service:
  flush: 5
  daemon: off
  log_level: info

pipeline:
  inputs:
    - name: fluentbit_metrics
      tag: fluentbit.metrics
      scrape_interval: 10

      processors:
        metrics:
          - name: metrics_selector
            metric_name: /storage/
            action: include
          - name: metrics_selector
            metric_name: /fs/
            action: exclude

          - name: labels
            delete: name


  outputs:
    - name: stdout
      match: '*'
```

{% endtab %}
{% endtabs %}

All processors are only valid with the YAML configuration format. Processor configuration should be located under the relevant input or output plugin configuration.

Metric\_Name parameter will translate the strings which is quoted with backslashes `/.../` as Regular expressions. Without them, users need to specify Operation\_Type whether prefix matching or substring matching. The default operation is prefix matching. For example, `/chunks/` will be translated as a regular expression.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.fluentbit.io/manual/3.0/pipeline/processors/metrics-selector.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
