Class: LogStash::Outputs::Application_insights::Notification

Inherits:
Blob
  • Object
show all
Defined in:
lib/logstash/outputs/application_insights/notification.rb

Direct Known Subclasses

Test_notification

Constant Summary

Constants inherited from Blob

Blob::CREATE_EXIST_ERRORS

Instance Attribute Summary

Attributes inherited from Blob

#last_io_exception

Instance Method Summary collapse

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

#notifyObject

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