> 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
