Module: Rails::Instrumentation::ActiveStorageSubscriber
- Includes:
- Subscriber
- Defined in:
- lib/rails/instrumentation/subscribers/active_storage_subscriber.rb
Constant Summary collapse
- EVENT_NAMESPACE =
'active_storage'.freeze
- EVENTS =
%w[ service_upload service_streaming_download service_download service_delete service_delete_prefixed service_exist service_url ].freeze
- BASE_TAGS =
rubocop:disable Style/MutableConstant
{ 'component' => 'ActiveStorage' }
Class Method Summary collapse
- .service_delete(event) ⇒ Object
- .service_delete_prefixed(event) ⇒ Object
- .service_download(event) ⇒ Object
- .service_exist(event) ⇒ Object
- .service_streaming_download(event) ⇒ Object
- .service_upload(event) ⇒ Object
- .service_url(event) ⇒ Object
Methods included from Subscriber
Class Method Details
.service_delete(event) ⇒ Object
51 52 53 54 55 56 57 58 |
# File 'lib/rails/instrumentation/subscribers/active_storage_subscriber.rb', line 51 def service_delete(event) = ( 'key' => event.payload[:key], 'service' => event.payload[:service] ) Utils.trace_notification(event: event, tags: ) end |
.service_delete_prefixed(event) ⇒ Object
60 61 62 63 64 65 66 67 |
# File 'lib/rails/instrumentation/subscribers/active_storage_subscriber.rb', line 60 def service_delete_prefixed(event) = ( 'key.prefix' => event.payload[:prefix], 'service' => event.payload[:service] ) Utils.trace_notification(event: event, tags: ) end |
.service_download(event) ⇒ Object
42 43 44 45 46 47 48 49 |
# File 'lib/rails/instrumentation/subscribers/active_storage_subscriber.rb', line 42 def service_download(event) = ( 'key' => event.payload[:key], 'service' => event.payload[:service] ) Utils.trace_notification(event: event, tags: ) end |
.service_exist(event) ⇒ Object
69 70 71 72 73 74 75 76 77 |
# File 'lib/rails/instrumentation/subscribers/active_storage_subscriber.rb', line 69 def service_exist(event) = ( 'key' => event.payload[:key], 'service' => event.payload[:service], 'exist' => event.payload[:exist] ) Utils.trace_notification(event: event, tags: ) end |
.service_streaming_download(event) ⇒ Object
33 34 35 36 37 38 39 40 |
# File 'lib/rails/instrumentation/subscribers/active_storage_subscriber.rb', line 33 def service_streaming_download(event) = ( 'key' => event.payload[:key], 'service' => event.payload[:service] ) Utils.trace_notification(event: event, tags: ) end |
.service_upload(event) ⇒ Object
23 24 25 26 27 28 29 30 31 |
# File 'lib/rails/instrumentation/subscribers/active_storage_subscriber.rb', line 23 def service_upload(event) = ( 'key' => event.payload[:key], 'service' => event.payload[:service], 'checksum' => event.payload[:checksum] ) Utils.trace_notification(event: event, tags: ) end |
.service_url(event) ⇒ Object
79 80 81 82 83 84 85 86 87 |
# File 'lib/rails/instrumentation/subscribers/active_storage_subscriber.rb', line 79 def service_url(event) = ( 'key' => event.payload[:key], 'service' => event.payload[:service], 'url' => event.payload[:url] # generated url, not accessed url ) Utils.trace_notification(event: event, tags: ) end |