How can I categorize and route exceptions to specific components or namespaces in my favorite error tracker?

This message was imported from the Ruby/Rails Modularity Slack server. Find more info in the import thread.

Message originally sent by slack user U717X535USA

Is anyone’s favourite error tracker able to “route” exceptions to certain components/namespaces? I’d love to start categorising them so we could have better analytics or alert a specific person/team that recently worked on it. Basically CODEOWNERS but for exceptions

We do this at Gusto with our open source code_ownership gem. This gem has a method CodeOwnership.for_class (for handled exceptions – i.e. we rescue an exception) and also CodeOwnership.for_backtrace (for unhandled exceptions — i.e. we raise but do not rescue) and then we tag reports to our error tracking tool (previously bugsnag, now datadog) with the ownership of that exception.

If you wanted to try this approach out, I’d be happy to provide you some support!

Message originally sent by slack user U717X535USA

Oh, nice. Did you find Datadog has analytics etc to make use of that data? I’m not too worried about the Ruby side of things but I want a better process for understanding which parts of the app are generating errors

Message originally sent by slack user U717X535USA

We’re on Rollbar since forever

I think so yes — we don’t use any special features of datadog besides I think basics like tags. That is — you can filter logs/metrics/errors by team pretty easily.

I could try to pull in some of our observability experts if you wanted to have any specific questions answered – not sure how much time they can have for a more in-depth support but I imagine they can help a bit!!

I’d be happy to help walk through the application-side configuration (I.e. I don’t spend a lot of time in our observability tools — I mostly create/maintain the interfaces for our application to allow 3rd party integrations like observability tools to tag API calls with team/package ownership information).

Message originally sent by slack user U70K2MT6OHQ

We use Rollbar with package locations which dictate which Slack channels to route the error to.

Message originally sent by slack user U717X535USA

<@U70K2MT6OHQ> do you map packages to different Rollbar projects? Or is there another way to route those exceptions?

Message originally sent by slack user U717X535USA

Thanks for the offer @AlexEvanczuk. I’m sure they’re busy and I doubt things would map over exactly. I’ll definitely reach out if we start to seriously consider Datadog

Sounds good :+1:

Message originally sent by slack user U70K2MT6OHQ

We only have one project. Within that project’s notification settings we have custom rules based on the stack trace. Then we use the package root as the regex :slightly_smiling_face:

Message originally sent by slack user U717X535USA

Ok, I think I have a workable plan: the code_ownership gem looks useful for turning a backtrace into a team (thanks!), which I can then pass into Rollbar as custom data, and finally I can use the “Path” filter to generate different Slack notifications by querying that team value.

I should even be able to get a stats breakdown by team using their RQL feature

Message originally sent by slack user U70TIGAX94P

Shopify did at some point have something similar to what Alex is describing. Automatically tag exceptions in the Rails app, then route based on tags in the exception tracker.

Message originally sent by slack user U70MEM0MPN4

hi <@U717X535USA> did Rollbar allow you to route to the custom data field?

Message originally sent by slack user U717X535USA

You can created separate Slack integrations based on it. I actually didn’t move much further forward with Rollbar because someone pointed me to AppSignal and their support for namespaces