---
# System prepended metadata

title: Classify metrics by request

---

# Classify metrics by request

## Base helm chart


**values.yaml**:
```yaml=
metrics:
  # Only GET requests to exact '/reviews' an
  - name: ListReviews
    path:
      exact: "/reviews"
      method: "GET"
  # Only GET requests to path that matches regex for single review
  - name: GetReview
    path:
      regex: "^/reviews/[[:alnum:]]*$"
      method: "GET"
  # All reviews request and every method
  - name: AllReviews
    path:
      regex: "^/reviews"

```

**Expected output**:

```json
 {
"attributes": [
  {
    "output_attribute": "istio_operationId",
    "match": [
      {
        "value": "ListReviews",
        "condition": "request.url_path == '/reviews' && request.method == 'GET'"
      },
      {
        "value": "GetReview",
        "condition": "request.url_path.matches('^/reviews/[[:alnum:]]*$') && request.method == 'GET'"
      },
      {
        "value": "AllReviews",
        "condition": "request.url_path.matches == '^/reviews'"
      }
    ]
  }
]
}
```