Metric Error Codes Recording + Error Code Prefixing#8256
Conversation
9d751be to
6f94db0
Compare
Signed-off-by: Cassandra Coyle <[email protected]> Signed-off-by: Jake Engelberg <[email protected]>
Signed-off-by: Cassandra Coyle <[email protected]> Signed-off-by: Jake Engelberg <[email protected]>
Signed-off-by: Cassandra Coyle <[email protected]> Signed-off-by: Jake Engelberg <[email protected]>
Signed-off-by: Cassandra Coyle <[email protected]> Signed-off-by: Jake Engelberg <[email protected]>
Signed-off-by: Cassandra Coyle <[email protected]> Signed-off-by: Jake Engelberg <[email protected]>
Signed-off-by: Cassandra Coyle <[email protected]> Signed-off-by: Jake Engelberg <[email protected]>
Signed-off-by: Cassandra Coyle <[email protected]> Signed-off-by: Jake Engelberg <[email protected]>
Signed-off-by: Cassandra Coyle <[email protected]> Signed-off-by: Jake Engelberg <[email protected]>
Signed-off-by: Jake Engelberg <[email protected]>
Signed-off-by: Jake Engelberg <[email protected]>
Signed-off-by: Jake Engelberg <[email protected]>
Signed-off-by: Jake Engelberg <[email protected]>
Signed-off-by: Jake Engelberg <[email protected]>
This reverts commit 53a02b5. Done so to implement in a separate PR. Signed-off-by: Jake Engelberg <[email protected]>
This reverts commit 44c31be. Signed-off-by: Jake Engelberg <[email protected]>
… var will be logged Signed-off-by: Jake Engelberg <[email protected]>
Signed-off-by: Jake Engelberg <[email protected]>
Signed-off-by: Jake Engelberg <[email protected]>
…fix unit tests Signed-off-by: Jake Engelberg <[email protected]>
Signed-off-by: Jake Engelberg <[email protected]>
6f94db0 to
4d78709
Compare
Signed-off-by: Jake Engelberg <[email protected]>
Signed-off-by: Jake Engelberg <[email protected]>
Signed-off-by: Jake Engelberg <[email protected]>
Signed-off-by: Jake Engelberg <[email protected]>
b5ac1a4 to
fb33a61
Compare
Signed-off-by: Jake Engelberg <[email protected]>
fb33a61 to
2cc84c5
Compare
|
This PR makes some changes to dapr/kit that are necessary for the latest commit I made. |
Signed-off-by: Jake Engelberg <[email protected]>
elena-kolevska
left a comment
There was a problem hiding this comment.
Looks like we're almost done! Just a few small nits.
| } | ||
|
|
||
| return kiterrors.NewBuilder(s.Code(), httpCode, s.Message(), info.GetMetadata()[tagField]). | ||
| return kiterrors.NewBuilder(s.Code(), httpCode, s.Message(), info.GetMetadata()[tagField], "unknown"). |
There was a problem hiding this comment.
We need to look a bit deeper into this, if I remember correctly how pluggable components work, we won't be able to extract the original category, but we could maybe create a new generic one, for example, pluggable-state. @JoshVanL what do you think?
For context (so you don't have to look through the whole PR), we added a category field needed for recording metrics to kit and APIErrors, but we never return it as part of the final error the client sees. Does that mean a pluggable component won't have access to it?
There was a problem hiding this comment.
I'm also ok marking this as category pluggable-component for now, and split it in the future if necessary.
Signed-off-by: Jake Engelberg <[email protected]>
787df94 to
f691d69
Compare
|
Looking great! Let's wait for the tests the pass and I'll approve. Good job Jake! |
Signed-off-by: Jake Engelberg <[email protected]>
1568630 to
647fb64
Compare
Signed-off-by: Jake Engelberg <[email protected]>
5eaf491 to
a059c03
Compare
Signed-off-by: Jake Engelberg <[email protected]>
|
@holopin-bot @jake-engelberg Thanks Jake! |
|
Congratulations @jake-engelberg, the maintainer of this repository has issued you a badge! Here it is: https://holopin.io/claim/cm486tyw200580cl88wmkqfj2 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. |
* further fine tuning Signed-off-by: Cassandra Coyle <[email protected]> Signed-off-by: Jake Engelberg <[email protected]> * try fixing borked e2e Signed-off-by: Cassandra Coyle <[email protected]> Signed-off-by: Jake Engelberg <[email protected]> * try fixing standalone validation Signed-off-by: Cassandra Coyle <[email protected]> Signed-off-by: Jake Engelberg <[email protected]> * install numpy too Signed-off-by: Cassandra Coyle <[email protected]> Signed-off-by: Jake Engelberg <[email protected]> * update pip & install pkgs globally instead of venv Signed-off-by: Cassandra Coyle <[email protected]> Signed-off-by: Jake Engelberg <[email protected]> * install requests Signed-off-by: Cassandra Coyle <[email protected]> Signed-off-by: Jake Engelberg <[email protected]> * // -> # for commented line Signed-off-by: Cassandra Coyle <[email protected]> Signed-off-by: Jake Engelberg <[email protected]> * match only installed version of powershell Signed-off-by: Cassandra Coyle <[email protected]> Signed-off-by: Jake Engelberg <[email protected]> * wip: errorcode const consolidation Signed-off-by: Jake Engelberg <[email protected]> * wip: error code monitoring/metric recording Signed-off-by: Jake Engelberg <[email protected]> * style: error_code -> errorcode Signed-off-by: Jake Engelberg <[email protected]> * fix: error changes from refactor Signed-off-by: Jake Engelberg <[email protected]> * remove 2 unused error codes Signed-off-by: Jake Engelberg <[email protected]> * Revert "wip: error code monitoring/metric recording" This reverts commit 53a02b5. Done so to implement in a separate PR. Signed-off-by: Jake Engelberg <[email protected]> * Revert "Revert "wip: error code monitoring/metric recording"" This reverts commit 44c31be. Signed-off-by: Jake Engelberg <[email protected]> * use RecordAndGet() to record error code metric only whenever ApiError var will be logged Signed-off-by: Jake Engelberg <[email protected]> * undo invalid error code recording Signed-off-by: Jake Engelberg <[email protected]> * apply cohesive prefixes to error codes Signed-off-by: Jake Engelberg <[email protected]> * correctly apply metric recording to inline string error definitions, fix unit tests Signed-off-by: Jake Engelberg <[email protected]> * add explicit "type" field for error code metrics Signed-off-by: Jake Engelberg <[email protected]> * linting improvements Signed-off-by: Jake Engelberg <[email protected]> * errorcode recording unit test, fix: register type field on init Signed-off-by: Jake Engelberg <[email protected]> * add category to error codes for O(1) operation on recording Signed-off-by: Jake Engelberg <[email protected]> * use error code vars in tests Signed-off-by: Jake Engelberg <[email protected]> * fumpt Signed-off-by: Jake Engelberg <[email protected]> * convert last test strings, fix some integration tests Signed-off-by: Jake Engelberg <[email protected]> * fix errorcodes compile error Signed-off-by: Jake Engelberg <[email protected]> * golangci-lint fixes Signed-off-by: Jake Engelberg <[email protected]> * lint fix Signed-off-by: Jake Engelberg <[email protected]> * remove debug binary Signed-off-by: Jake Engelberg <[email protected]> * Revert "lint fix" This reverts commit 392080a. Revert "golangci-lint fixes" This reverts commit d6c6066. Revert "fix errorcodes compile error" This reverts commit 9739534. Revert "convert last test strings, fix some integration tests" This reverts commit ae39228. Revert "fumpt" This reverts commit 7f04bb3. Revert "use error code vars in tests" This reverts commit c6ae704. remove addtl err code var in test Signed-off-by: Jake Engelberg <[email protected]> * revise "key" field in metric to "category" Signed-off-by: Jake Engelberg <[email protected]> * restore original error codes + bug fixes Signed-off-by: Jake Engelberg <[email protected]> * fix configuration test Signed-off-by: Jake Engelberg <[email protected]> fix copyright headers Signed-off-by: Jake Engelberg <[email protected]> utilize todo context w/o struct member Signed-off-by: Jake Engelberg <[email protected]> nelson style improvements Signed-off-by: Jake Engelberg <[email protected]> * fix: remove doubled calls of RecordAndGet() Signed-off-by: Jake Engelberg <[email protected]> * reduce repitition in pubsub.go by recording at parent build() Signed-off-by: Jake Engelberg <[email protected]> * add specific recorder logic for Jobs API composite err codes Signed-off-by: Jake Engelberg <[email protected]> * refactor metric RecordX() funcs to reduce repetition Signed-off-by: Jake Engelberg <[email protected]> * lint fix Signed-off-by: Jake Engelberg <[email protected]> * metric naming: count -> total Signed-off-by: Jake Engelberg <[email protected]> * fix: style/naming Signed-off-by: Jake Engelberg <[email protected]> * fix: correct crypto metric recording w/ wrapper funcs Signed-off-by: Jake Engelberg <[email protected]> * fix: remove extra metric recordings Signed-off-by: Jake Engelberg <[email protected]> * integtest: error code metrics Signed-off-by: Jake Engelberg <[email protected]> * fix duplicated/missing http recordings Signed-off-by: Jake Engelberg <[email protected]> * clarify/further consolidate recording funcs Signed-off-by: Jake Engelberg <[email protected]> * further reduction of recording, requires dapr/kit PR Signed-off-by: Jake Engelberg <[email protected]> * Add metric spec plural copy, remove some comments Signed-off-by: Jake Engelberg <[email protected]> * nit improvements Signed-off-by: Jake Engelberg <[email protected]> * provide newest dapr/kit to properly record error code Signed-off-by: Jake Engelberg <[email protected]> * remove dapr/kit replace, add log for malformed error code Signed-off-by: Jake Engelberg <[email protected]> * log: error -> warn Signed-off-by: Jake Engelberg <[email protected]> --------- Signed-off-by: Cassandra Coyle <[email protected]> Signed-off-by: Jake Engelberg <[email protected]> Co-authored-by: Cassandra Coyle <[email protected]> Co-authored-by: Elena Kolevska <[email protected]> Co-authored-by: Yaron Schneider <[email protected]> Co-authored-by: Artur Souza <[email protected]> Signed-off-by: Jake Engelberg <[email protected]>
Description
Error codes that were defined and used on a per-developer basis for debug logging has been temporarily moved to a singular
errorcodespackage to be defined and prefixed for cohesion. Eventually, they will be converted to structures similar topredefined.gofor all errors and associated messages.Additionally, error codes are now retrieved using a function which also records a count metric for tracking errors.
No renaming has been done to assure backwards compatability.
The metric can be filtered by its keys for app-id, error code, and error category.
The error metric recording is opt-in via the flag
metrics.recordErrorCodes.Metric fields/schema:
Example of query

dapr_error_code_totalin Grafana:Example of query

rate(dapr_error_code_total[2m])in Grafana:Another img:

Issue reference
Please reference the issue this PR will close: dapr/proposals#67
Checklist
Please make sure you've completed the relevant tasks for this PR, out of the following list: