Add metrics filter rules and video (#3174)

* add to metrics overview, bring in demo

Signed-off-by: Hannah Hunter <hannahhunter@microsoft.com>

* update from yaron

Signed-off-by: Hannah Hunter <hannahhunter@microsoft.com>

* add table

Signed-off-by: Hannah Hunter <hannahhunter@microsoft.com>

---------

Signed-off-by: Hannah Hunter <hannahhunter@microsoft.com>
This commit is contained in:
Hannah Hunter 2023-02-15 13:44:58 -06:00 committed by GitHub
parent 87c49b1b25
commit a97d4669d9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 22 additions and 1 deletions

View File

@ -103,7 +103,21 @@ The following table lists the properties for metrics:
| Property | Type | Description |
|--------------|--------|-------------|
| `enabled` | boolean | Whether metrics should to be enabled.
| `enabled` | boolean | Whether metrics should to be enabled. |
| `rules` | boolean | Named rule to filter metrics. Each rule contains a set of `labels` to filter on and a`regex`expression to apply to the metrics path. |
To mitigate high memory usage and egress costs associated with [high cardinality metrics]({{< ref "metrics-overview.md#high-cardinality-metrics" >}}), you can set regular expressions for every metric exposed by the Dapr sidecar. For example:
```yml
metric:
enabled: true
rules:
- name: dapr_runtime_service_invocation_req_sent_total
labels:
- name: method
regex:
"orders/": "orders/.+"
```
See [metrics documentation]({{< ref "metrics-overview.md" >}}) for more information.

View File

@ -96,6 +96,13 @@ spec:
When this configuration is applied, a recorded metric with the `method` label of `orders/a746dhsk293972nz` will be replaced with `orders/`.
### Watch the demo
Watch [this video to walk through handling high cardinality metrics](https://youtu.be/pOT8teL6j_k?t=1524):
<iframe width="560" height="315" src="https://www.youtube-nocookie.com/embed/pOT8teL6j_k?start=1524" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen></iframe>
## References
* [Howto: Run Prometheus locally]({{< ref prometheus.md >}})