ruby-grape / ruby-grape/grape

Sentry transaction name

Open
#2,351 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

question
Dominant language
Ruby
Stars
10k
Forks
1.2k
Avg merge
14h 38m
Merged PRs (30d)
92

Description

Hello! I'm using Grape gem in one of my production apps. This app also uses Sentry for error reporting and performance monitoring. This issue is not strictly tied to grape but - for some reason, Sentry transaction naming works fine for regular rails controllers and actions but not for grape ones. It uses request URL instead. So, for regular rails transactions i'm getting Doorkeeper::TokensController#create while for grape actions, i'm getting /api/v1/records/1 etc. This thing can be configured by using Sentry.configure_scope { |scope| scope.set_transaction_name("MyController#my_action") } before the actual transaction and i was wondering:

Is that possible to access current resource and action names in before filter of my grape api, globally? By globally i mean not separately in each resource but rather in the parent Base < Grape::API class.

Thanks in advance for any clues

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing Grape's global before filter from the Base < Grape::API entry point and checking how the current resource and action are exposed during dispatch. Compare that lifecycle with Sentry's configure_scope transaction naming; done means a confirmed way to set the name globally, or a documented limitation and alternative.

Written by the indexing model from the issue text.

Assessment

Tech stack
ruby
Domain
api
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.