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.



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

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.



54
55
56
# File 'lib/fluent/plugin/out_sentry.rb', line 54

def environment
  @environment
end

#error_messageObject

Returns the value of attribute error_message.



54
55
56
# File 'lib/fluent/plugin/out_sentry.rb', line 54

def error_message
  @error_message
end

#error_typeObject

Returns the value of attribute error_type.



54
55
56
# File 'lib/fluent/plugin/out_sentry.rb', line 54

def error_type
  @error_type
end

#event_idObject

Returns the value of attribute event_id.



54
55
56
# File 'lib/fluent/plugin/out_sentry.rb', line 54

def event_id
  @event_id
end

#exceptionObject

Returns the value of attribute exception.



54
55
56
# File 'lib/fluent/plugin/out_sentry.rb', line 54

def exception
  @exception
end

#platformObject

Returns the value of attribute platform.



54
55
56
# File 'lib/fluent/plugin/out_sentry.rb', line 54

def platform
  @platform
end

#releaseObject

Returns the value of attribute release.



54
55
56
# File 'lib/fluent/plugin/out_sentry.rb', line 54

def release
  @release
end

#requestObject

Returns the value of attribute request.



54
55
56
# File 'lib/fluent/plugin/out_sentry.rb', line 54

def request
  @request
end

#server_nameObject

Returns the value of attribute server_name.



54
55
56
# File 'lib/fluent/plugin/out_sentry.rb', line 54

def server_name
  @server_name
end

#tagsObject

Returns the value of attribute tags.



54
55
56
# File 'lib/fluent/plugin/out_sentry.rb', line 54

def tags
  @tags
end

#timestampObject

Returns the value of attribute timestamp.



54
55
56
# File 'lib/fluent/plugin/out_sentry.rb', line 54

def timestamp
  @timestamp
end

#transactionObject

Returns the value of attribute transaction.



54
55
56
# File 'lib/fluent/plugin/out_sentry.rb', line 54

def transaction
  @transaction
end

#userObject

Returns the value of attribute user.



54
55
56
# File 'lib/fluent/plugin/out_sentry.rb', line 54

def user
  @user
end

Instance Method Details

#to_json(*_args) ⇒ Object



82
83
84
85
86
87
88
89
# File 'lib/fluent/plugin/out_sentry.rb', line 82

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

  hash.to_json
end