Add AR query time to breadcrumbs

Aperta
#2,283 4 commenti 0 reazioni 1 assegnatario Vedi su GitHub

I maintainer di solito rispondono entro 2 giorni

@sl0thentr0py ci sta già lavorando.

Dal 2/4/2024.

Valutazione

Questa issue non è ancora stata valutata.

Descrizione

Feature Ruby sentry-rails Spans

Describe the idea

We have breadcrumbs with the query like:

{
  name: Employee Pluck,
  sql: SELECT DISTINCT "employees"."person_id" FROM "employees" WHERE "employees"."company_id" IN ('x', 'y', 'z'),
  statement_name: null
}

Would be helpful to have the timing of that query together with the breadcrumb:

{
  name: Employee Pluck,
  sql: SELECT DISTINCT "employees"."person_id" FROM "employees" WHERE "employees"."company_id" IN ('x', 'y', 'z'),
  statement_name: null,
  duration: 5.1234 // ms
}

Why do you think it's beneficial to most of the users

That will help with exceptions that might be caused due to slow endpoints such as graphql timeout middleware, rack-timeout and etc.

Possible implementation

https://github.com/getsentry/sentry-ruby/blob/master/sentry-rails/lib/sentry/rails/breadcrumb/active_support_logger.rb#L14-L18

Could be something like:

crumb = Sentry::Breadcrumb.new(
  data: data,
  category: name,
  timestamp: started.to_i,
  duration: started - finished
)
Lingua principale
Ruby
Stelle
990
Fork
552
Merge medio
2g 16h
PR unite (30g)
29

Preparare l'ambiente

Apri in Codespaces

Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di getsentry/sentry-ruby

Tutte le issue di getsentry/sentry-ruby

Issue simili

Altre issue su Ruby

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.