Class: LogStash::Outputs::Application_insights::Notification
- Defined in:
- lib/logstash/outputs/application_insights/notification.rb
Direct Known Subclasses
Constant Summary
Constants inherited from Blob
Instance Attribute Summary
Attributes inherited from Blob
Instance Method Summary collapse
-
#initialize(tuple) ⇒ Notification
constructor
A new instance of Notification.
-
#notify ⇒ Object
must return whether notification was successful or failed.
Methods inherited from Blob
close, #create_container_exist_recovery, #create_exist_recovery, #create_table_exist_recovery, #state_table_delete, #state_table_insert, #state_table_query, #state_table_update, stopped?, #update_commited_or_uncommited_list
Methods inherited from Context
#clear_context, #context_to_table_entity, #context_to_tuple, #table_entity_to_context, #table_entity_to_tuple, #tuple_to_context
Constructor Details
#initialize(tuple) ⇒ Notification
Returns a new instance of Notification.
24 25 26 27 |
# File 'lib/logstash/outputs/application_insights/notification.rb', line 24 def initialize ( tuple ) # super first parameter must be nil. blob first parameter is channel, otherwise it will pass storage_account_name as channel super( tuple ) end |
Instance Method Details
#notify ⇒ Object
must return whether notification was successful or failed
30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/logstash/outputs/application_insights/notification.rb', line 30 def notify @action = :notify @recoverable = [ :notify_failed_blob_not_accessible, :io_failure, :service_unavailable, :notification_process_down ] @force_client = true # to enable get a client even if all storage_accounts marked dead @info = "#{@action} #{@storage_account_name}/#{@container_name}/#{@blob_name}, events: #{@uploaded_events_count}, size: #{@uploaded_bytesize}, blocks: #{@uploaded_block_numbers}, delay: #{Time.now.utc - @oldest_event_time}" success = storage_io_block { submit } if success Telemetry.instance.track_event { { :name => "notified", :properties => context_to_table_entity } } state_table_update else notify_retry_later end success end |