Skip to content

Rails integration: trace Active Storage events #1558

@georgeclaghorn

Description

@georgeclaghorn

Rails’s Active Storage component generates the following ActiveSupport::Notifications events:

  • service_upload.active_storage
  • service_download.active_storage
  • service_streaming_download.active_storage
  • service_download_chunk.active_storage
  • service_delete.active_storage
  • service_delete_prefixed.active_storage
  • service_exist.active_storage
  • service_url.active_storage
  • service_mirror.active_storage
  • service_update_metadata.active_storage
  • preview.active_storage
  • analyze.active_storage

More on these events is available here. All are worth tracing, except maybe service_url, as they’re likely to be responsible for a significant portion of runtime in transactions where they occur. For example, here’s a request in Sentry where uploading to S3 takes the majority of the total duration but isn’t represented:

Sentry performance tab screenshot

I think this should be relatively straightforward using the existing subscriber system in sentry-rails.

Metadata

Metadata

Assignees

Labels

No labels
No labels
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions