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

Extend errors with a key -> server mapping context #1

Draft
wants to merge 3 commits into
base: github
Choose a base branch
from

Conversation

bradshjg
Copy link

@bradshjg bradshjg commented Nov 8, 2024

To generate metrics based on observed errors that use the key and/or server, currently users need to do something like parse the message or override the check_return_code in order to hook into a place where they can attempt to observe the key used and infer the server involved similar to how the message is generated. This is additionally tricky around the ServerIsMarkedDead errors, since naively calling server_by_key would return the incorrect server (handled by detect_failure as part of message generation).

To ease users ability to track the keys and servers that errors are related to, this extends the base error class and attaches the same context applied to the messages to an attribute key_map.

As far as I can tell there's no differentiation between server-side and client-side errors, so the key_map's semantics are roughly "these were the keys used as part of this operation, and these are the servers we think would have been used with these keys"...a little wishy-washy but likely still useful to the user?

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.

1 participant