match final implementation

Signed-off-by: Jake Engelberg <jake@diagrid.io>
This commit is contained in:
Jake Engelberg 2024-12-01 15:51:37 -05:00
parent 125eb19c9a
commit 88a0d66d44
1 changed files with 17 additions and 1 deletions

View File

@ -72,8 +72,9 @@ spec:
## Configuring metrics for error codes
You can enable additional metrics for [Dapr API error codes](https://github.com/dapr/dapr/blob/master/docs/reference/api/error_codes/) by setting `spec.metrics.recordErrorCodes` to `true`. See the specific metrics described in the [Dapr development docs](https://github.com/dapr/dapr/blob/master/docs/development/dapr-metrics.md).
You can enable additional metrics for [Dapr API error codes](https://github.com/dapr/dapr/blob/master/docs/reference/api/error_codes/) by setting `spec.metrics.recordErrorCodes` to `true`. Dapr APIs which communicate back to its caller may return standardized error codes. As described in the [Dapr development docs](https://github.com/dapr/dapr/blob/master/docs/development/dapr-metrics.md), a new metric called `error_code_total` will be recorded, which will allow monitoring of error codes triggered by application, code, and category. See [package errorcodes](https://github.com/dapr/dapr/blob/master/pkg/messages/errorcodes/errorcodes.go) for specific codes and categories.
Example configuration:
```yaml
apiVersion: dapr.io/v1alpha1
kind: Configuration
@ -86,6 +87,21 @@ spec:
recordErrorCodes: true
```
Example metric:
```json
{
app_id="publisher-app",
category="state",
dapr_io_enabled="true",
error_code="ERR_STATE_STORE_NOT_CONFIGURED",
instance="10.244.1.64:9090",
job="kubernetes-service-endpoints",
namespace="my-app",
node="my-node",
service="publisher-app-dapr"
}
```
## Optimizing HTTP metrics reporting with path matching
When invoking Dapr using HTTP, metrics are created for each requested method by default. This can result in a high number of metrics, known as high cardinality, which can impact memory usage and CPU.