Class: SentryMessageFormat

Inherits:
Object
  • Object
show all
Defined in:
lib/fluent/plugin/out_sentry.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(timestamp, event_id, component_name, environment, release, tags, request, exception, platform, transaction) ⇒ SentryMessageFormat

Returns a new instance of SentryMessageFormat.



61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
# File 'lib/fluent/plugin/out_sentry.rb', line 61

def initialize(
  timestamp,
  event_id,
  component_name,
  environment,
  release,
  tags,
  request,
  exception,
  platform,
  transaction
)
  @event_id = event_id
  @timestamp = timestamp
  @server_name = component_name
  @environment = environment
  @release = release
  @tags = tags
  @request = request
  @platform = platform
  @transaction = transaction
  self.exception = SentryException.new(exception)
end

Instance Attribute Details

#environmentObject

Returns the value of attribute environment.



57
58
59
# File 'lib/fluent/plugin/out_sentry.rb', line 57

def environment
  @environment
end

#error_messageObject

Returns the value of attribute error_message.



57
58
59
# File 'lib/fluent/plugin/out_sentry.rb', line 57

def error_message
  @error_message
end

#error_typeObject

Returns the value of attribute error_type.



57
58
59
# File 'lib/fluent/plugin/out_sentry.rb', line 57

def error_type
  @error_type
end

#event_idObject

Returns the value of attribute event_id.



57
58
59
# File 'lib/fluent/plugin/out_sentry.rb', line 57

def event_id
  @event_id
end

#exceptionObject

Returns the value of attribute exception.



57
58
59
# File 'lib/fluent/plugin/out_sentry.rb', line 57

def exception
  @exception
end

#platformObject

Returns the value of attribute platform.



57
58
59
# File 'lib/fluent/plugin/out_sentry.rb', line 57

def platform
  @platform
end

#releaseObject

Returns the value of attribute release.



57
58
59
# File 'lib/fluent/plugin/out_sentry.rb', line 57

def release
  @release
end

#requestObject

Returns the value of attribute request.



57
58
59
# File 'lib/fluent/plugin/out_sentry.rb', line 57

def request
  @request
end

#server_nameObject

Returns the value of attribute server_name.



57
58
59
# File 'lib/fluent/plugin/out_sentry.rb', line 57

def server_name
  @server_name
end

#tagsObject

Returns the value of attribute tags.



57
58
59
# File 'lib/fluent/plugin/out_sentry.rb', line 57

def tags
  @tags
end

#timestampObject

Returns the value of attribute timestamp.



57
58
59
# File 'lib/fluent/plugin/out_sentry.rb', line 57

def timestamp
  @timestamp
end

#transactionObject

Returns the value of attribute transaction.



57
58
59
# File 'lib/fluent/plugin/out_sentry.rb', line 57

def transaction
  @transaction
end

#userObject

Returns the value of attribute user.



57
58
59
# File 'lib/fluent/plugin/out_sentry.rb', line 57

def user
  @user
end

Instance Method Details

#to_json(*_args) ⇒ Object



85
86
87
88
89
90
91
92
# File 'lib/fluent/plugin/out_sentry.rb', line 85

def to_json(*_args)
  hash = {}
  instance_variables.each do |var|
    hash[var.to_s.delete '@'] = instance_variable_get var
  end

  hash.to_json
end