opbeat_python icon indicating copy to clipboard operation
opbeat_python copied to clipboard

SQL signatures overwrite

Open stas opened this issue 10 years ago • 4 comments

We were hunting down a slow endpoint and found this.

If you have two queries hitting the same table inside one call, only one query will report. Looking at the way extract_signature() works, this theory sounds valid: https://github.com/opbeat/opbeat_python/blob/master/opbeat/instrumentation/packages/dbapi2.py#L125

In our case, a query that is OK would shadow a query that causes slowness. I might be wrong, but if so, I can't explain otherwise why we would not see both queries.

stas avatar Dec 04 '15 04:12 stas

Hey @stas

Thanks for reaching out regarding this issue. I believe you're right and that this is a limitation in the current implementation. We have some different ideas about to better bring to light the slow traces that can get shadowed. I'll leave this open so you can track our progress.

roncohen avatar Dec 04 '15 18:12 roncohen

We applied a wild patch (https://github.com/alexanderad/opbeat_python/commit/ca950b27063d8420402122ff6c60af97d66aa602) to double check described issue.

Perhaps results displayed in this way are not super fancy, but true performance report on multiple (but different) queries hitting same table is shown. Queries which are identical should be still grouped together, since they have same hash signature:

alexanderad avatar Aug 08 '16 11:08 alexanderad

@alexanderad I'm happy. Btw, the pic is no longer available. @roncohen it would be great to have your feedback on this too! Ty!

stas avatar Aug 11 '16 10:08 stas

Updated pic link.

alexanderad avatar Aug 11 '16 13:08 alexanderad