Class: TCellAgent::SensorEvents::AppSensorMetaEvent
- Inherits:
-
AppSensor::MetaData
- Object
- Hash
- TCellSensorEvent
- AppSensor::MetaData
- TCellAgent::SensorEvents::AppSensorMetaEvent
- Defined in:
- lib/tcell_agent/sensor_events/appsensor_meta_event.rb
Instance Attribute Summary collapse
-
#csrf_exception_name ⇒ Object
Returns the value of attribute csrf_exception_name.
-
#database_result_sizes ⇒ Object
Returns the value of attribute database_result_sizes.
-
#location ⇒ Object
Returns the value of attribute location.
-
#path ⇒ Object
Returns the value of attribute path.
-
#request_content_bytes_len ⇒ Object
Returns the value of attribute request_content_bytes_len.
-
#response_code ⇒ Object
Returns the value of attribute response_code.
-
#response_content_bytes_len ⇒ Object
Returns the value of attribute response_content_bytes_len.
-
#response_headers ⇒ Object
Returns the value of attribute response_headers.
-
#sql_exceptions ⇒ Object
Returns the value of attribute sql_exceptions.
-
#user_agent ⇒ Object
Returns the value of attribute user_agent.
Attributes inherited from AppSensor::MetaData
#body_dict, #cookie_dict, #get_dict, #headers_dict, #method, #path_parameters, #post_dict, #remote_address, #route_id, #session_id, #transaction_id, #user_id
Attributes inherited from TCellSensorEvent
Class Method Summary collapse
- .build(request, response_content_length, response_code, response_headers) ⇒ Object
- .build_basic(appsensor_meta) ⇒ Object
Instance Method Summary collapse
- #flattened_post_dict ⇒ Object
-
#initialize(method, remote_address, route_id, session_id, user_id, transaction_id) ⇒ AppSensorMetaEvent
constructor
A new instance of AppSensorMetaEvent.
- #post_process ⇒ Object
Methods inherited from AppSensor::MetaData
#flattened_body_dict, #flattened_cookie_dict, #flattened_get_dict, #flattened_headers_dict, #flattened_path_parameters, #set_body_dict, #set_headers_dict
Methods inherited from TCellSensorEvent
Constructor Details
#initialize(method, remote_address, route_id, session_id, user_id, transaction_id) ⇒ AppSensorMetaEvent
Returns a new instance of AppSensorMetaEvent.
91 92 93 94 95 96 97 |
# File 'lib/tcell_agent/sensor_events/appsensor_meta_event.rb', line 91 def initialize(method, remote_address, route_id, session_id, user_id, transaction_id) super(method, remote_address, route_id, session_id, user_id, transaction_id) @request_content_bytes_len = 0 @response_content_bytes_len = 0 @user_agent = nil end |
Instance Attribute Details
#csrf_exception_name ⇒ Object
Returns the value of attribute csrf_exception_name.
87 88 89 |
# File 'lib/tcell_agent/sensor_events/appsensor_meta_event.rb', line 87 def csrf_exception_name @csrf_exception_name end |
#database_result_sizes ⇒ Object
Returns the value of attribute database_result_sizes.
87 88 89 |
# File 'lib/tcell_agent/sensor_events/appsensor_meta_event.rb', line 87 def database_result_sizes @database_result_sizes end |
#location ⇒ Object
Returns the value of attribute location.
87 88 89 |
# File 'lib/tcell_agent/sensor_events/appsensor_meta_event.rb', line 87 def location @location end |
#path ⇒ Object
Returns the value of attribute path.
87 88 89 |
# File 'lib/tcell_agent/sensor_events/appsensor_meta_event.rb', line 87 def path @path end |
#request_content_bytes_len ⇒ Object
Returns the value of attribute request_content_bytes_len.
87 88 89 |
# File 'lib/tcell_agent/sensor_events/appsensor_meta_event.rb', line 87 def request_content_bytes_len @request_content_bytes_len end |
#response_code ⇒ Object
Returns the value of attribute response_code.
87 88 89 |
# File 'lib/tcell_agent/sensor_events/appsensor_meta_event.rb', line 87 def response_code @response_code end |
#response_content_bytes_len ⇒ Object
Returns the value of attribute response_content_bytes_len.
87 88 89 |
# File 'lib/tcell_agent/sensor_events/appsensor_meta_event.rb', line 87 def response_content_bytes_len @response_content_bytes_len end |
#response_headers ⇒ Object
Returns the value of attribute response_headers.
87 88 89 |
# File 'lib/tcell_agent/sensor_events/appsensor_meta_event.rb', line 87 def response_headers @response_headers end |
#sql_exceptions ⇒ Object
Returns the value of attribute sql_exceptions.
87 88 89 |
# File 'lib/tcell_agent/sensor_events/appsensor_meta_event.rb', line 87 def sql_exceptions @sql_exceptions end |
#user_agent ⇒ Object
Returns the value of attribute user_agent.
87 88 89 |
# File 'lib/tcell_agent/sensor_events/appsensor_meta_event.rb', line 87 def user_agent @user_agent end |
Class Method Details
.build(request, response_content_length, response_code, response_headers) ⇒ Object
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 |
# File 'lib/tcell_agent/sensor_events/appsensor_meta_event.rb', line 23 def build(request, response_content_length, response_code, response_headers) tcell_context = request.env[TCellAgent::Instrumentation::TCELL_ID] = AppSensorMetaEvent.new( request.request_method, TCellAgent::Utils::Rails.better_ip(request), tcell_context.route_id, tcell_context.hmac_session_id, tcell_context.user_id, tcell_context.transaction_id ) .csrf_exception_name = tcell_context.csrf_exception_name .user_agent = request.env['HTTP_USER_AGENT'] .request_content_bytes_len = (request.content_length || 0).to_i .response_content_bytes_len = response_content_length .location = "#{request.base_url}#{request.fullpath}" .path = request.path .get_dict = request.GET . = request. .set_headers_dict(request.env) # don't enqueue parameter values of unknown type to avoid any serialization issues .post_dict = TCellAgent::Utils::Params.flatten(request.POST) .path_parameters = request.env[TCellAgent::Instrumentation::TCELL_ID].path_parameters .response_code = response_code .response_headers = response_headers .sql_exceptions = tcell_context.sql_exceptions .database_result_sizes = tcell_context.database_result_sizes # Positions strio to the beginning of input, resetting lineno to zero. # rails 4.1 seems to read the stringIO directly and so body.gets is empty # this is called request.body.rewind .set_body_dict( .request_content_bytes_len, request.content_type, request.body.gets ) end |
.build_basic(appsensor_meta) ⇒ Object
70 71 72 73 74 75 76 77 78 79 80 81 82 83 |
# File 'lib/tcell_agent/sensor_events/appsensor_meta_event.rb', line 70 def build_basic() = AppSensorMetaEvent.new( .method, .remote_address, .route_id, .session_id, .user_id, .transaction_id ) .location = .location end |
Instance Method Details
#flattened_post_dict ⇒ Object
106 107 108 |
# File 'lib/tcell_agent/sensor_events/appsensor_meta_event.rb', line 106 def flattened_post_dict @post_dict end |
#post_process ⇒ Object
99 100 101 102 103 104 |
# File 'lib/tcell_agent/sensor_events/appsensor_meta_event.rb', line 99 def post_process appsensor_policy = TCellAgent.policy(TCellAgent::PolicyTypes::AppSensor) return unless appsensor_policy appsensor_policy.(self) end |