bugsnag / bugsnag-ruby

BugSnag error monitoring & reporting software for rails, sinatra, rack and ruby
https://docs.bugsnag.com/platforms/ruby
MIT License
246 stars 174 forks source link

Mongo breadcrumb: Add "sort" field #798

Open johnnyshields opened 9 months ago

johnnyshields commented 9 months ago

Goal

Add "sort" field to breadcrumb for MongoDB queries. Sort can have significant bearing on index selection/performance, and its very useful to see.

Design

The implementation mirrors how the "filter" field is captured today. Unlike filters, we don't need to mask the values because they can only be 1 or -1.

Changeset

The Mongo breadcrumb functionality only.

This also includes the changes from https://github.com/bugsnag/bugsnag-ruby/pull/797 b/c I cannot commit from my Windows machine otherwise.

Testing

Tested in RSpec and by TableCheck in production.

clr182 commented 9 months ago

Hi @johnnyshields Thanks for raising this PR. We will be sure to take a look when priority allows us.

johnnyshields commented 9 months ago

Here is evidence of this working:

image