diff --git a/daprdocs/content/en/operations/observability/metrics/metrics-overview.md b/daprdocs/content/en/operations/observability/metrics/metrics-overview.md index deb7882cb..25d8075e7 100644 --- a/daprdocs/content/en/operations/observability/metrics/metrics-overview.md +++ b/daprdocs/content/en/operations/observability/metrics/metrics-overview.md @@ -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.