Add AR query time to breadcrumbs

Offen
#2,283 4 Kommentare 0 Reaktionen 1 zugewiesene Person Auf GitHub ansehen

Maintainer antworten meist innerhalb von 2 Tagen

@sl0thentr0py arbeitet bereits daran.

Seit 02.4.2024.

Bewertung

Dieses Issue wurde noch nicht bewertet.

Beschreibung

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
)
Vorherrschende Sprache
Ruby
Sterne
990
Forks
552
Ø Merge
2 T. 16 Std.
Gemergte PRs (30 T.)
29

Entwicklungsumgebung

In Codespaces öffnen

Startet den Dev-Container des Projekts im Browser, mit Ihrem eigenen GitHub-Konto.

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus getsentry/sentry-ruby

Alle Issues in getsentry/sentry-ruby

Ähnliche Issues

Weitere Issues zu Ruby

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.