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

[Mongo] Determine if a query had errored from the parser #2046

Open
kpattaswamy opened this issue Nov 12, 2024 · 0 comments
Open

[Mongo] Determine if a query had errored from the parser #2046

kpattaswamy opened this issue Nov 12, 2024 · 0 comments

Comments

@kpattaswamy
Copy link
Member

Is your feature request related to a problem? Please describe.
In order to build a PxL script to show LET metrics, we need to know if a query had errored to determine the error rate. At the moment, the response status / body of a record is ok: number double ....

The wire protocol for mongo doesn't show a clear way to determine the status of a query but it seems like there are certain error codes that are sent by the database in the event of an error. An additional key/value pair (e.g. errmsg: error code #) would be added to the BSON of the response frame as per mongo source code.

Describe the solution you'd like
I tried forcing an error status between a local client/database setup and was able to generate a pcap of the errmsg key in the response frame. This key is notably not at the top level of the document in the response payload whereas the ok key is.

I believe one way to go about this is by having the parser search for an errmsg string in the logic handling a response frame before searching for the ok key. In the event of an error, the response status would then contain the errmsg key and its associated error code.

Describe alternatives you've considered
To generate LET metrics, it could also be possible to search/pluck an errmsg key from PxL on a response to see if a query had errored.

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

No branches or pull requests

1 participant