Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add exhaustive list of error codes and description of metric flag #4422

Merged
merged 9 commits into from
Dec 13, 2024

Conversation

jake-engelberg
Copy link

@jake-engelberg jake-engelberg commented Nov 6, 2024

Thank you for helping make the Dapr documentation better!

Please follow this checklist before submitting:

  • Commits are signed with Developer Certificate of Origin (DCO - learn more)
  • Read the contribution guide
  • Commands include options for Linux, MacOS, and Windows within codetabs
  • New file and folder names are globally unique
  • Page references use shortcodes instead of markdown or URL links
  • Images use HTML style and have alternative text
  • Places where multiple code/command options are given have codetabs

In addition, please fill out the following to help reviewers understand this pull request:

Description

Added the exhaustive set of error codes dapr emits as well as how to enable metric recording for these error codes based on the associated PR below which implements this.

Issue reference

dapr/dapr#8256

@jake-engelberg jake-engelberg marked this pull request as ready for review November 6, 2024 23:30
@jake-engelberg jake-engelberg requested review from a team as code owners November 6, 2024 23:30
Copy link

Stale PR, paging all reviewers

Copy link

Stale PR, paging all reviewers

Copy link

github-actions bot commented Dec 1, 2024

Stale PR, paging all reviewers

@github-actions github-actions bot added the stale label Dec 1, 2024
@hhunter-ms hhunter-ms removed the stale label Dec 2, 2024
Copy link
Collaborator

@hhunter-ms hhunter-ms left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

quick review - thank you!

Signed-off-by: Jake Engelberg <[email protected]>
Copy link

Stale PR, paging all reviewers

@github-actions github-actions bot added the stale label Dec 10, 2024
@msfussell msfussell removed the stale label Dec 10, 2024
@msfussell
Copy link
Member

msfussell commented Dec 10, 2024

@jake-engelberg - I realize that we need to make error codes concept much more visible to developers by adding a topic under https://docs.dapr.io/developing-applications/building-blocks/ called "API Error codes" describing what they are and also how you can get metrics for them (This can point to the error codes list and the metrics configuration)

Also in this article we should mention that each SDK can handle and return the error code in the language specific way. For example this is Go https://docs.dapr.io/developing-applications/sdks/go/go-client/#error-handling but we also need to discuss with each of the SDK maintainers how to handle these. I suggest raising an issue into each of SDK repos for this to track this (if my understanding is correct)

@hhunter-ms can help as needed. Hannah - This reference article https://docs.dapr.io/reference/api/error_codes/ should be called "API Error codes" in the index file. I did not realize this was buried under Dapr API reference.

@@ -7,43 +7,150 @@ weight: 1400
---

For http calls made to Dapr runtime, when an error is encountered, an error json is returned in http response body. The json contains an error code and an descriptive error message, e.g.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jake-engelberg this is HTTP and gRPC?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it is both and we'll update the wording soon to reflect the auto generated chart with both codes which at the moment sometimes differ:

dapr/dapr#8346

daprdocs/content/en/reference/api/error_codes.md Outdated Show resolved Hide resolved
daprdocs/content/en/reference/api/error_codes.md Outdated Show resolved Hide resolved
daprdocs/content/en/reference/api/error_codes.md Outdated Show resolved Hide resolved
daprdocs/content/en/reference/api/error_codes.md Outdated Show resolved Hide resolved
daprdocs/content/en/reference/api/error_codes.md Outdated Show resolved Hide resolved
daprdocs/content/en/reference/api/error_codes.md Outdated Show resolved Hide resolved
daprdocs/content/en/reference/api/error_codes.md Outdated Show resolved Hide resolved
daprdocs/content/en/reference/api/error_codes.md Outdated Show resolved Hide resolved
daprdocs/content/en/reference/api/error_codes.md Outdated Show resolved Hide resolved
spec:
metrics:
enabled: true
recordErrorCodes: true
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You also need to;

  1. update this table in configuration setting https://docs.dapr.io/operations/configuration/configuration-overview/#metrics And in that table point to this article for the details.
  2. Update the configuration schema to add this under metrics section here https://docs.dapr.io/reference/resource-specs/configuration-schema/

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hhunter-ms - Will do this. Do Jake you can ignore this comment.

@hhunter-ms hhunter-ms merged commit 780c018 into dapr:v1.15 Dec 13, 2024
4 checks passed
@marcduiker
Copy link
Contributor

@holopin-bot @jake-engelberg Thanks Jake!

Copy link

holopin-bot bot commented Jan 10, 2025

Congratulations @jake-engelberg, the maintainer of this repository has issued you a badge! Here it is: https://holopin.io/claim/cm5qxvv6811300cmj4flegr8q

This badge can only be claimed by you, so make sure that your GitHub account is linked to your Holopin account. You can manage those preferences here: https://holopin.io/account.
Or if you're new to Holopin, you can simply sign up with GitHub, which will do the trick!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants