dev2func-rails 0.0.10

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: cb1550bde931ca6ccc52392fd94b651141912e5692229a7dbb3e1f9dc9c38fd6
4
+ data.tar.gz: 12d071cd8bae7d54024717e31150f748a6ec1b5515d546cb475adc650f2f738f
5
+ SHA512:
6
+ metadata.gz: f1523813502912601c0950b7d67cf319d2d1501989d438bde8faecbb575a25c715d1bbb1fda73a20778b3988f7f8a6af51907ea8fa303a6108a1d9e4fbfa2568
7
+ data.tar.gz: 4e9553a189b9ac42ef49bf34f3f84eb3c61e2cc3a130c3d8a67c0b25a0a5a6a0d01b5fa520b3c7f4422c0bb143b187da0ef66daf9f259c826be3c6c9cf53d603
data/CHANGELOG.md ADDED
@@ -0,0 +1,5 @@
1
+ ## [Unreleased]
2
+
3
+ ## [0.1.0] - 2022-06-06
4
+
5
+ - Initial release
data/Gemfile ADDED
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ source "https://rubygems.org"
4
+
5
+ # Specify your gem's dependencies in dev2func-rails.gemspec
6
+ gemspec
7
+
8
+ gem "rake", "~> 13.0"
9
+
10
+ gem "minitest", "~> 5.0"
11
+
12
+ gem "standard", "~> 1.3"
13
+
14
+ gem "faraday"
15
+ gem 'rexml'
data/README.md ADDED
@@ -0,0 +1,39 @@
1
+ # Dev2func::Rails
2
+
3
+ Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/dev2func/rails`. To experiment with that code, run `bin/console` for an interactive prompt.
4
+
5
+ TODO: Delete this and the text above, and describe your gem
6
+
7
+ ## Installation
8
+
9
+ Add this line to your application's Gemfile:
10
+
11
+ ```ruby
12
+ gem 'dev2func-rails'
13
+ ```
14
+
15
+ And then execute:
16
+
17
+ $ bundle install
18
+
19
+ Or install it yourself as:
20
+
21
+ $ gem install dev2func-rails
22
+
23
+ ## Usage
24
+
25
+ TODO: Write usage instructions here
26
+
27
+ ## Development
28
+
29
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
30
+
31
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
32
+
33
+ ## Contributing
34
+
35
+ Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/dev2func-rails.
36
+
37
+ ## License
38
+
39
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
data/Rakefile ADDED
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "bundler/gem_tasks"
4
+ require "rake/testtask"
5
+
6
+ Rake::TestTask.new(:test) do |t|
7
+ t.libs << "test"
8
+ t.libs << "lib"
9
+ t.test_files = FileList["test/**/test_*.rb"]
10
+ end
11
+
12
+ require "standard/rake"
13
+
14
+ task default: %i[test standard]
@@ -0,0 +1,39 @@
1
+ module Dev2func
2
+ # The configuration class.
3
+ # Setup caller environment as part of initialisation
4
+ class Configuration
5
+ attr_accessor :project_token,
6
+ :code_version,
7
+ :user_ip,
8
+ :endpoint,
9
+ :environment,
10
+ :filepath,
11
+ :framework,
12
+ :host,
13
+ :default_logger,
14
+ :root,
15
+ :platform_detail
16
+
17
+ def initialize
18
+ yield self
19
+ setup_platform_details
20
+ end
21
+
22
+ private
23
+
24
+ def setup_platform_details
25
+ self.platform_detail = {
26
+ default_logger: proc { ::Rails.logger },
27
+ environment: ::Rails.env,
28
+ root: ::Rails.root,
29
+ framework: "Rails: #{::Rails::VERSION::STRING}",
30
+ ruby_version: RUBY_VERSION,
31
+ os: RUBY_PLATFORM,
32
+ os_name: RUBY_VERSION, # Need a way to get os name
33
+ runtime: RUBY_DESCRIPTION,
34
+ engine: "#{RUBY_ENGINE} #{RUBY_ENGINE_VERSION}"
35
+ }
36
+ end
37
+ end
38
+
39
+ end
@@ -0,0 +1,14 @@
1
+ require 'dev2func/configuration'
2
+
3
+ module Dev2func
4
+ class Container
5
+ attr_accessor :configuration, :stream
6
+
7
+ # Adding application error or exception
8
+ def add_stream(stream)
9
+ self.stream = stream
10
+ end
11
+
12
+ end
13
+
14
+ end
@@ -0,0 +1,24 @@
1
+ module Dev2func
2
+ class Stream
3
+ attr_accessor :error_code,
4
+ :content_type,
5
+ :content_detail
6
+
7
+ def self.parse(content)
8
+ # {"Content-Type"=>"text/html; charset=UTF-8", "Content-Length"=>"103534"}
9
+ # Rails.logger.info "[Dev2func] #{content[0]}"
10
+ # print(content[0].to_i)
11
+ # print("1) #{Rack::Utils::HTTP_STATUS_CODES["200"].to_i}")
12
+ # print("2) #{Rack::Utils::HTTP_STATUS_CODES["200"]}")
13
+ # print(content[0].to_i != Rack::Utils::HTTP_STATUS_CODES["200"].to_i)
14
+ if content[0].to_i != 200
15
+ Rails.logger.info "[Dev2func] Preparing ingredients"
16
+ error_code = content[0]
17
+ content_type = content[1]
18
+ content_detail = JSON.parse(content[2].first)
19
+ else
20
+ return
21
+ end
22
+ end
23
+ end
24
+ end
@@ -0,0 +1,13 @@
1
+ require 'rails/railtie'
2
+
3
+ module Dev2func
4
+
5
+ class Railtie < ::Rails::Railtie
6
+ extend ActiveSupport::Concern
7
+
8
+ initializer "dev2func.use_rack_middleware" do |app|
9
+ app.config.middleware.insert_after ActionDispatch::ShowExceptions, Dev2func::WatchDog
10
+ end
11
+
12
+ end
13
+ end
@@ -0,0 +1,30 @@
1
+ require 'dev2func/sherif'
2
+ require 'dev2func/services/xray'
3
+
4
+ module Dev2func
5
+ # module Rack
6
+ class WatchDog
7
+ def initialize(app)
8
+ @app = app
9
+ end
10
+
11
+ def call(env)
12
+ Rails.logger.info "[Dev2func] Capture exception from caller"
13
+ begin
14
+
15
+ # Xray.new.scan(env)
16
+
17
+ response = @app.call(env)
18
+ # At the moment only useful for backend exception
19
+ Sherif.new.xray(response, env)
20
+
21
+
22
+ response
23
+ rescue Exception => e
24
+ Rails.logger.info "[Dev2Func] Exception #{e.message}"
25
+ exception_message = e.message if e.respond_to?(:message)
26
+ exception_message ||= 'No Exception Message'
27
+ end
28
+ end
29
+ end
30
+ end
@@ -0,0 +1,7 @@
1
+ module Dev2func
2
+ module Rails
3
+ # class Error < StandardError; end
4
+ # # Your code goes here...module Rails
5
+
6
+ end
7
+ end
@@ -0,0 +1,38 @@
1
+ require 'dev2func/models/stream'
2
+
3
+ module Dev2func
4
+ class Xray
5
+
6
+ def scan(env)
7
+ request = fetch_request_data(env)
8
+
9
+ end
10
+
11
+ def fetch_request_data(env)
12
+ rack_req = ::Rack::Request.new(env)
13
+ action_dispatch_params = fetch_action_dispatch_params(env)
14
+ end
15
+
16
+ def fetch_action_dispatch_params(env)
17
+ Array(env['action_dispatch.parameter_filter'])
18
+ end
19
+
20
+ def xray(stream, env)
21
+ # Need to make sure content inside container ready to use
22
+ _stream = Stream.parse(stream)
23
+ ship_the_container(add_stream_to_container(_stream))
24
+ end
25
+
26
+ def add_stream_to_container(_stream)
27
+ Dev2func.container.add_stream(_stream)
28
+ return Dev2func.container
29
+ end
30
+
31
+ def ship_the_container(container)
32
+ Dev2func.shipper.shipped(container)
33
+ end
34
+
35
+ end
36
+
37
+ end
38
+
@@ -0,0 +1,39 @@
1
+ require 'dev2func/models/stream'
2
+ require 'dev2func/services/xray'
3
+
4
+ module Dev2func
5
+ class Sherif
6
+
7
+ # def xray(env)
8
+ # request = proc { build_request_data(env) }
9
+ # end
10
+
11
+ def build_request_data(env)
12
+ rack_req = ::Rack::Request.new(env)
13
+ sensitive_params = sensitive_params_list(env)
14
+ end
15
+
16
+ def sensitive_params_list(env)
17
+ Array(env['action_dispatch.parameter_filter'])
18
+ end
19
+
20
+ def xray(stream, env)
21
+ # Need to make sure content inside container ready to use
22
+ _stream = Stream.parse(stream)
23
+ # print(">>>>> #{_stream}")
24
+ ship_the_container(add_stream_to_container(_stream)) unless _stream.blank?
25
+ end
26
+
27
+ def add_stream_to_container(_stream)
28
+ Dev2func.container.add_stream(_stream)
29
+ return Dev2func.container
30
+ end
31
+
32
+ def ship_the_container(container)
33
+ Dev2func.shipper.shipped(container)
34
+ end
35
+
36
+ end
37
+
38
+ end
39
+
@@ -0,0 +1,218 @@
1
+ require 'dev2func/container'
2
+ require 'faraday'
3
+
4
+ module Dev2func
5
+ class Shipper
6
+ attr_accessor :container, :faraday, :stream, :configuration
7
+
8
+ DEFAULT_DOMAIN = 'http://localhost:8080'.freeze
9
+ DEFAULT_ENDPOINT = '/api/v1/streams'.freeze
10
+ DEFAULT_WEB_BASE = 'https://dev2func.com'.freeze
11
+
12
+ def initialize
13
+ self.faraday = Faraday.new(
14
+ url: DEFAULT_DOMAIN,
15
+ headers: { 'Content-Type' => 'application/json' }
16
+ )
17
+ end
18
+
19
+ # Sending stream to Dev2func API
20
+ def shipped(container)
21
+ Rails.logger.info "[Dev2func] Ready to ship the container"
22
+ self.container = container
23
+ self.stream = self.container.stream
24
+ self.configuration = self.container.configuration
25
+
26
+ Rails.logger.info "[Dev2func] Stream content: #{self.stream}"
27
+ Rails.logger.info "[Dev2func] Container content: #{self.configuration.project_token}"
28
+
29
+ response = self.faraday.post("#{DEFAULT_WEB_BASE}#{DEFAULT_ENDPOINT}") do |req|
30
+ req.body = JSON.generate(
31
+ ruby_version: self.configuration.platform_detail['ruby_version'],
32
+ status: self.stream['status'].to_s,
33
+ error_type: "internal server error", #internal server error, etc..
34
+ exception_type: self.stream['exception'], # #<StandardError: StandardError>, etc..",
35
+ stream_type: 'errors', # info,errors,warning
36
+ event: self.stream['traces']['Application Trace'].first['trace'],
37
+ projects: {
38
+ project_token: self.configuration.project_token
39
+ },
40
+ # _backtrace = []
41
+ # self.stream['traces']['Framework Trace'].each do |ft|
42
+ # _backtrace << ft["trace"]
43
+ # end
44
+ backtrace: self.stream['traces']['Framework Trace'].to_s,
45
+ platform_detail: self.configuration.platform_detail.to_s
46
+ )
47
+ end
48
+
49
+ Rails.logger.info "status: #{response.status}"
50
+ Rails.logger.info "body: #{response.body}"
51
+ Rails.logger.info "[Dev2func] Success sending container"
52
+ end
53
+
54
+ end
55
+
56
+ end
57
+
58
+ # (ruby) content[0]
59
+ # 500
60
+ #
61
+ # (ruby) content[1]
62
+ # {"Content-Type"=>"application/json; charset=UTF-8", "Content-Length"=>"17464"}
63
+ #
64
+ # (ruby) content[2].count
65
+ # 1
66
+ # (ruby) JSON.parse content[2].first
67
+ # {"status"=>500,
68
+ # "error"=>"Internal Server Error",
69
+ # "exception"=>"#<RuntimeError: This is an exception>",
70
+ # "traces"=>
71
+ # {"Application Trace"=>[{"exception_object_id"=>74220, "id"=>0, "trace"=>"app/controllers/api/v1/registrations_controller.rb:6:in `abc'"}],
72
+ # "Framework Trace"=>
73
+ # [{"exception_object_id"=>74220, "id"=>1, "trace"=>"actionpack (7.0.3) lib/action_controller/metal/basic_implicit_render.rb:6:in `send_action'"},
74
+ # {"exception_object_id"=>74220, "id"=>2, "trace"=>"actionpack (7.0.3) lib/abstract_controller/base.rb:215:in `process_action'"},
75
+ # {"exception_object_id"=>74220, "id"=>3, "trace"=>"actionpack (7.0.3) lib/action_controller/metal/rendering.rb:53:in `process_action'"},
76
+ # {"exception_object_id"=>74220, "id"=>4, "trace"=>"actionpack (7.0.3) lib/abstract_controller/callbacks.rb:234:in `block in process_action'"},
77
+ # {"exception_object_id"=>74220, "id"=>5, "trace"=>"activesupport (7.0.3) lib/active_support/callbacks.rb:99:in `run_callbacks'"},
78
+ # {"exception_object_id"=>74220, "id"=>6, "trace"=>"actionpack (7.0.3) lib/abstract_controller/callbacks.rb:233:in `process_action'"},
79
+ # {"exception_object_id"=>74220, "id"=>7, "trace"=>"actionpack (7.0.3) lib/action_controller/metal/rescue.rb:22:in `process_action'"},
80
+ # {"exception_object_id"=>74220, "id"=>8, "trace"=>"actionpack (7.0.3) lib/action_controller/metal/instrumentation.rb:67:in `block in process_action'"},
81
+ # {"exception_object_id"=>74220, "id"=>9, "trace"=>"activesupport (7.0.3) lib/active_support/notifications.rb:206:in `block in instrument'"},
82
+ # {"exception_object_id"=>74220, "id"=>10, "trace"=>"activesupport (7.0.3) lib/active_support/notifications/instrumenter.rb:24:in `instrument'"},
83
+ # {"exception_object_id"=>74220, "id"=>11, "trace"=>"activesupport (7.0.3) lib/active_support/notifications.rb:206:in `instrument'"},
84
+ # {"exception_object_id"=>74220, "id"=>12, "trace"=>"actionpack (7.0.3) lib/action_controller/metal/instrumentation.rb:66:in `process_action'"},
85
+ # {"exception_object_id"=>74220, "id"=>13, "trace"=>"actionpack (7.0.3) lib/action_controller/metal/params_wrapper.rb:259:in `process_action'"},
86
+ # {"exception_object_id"=>74220, "id"=>14, "trace"=>"activerecord (7.0.3) lib/active_record/railties/controller_runtime.rb:27:in `process_action'"},
87
+ # {"exception_object_id"=>74220, "id"=>15, "trace"=>"actionpack (7.0.3) lib/abstract_controller/base.rb:151:in `process'"},
88
+ # {"exception_object_id"=>74220, "id"=>16, "trace"=>"actionview (7.0.3) lib/action_view/rendering.rb:39:in `process'"},
89
+ # {"exception_object_id"=>74220, "id"=>17, "trace"=>"actionpack (7.0.3) lib/action_controller/metal.rb:188:in `dispatch'"},
90
+ # {"exception_object_id"=>74220, "id"=>18, "trace"=>"actionpack (7.0.3) lib/action_controller/metal.rb:251:in `dispatch'"},
91
+ # {"exception_object_id"=>74220, "id"=>19, "trace"=>"actionpack (7.0.3) lib/action_dispatch/routing/route_set.rb:49:in `dispatch'"},
92
+ # {"exception_object_id"=>74220, "id"=>20, "trace"=>"actionpack (7.0.3) lib/action_dispatch/routing/route_set.rb:32:in `serve'"},
93
+ # {"exception_object_id"=>74220, "id"=>21, "trace"=>"actionpack (7.0.3) lib/action_dispatch/journey/router.rb:50:in `block in serve'"},
94
+ # {"exception_object_id"=>74220, "id"=>22, "trace"=>"actionpack (7.0.3) lib/action_dispatch/journey/router.rb:32:in `each'"},
95
+ # {"exception_object_id"=>74220, "id"=>23, "trace"=>"actionpack (7.0.3) lib/action_dispatch/journey/router.rb:32:in `serve'"},
96
+ # {"exception_object_id"=>74220, "id"=>24, "trace"=>"actionpack (7.0.3) lib/action_dispatch/routing/route_set.rb:852:in `call'"},
97
+ # {"exception_object_id"=>74220, "id"=>25, "trace"=>"rack (2.2.4) lib/rack/tempfile_reaper.rb:15:in `call'"},
98
+ # {"exception_object_id"=>74220, "id"=>26, "trace"=>"rack (2.2.4) lib/rack/etag.rb:27:in `call'"},
99
+ # {"exception_object_id"=>74220, "id"=>27, "trace"=>"rack (2.2.4) lib/rack/conditional_get.rb:27:in `call'"},
100
+ # {"exception_object_id"=>74220, "id"=>28, "trace"=>"rack (2.2.4) lib/rack/head.rb:12:in `call'"},
101
+ # {"exception_object_id"=>74220, "id"=>29, "trace"=>"actionpack (7.0.3) lib/action_dispatch/http/permissions_policy.rb:38:in `call'"},
102
+ # {"exception_object_id"=>74220, "id"=>30, "trace"=>"actionpack (7.0.3) lib/action_dispatch/http/content_security_policy.rb:36:in `call'"},
103
+ # {"exception_object_id"=>74220, "id"=>31, "trace"=>"rack (2.2.4) lib/rack/session/abstract/id.rb:266:in `context'"},
104
+ # {"exception_object_id"=>74220, "id"=>32, "trace"=>"rack (2.2.4) lib/rack/session/abstract/id.rb:260:in `call'"},
105
+ # {"exception_object_id"=>74220, "id"=>33, "trace"=>"actionpack (7.0.3) lib/action_dispatch/middleware/cookies.rb:697:in `call'"},
106
+ # {"exception_object_id"=>74220, "id"=>34, "trace"=>"activerecord (7.0.3) lib/active_record/migration.rb:603:in `call'"},
107
+ # {"exception_object_id"=>74220, "id"=>35, "trace"=>"actionpack (7.0.3) lib/action_dispatch/middleware/callbacks.rb:27:in `block in call'"},
108
+ # {"exception_object_id"=>74220, "id"=>36, "trace"=>"activesupport (7.0.3) lib/active_support/callbacks.rb:99:in `run_callbacks'"},
109
+ # {"exception_object_id"=>74220, "id"=>37, "trace"=>"actionpack (7.0.3) lib/action_dispatch/middleware/callbacks.rb:26:in `call'"},
110
+ # {"exception_object_id"=>74220, "id"=>38, "trace"=>"actionpack (7.0.3) lib/action_dispatch/middleware/executor.rb:14:in `call'"},
111
+ # {"exception_object_id"=>74220, "id"=>39, "trace"=>"actionpack (7.0.3) lib/action_dispatch/middleware/actionable_exceptions.rb:17:in `call'"},
112
+ # {"exception_object_id"=>74220, "id"=>40, "trace"=>"/Users/fheswara/Documents/Dev2func/rollbar-gem/lib/rollbar/middleware/rails/rollbar.rb:25:in `block in call'"},
113
+ # {"exception_object_id"=>74220, "id"=>41, "trace"=>"/Users/fheswara/Documents/Dev2func/rollbar-gem/lib/rollbar.rb:147:in `scoped'"},
114
+ # {"exception_object_id"=>74220, "id"=>42, "trace"=>"/Users/fheswara/Documents/Dev2func/rollbar-gem/lib/rollbar/middleware/rails/rollbar.rb:22:in `call'"},
115
+ # {"exception_object_id"=>74220, "id"=>43, "trace"=>"actionpack (7.0.3) lib/action_dispatch/middleware/debug_exceptions.rb:28:in `call'"},
116
+ # {"exception_object_id"=>74220,
117
+ # "id"=>44,
118
+ # "trace"=>"/Users/fheswara/Documents/Dev2func/rollbar-gem/lib/rollbar/middleware/rails/show_exceptions.rb:22:in `call_with_rollbar'"},
119
+ # {"exception_object_id"=>74220, "id"=>45, "trace"=>"/Users/fheswara/Documents/Dev2func/dev2func-rails/lib/dev2func/rails/watch_dog.rb:14:in `call'"},
120
+ # {"exception_object_id"=>74220, "id"=>46, "trace"=>"actionpack (7.0.3) lib/action_dispatch/middleware/show_exceptions.rb:26:in `call'"},
121
+ # {"exception_object_id"=>74220, "id"=>47, "trace"=>"railties (7.0.3) lib/rails/rack/logger.rb:40:in `call_app'"},
122
+ # {"exception_object_id"=>74220, "id"=>48, "trace"=>"railties (7.0.3) lib/rails/rack/logger.rb:25:in `block in call'"},
123
+ # {"exception_object_id"=>74220, "id"=>49, "trace"=>"activesupport (7.0.3) lib/active_support/tagged_logging.rb:114:in `block in tagged'"},
124
+ # {"exception_object_id"=>74220, "id"=>50, "trace"=>"activesupport (7.0.3) lib/active_support/tagged_logging.rb:38:in `tagged'"},
125
+ # {"exception_object_id"=>74220, "id"=>51, "trace"=>"activesupport (7.0.3) lib/active_support/tagged_logging.rb:114:in `tagged'"},
126
+ # {"exception_object_id"=>74220, "id"=>52, "trace"=>"railties (7.0.3) lib/rails/rack/logger.rb:25:in `call'"},
127
+ # {"exception_object_id"=>74220, "id"=>53, "trace"=>"actionpack (7.0.3) lib/action_dispatch/middleware/remote_ip.rb:93:in `call'"},
128
+ # {"exception_object_id"=>74220, "id"=>54, "trace"=>"actionpack (7.0.3) lib/action_dispatch/middleware/request_id.rb:26:in `call'"},
129
+ # {"exception_object_id"=>74220, "id"=>55, "trace"=>"rack (2.2.4) lib/rack/method_override.rb:24:in `call'"},
130
+ # {"exception_object_id"=>74220, "id"=>56, "trace"=>"rack (2.2.4) lib/rack/runtime.rb:22:in `call'"},
131
+ # {"exception_object_id"=>74220, "id"=>57, "trace"=>"activesupport (7.0.3) lib/active_support/cache/strategy/local_cache_middleware.rb:29:in `call'"},
132
+ # {"exception_object_id"=>74220, "id"=>58, "trace"=>"actionpack (7.0.3) lib/action_dispatch/middleware/server_timing.rb:20:in `call'"},
133
+ # {"exception_object_id"=>74220, "id"=>59, "trace"=>"actionpack (7.0.3) lib/action_dispatch/middleware/executor.rb:14:in `call'"},
134
+ # {"exception_object_id"=>74220, "id"=>60, "trace"=>"actionpack (7.0.3) lib/action_dispatch/middleware/static.rb:23:in `call'"},
135
+ # {"exception_object_id"=>74220, "id"=>61, "trace"=>"rack (2.2.4) lib/rack/sendfile.rb:110:in `call'"},
136
+ # {"exception_object_id"=>74220, "id"=>62, "trace"=>"actionpack (7.0.3) lib/action_dispatch/middleware/host_authorization.rb:137:in `call'"},
137
+ # {"exception_object_id"=>74220, "id"=>63, "trace"=>"rack-cors (1.1.1) lib/rack/cors.rb:100:in `call'"},
138
+ # {"exception_object_id"=>74220, "id"=>64, "trace"=>"railties (7.0.3) lib/rails/engine.rb:530:in `call'"},
139
+ # {"exception_object_id"=>74220, "id"=>65, "trace"=>"puma (5.6.4) lib/puma/configuration.rb:252:in `call'"},
140
+ # {"exception_object_id"=>74220, "id"=>66, "trace"=>"puma (5.6.4) lib/puma/request.rb:77:in `block in handle_request'"},
141
+ # {"exception_object_id"=>74220, "id"=>67, "trace"=>"puma (5.6.4) lib/puma/thread_pool.rb:340:in `with_force_shutdown'"},
142
+ # {"exception_object_id"=>74220, "id"=>68, "trace"=>"puma (5.6.4) lib/puma/request.rb:76:in `handle_request'"},
143
+ # {"exception_object_id"=>74220, "id"=>69, "trace"=>"puma (5.6.4) lib/puma/server.rb:441:in `process_client'"},
144
+ # {"exception_object_id"=>74220, "id"=>70, "trace"=>"puma (5.6.4) lib/puma/thread_pool.rb:147:in `block in spawn_thread'"}],
145
+ # "Full Trace"=>
146
+ # [{"exception_object_id"=>74220, "id"=>0, "trace"=>"app/controllers/api/v1/registrations_controller.rb:6:in `abc'"},
147
+ # {"exception_object_id"=>74220, "id"=>1, "trace"=>"actionpack (7.0.3) lib/action_controller/metal/basic_implicit_render.rb:6:in `send_action'"},
148
+ # {"exception_object_id"=>74220, "id"=>2, "trace"=>"actionpack (7.0.3) lib/abstract_controller/base.rb:215:in `process_action'"},
149
+ # {"exception_object_id"=>74220, "id"=>3, "trace"=>"actionpack (7.0.3) lib/action_controller/metal/rendering.rb:53:in `process_action'"},
150
+ # {"exception_object_id"=>74220, "id"=>4, "trace"=>"actionpack (7.0.3) lib/abstract_controller/callbacks.rb:234:in `block in process_action'"},
151
+ # {"exception_object_id"=>74220, "id"=>5, "trace"=>"activesupport (7.0.3) lib/active_support/callbacks.rb:99:in `run_callbacks'"},
152
+ # {"exception_object_id"=>74220, "id"=>6, "trace"=>"actionpack (7.0.3) lib/abstract_controller/callbacks.rb:233:in `process_action'"},
153
+ # {"exception_object_id"=>74220, "id"=>7, "trace"=>"actionpack (7.0.3) lib/action_controller/metal/rescue.rb:22:in `process_action'"},
154
+ # {"exception_object_id"=>74220, "id"=>8, "trace"=>"actionpack (7.0.3) lib/action_controller/metal/instrumentation.rb:67:in `block in process_action'"},
155
+ # {"exception_object_id"=>74220, "id"=>9, "trace"=>"activesupport (7.0.3) lib/active_support/notifications.rb:206:in `block in instrument'"},
156
+ # {"exception_object_id"=>74220, "id"=>10, "trace"=>"activesupport (7.0.3) lib/active_support/notifications/instrumenter.rb:24:in `instrument'"},
157
+ # {"exception_object_id"=>74220, "id"=>11, "trace"=>"activesupport (7.0.3) lib/active_support/notifications.rb:206:in `instrument'"},
158
+ # {"exception_object_id"=>74220, "id"=>12, "trace"=>"actionpack (7.0.3) lib/action_controller/metal/instrumentation.rb:66:in `process_action'"},
159
+ # {"exception_object_id"=>74220, "id"=>13, "trace"=>"actionpack (7.0.3) lib/action_controller/metal/params_wrapper.rb:259:in `process_action'"},
160
+ # {"exception_object_id"=>74220, "id"=>14, "trace"=>"activerecord (7.0.3) lib/active_record/railties/controller_runtime.rb:27:in `process_action'"},
161
+ # {"exception_object_id"=>74220, "id"=>15, "trace"=>"actionpack (7.0.3) lib/abstract_controller/base.rb:151:in `process'"},
162
+ # {"exception_object_id"=>74220, "id"=>16, "trace"=>"actionview (7.0.3) lib/action_view/rendering.rb:39:in `process'"},
163
+ # {"exception_object_id"=>74220, "id"=>17, "trace"=>"actionpack (7.0.3) lib/action_controller/metal.rb:188:in `dispatch'"},
164
+ # {"exception_object_id"=>74220, "id"=>18, "trace"=>"actionpack (7.0.3) lib/action_controller/metal.rb:251:in `dispatch'"},
165
+ # {"exception_object_id"=>74220, "id"=>19, "trace"=>"actionpack (7.0.3) lib/action_dispatch/routing/route_set.rb:49:in `dispatch'"},
166
+ # {"exception_object_id"=>74220, "id"=>20, "trace"=>"actionpack (7.0.3) lib/action_dispatch/routing/route_set.rb:32:in `serve'"},
167
+ # {"exception_object_id"=>74220, "id"=>21, "trace"=>"actionpack (7.0.3) lib/action_dispatch/journey/router.rb:50:in `block in serve'"},
168
+ # {"exception_object_id"=>74220, "id"=>22, "trace"=>"actionpack (7.0.3) lib/action_dispatch/journey/router.rb:32:in `each'"},
169
+ # {"exception_object_id"=>74220, "id"=>23, "trace"=>"actionpack (7.0.3) lib/action_dispatch/journey/router.rb:32:in `serve'"},
170
+ # {"exception_object_id"=>74220, "id"=>24, "trace"=>"actionpack (7.0.3) lib/action_dispatch/routing/route_set.rb:852:in `call'"},
171
+ # {"exception_object_id"=>74220, "id"=>25, "trace"=>"rack (2.2.4) lib/rack/tempfile_reaper.rb:15:in `call'"},
172
+ # {"exception_object_id"=>74220, "id"=>26, "trace"=>"rack (2.2.4) lib/rack/etag.rb:27:in `call'"},
173
+ # {"exception_object_id"=>74220, "id"=>27, "trace"=>"rack (2.2.4) lib/rack/conditional_get.rb:27:in `call'"},
174
+ # {"exception_object_id"=>74220, "id"=>28, "trace"=>"rack (2.2.4) lib/rack/head.rb:12:in `call'"},
175
+ # {"exception_object_id"=>74220, "id"=>29, "trace"=>"actionpack (7.0.3) lib/action_dispatch/http/permissions_policy.rb:38:in `call'"},
176
+ # {"exception_object_id"=>74220, "id"=>30, "trace"=>"actionpack (7.0.3) lib/action_dispatch/http/content_security_policy.rb:36:in `call'"},
177
+ # {"exception_object_id"=>74220, "id"=>31, "trace"=>"rack (2.2.4) lib/rack/session/abstract/id.rb:266:in `context'"},
178
+ # {"exception_object_id"=>74220, "id"=>32, "trace"=>"rack (2.2.4) lib/rack/session/abstract/id.rb:260:in `call'"},
179
+ # {"exception_object_id"=>74220, "id"=>33, "trace"=>"actionpack (7.0.3) lib/action_dispatch/middleware/cookies.rb:697:in `call'"},
180
+ # {"exception_object_id"=>74220, "id"=>34, "trace"=>"activerecord (7.0.3) lib/active_record/migration.rb:603:in `call'"},
181
+ # {"exception_object_id"=>74220, "id"=>35, "trace"=>"actionpack (7.0.3) lib/action_dispatch/middleware/callbacks.rb:27:in `block in call'"},
182
+ # {"exception_object_id"=>74220, "id"=>36, "trace"=>"activesupport (7.0.3) lib/active_support/callbacks.rb:99:in `run_callbacks'"},
183
+ # {"exception_object_id"=>74220, "id"=>37, "trace"=>"actionpack (7.0.3) lib/action_dispatch/middleware/callbacks.rb:26:in `call'"},
184
+ # {"exception_object_id"=>74220, "id"=>38, "trace"=>"actionpack (7.0.3) lib/action_dispatch/middleware/executor.rb:14:in `call'"},
185
+ # {"exception_object_id"=>74220, "id"=>39, "trace"=>"actionpack (7.0.3) lib/action_dispatch/middleware/actionable_exceptions.rb:17:in `call'"},
186
+ # {"exception_object_id"=>74220, "id"=>40, "trace"=>"/Users/fheswara/Documents/Dev2func/rollbar-gem/lib/rollbar/middleware/rails/rollbar.rb:25:in `block in call'"},
187
+ # {"exception_object_id"=>74220, "id"=>41, "trace"=>"/Users/fheswara/Documents/Dev2func/rollbar-gem/lib/rollbar.rb:147:in `scoped'"},
188
+ # {"exception_object_id"=>74220, "id"=>42, "trace"=>"/Users/fheswara/Documents/Dev2func/rollbar-gem/lib/rollbar/middleware/rails/rollbar.rb:22:in `call'"},
189
+ # {"exception_object_id"=>74220, "id"=>43, "trace"=>"actionpack (7.0.3) lib/action_dispatch/middleware/debug_exceptions.rb:28:in `call'"},
190
+ # {"exception_object_id"=>74220,
191
+ # "id"=>44,
192
+ # "trace"=>"/Users/fheswara/Documents/Dev2func/rollbar-gem/lib/rollbar/middleware/rails/show_exceptions.rb:22:in `call_with_rollbar'"},
193
+ # {"exception_object_id"=>74220, "id"=>45, "trace"=>"/Users/fheswara/Documents/Dev2func/dev2func-rails/lib/dev2func/rails/watch_dog.rb:14:in `call'"},
194
+ # {"exception_object_id"=>74220, "id"=>46, "trace"=>"actionpack (7.0.3) lib/action_dispatch/middleware/show_exceptions.rb:26:in `call'"},
195
+ # {"exception_object_id"=>74220, "id"=>47, "trace"=>"railties (7.0.3) lib/rails/rack/logger.rb:40:in `call_app'"},
196
+ # {"exception_object_id"=>74220, "id"=>48, "trace"=>"railties (7.0.3) lib/rails/rack/logger.rb:25:in `block in call'"},
197
+ # {"exception_object_id"=>74220, "id"=>49, "trace"=>"activesupport (7.0.3) lib/active_support/tagged_logging.rb:114:in `block in tagged'"},
198
+ # {"exception_object_id"=>74220, "id"=>50, "trace"=>"activesupport (7.0.3) lib/active_support/tagged_logging.rb:38:in `tagged'"},
199
+ # {"exception_object_id"=>74220, "id"=>51, "trace"=>"activesupport (7.0.3) lib/active_support/tagged_logging.rb:114:in `tagged'"},
200
+ # {"exception_object_id"=>74220, "id"=>52, "trace"=>"railties (7.0.3) lib/rails/rack/logger.rb:25:in `call'"},
201
+ # {"exception_object_id"=>74220, "id"=>53, "trace"=>"actionpack (7.0.3) lib/action_dispatch/middleware/remote_ip.rb:93:in `call'"},
202
+ # {"exception_object_id"=>74220, "id"=>54, "trace"=>"actionpack (7.0.3) lib/action_dispatch/middleware/request_id.rb:26:in `call'"},
203
+ # {"exception_object_id"=>74220, "id"=>55, "trace"=>"rack (2.2.4) lib/rack/method_override.rb:24:in `call'"},
204
+ # {"exception_object_id"=>74220, "id"=>56, "trace"=>"rack (2.2.4) lib/rack/runtime.rb:22:in `call'"},
205
+ # {"exception_object_id"=>74220, "id"=>57, "trace"=>"activesupport (7.0.3) lib/active_support/cache/strategy/local_cache_middleware.rb:29:in `call'"},
206
+ # {"exception_object_id"=>74220, "id"=>58, "trace"=>"actionpack (7.0.3) lib/action_dispatch/middleware/server_timing.rb:20:in `call'"},
207
+ # {"exception_object_id"=>74220, "id"=>59, "trace"=>"actionpack (7.0.3) lib/action_dispatch/middleware/executor.rb:14:in `call'"},
208
+ # {"exception_object_id"=>74220, "id"=>60, "trace"=>"actionpack (7.0.3) lib/action_dispatch/middleware/static.rb:23:in `call'"},
209
+ # {"exception_object_id"=>74220, "id"=>61, "trace"=>"rack (2.2.4) lib/rack/sendfile.rb:110:in `call'"},
210
+ # {"exception_object_id"=>74220, "id"=>62, "trace"=>"actionpack (7.0.3) lib/action_dispatch/middleware/host_authorization.rb:137:in `call'"},
211
+ # {"exception_object_id"=>74220, "id"=>63, "trace"=>"rack-cors (1.1.1) lib/rack/cors.rb:100:in `call'"},
212
+ # {"exception_object_id"=>74220, "id"=>64, "trace"=>"railties (7.0.3) lib/rails/engine.rb:530:in `call'"},
213
+ # {"exception_object_id"=>74220, "id"=>65, "trace"=>"puma (5.6.4) lib/puma/configuration.rb:252:in `call'"},
214
+ # {"exception_object_id"=>74220, "id"=>66, "trace"=>"puma (5.6.4) lib/puma/request.rb:77:in `block in handle_request'"},
215
+ # {"exception_object_id"=>74220, "id"=>67, "trace"=>"puma (5.6.4) lib/puma/thread_pool.rb:340:in `with_force_shutdown'"},
216
+ # {"exception_object_id"=>74220, "id"=>68, "trace"=>"puma (5.6.4) lib/puma/request.rb:76:in `handle_request'"},
217
+ # {"exception_object_id"=>74220, "id"=>69, "trace"=>"puma (5.6.4) lib/puma/server.rb:441:in `process_client'"},
218
+ # {"exception_object_id"=>74220, "id"=>70, "trace"=>"puma (5.6.4) lib/puma/thread_pool.rb:147:in `block in spawn_thread'"}]}}
@@ -0,0 +1,3 @@
1
+ module Dev2func
2
+ VERSION = "0.0.10"
3
+ end
@@ -0,0 +1,23 @@
1
+
2
+ require 'dev2func/rails/watch_dog'
3
+ require 'dev2func/rails/railtie'
4
+ require 'dev2func/container'
5
+ require 'dev2func/shipper'
6
+
7
+ module Dev2func
8
+ class << self
9
+ attr_writer :container, :shipper
10
+
11
+ def shipper
12
+ @shipper ||= Shipper.new
13
+ end
14
+
15
+ def container
16
+ @container ||= Container.new
17
+ end
18
+
19
+ def configure(&block)
20
+ container.configuration = ::Dev2func::Configuration.new(&block)
21
+ end
22
+ end
23
+ end
metadata ADDED
@@ -0,0 +1,86 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: dev2func-rails
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.10
5
+ platform: ruby
6
+ authors:
7
+ - Dev2func Team
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2022-10-04 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: faraday
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - '='
18
+ - !ruby/object:Gem::Version
19
+ version: 2.5.2
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - '='
25
+ - !ruby/object:Gem::Version
26
+ version: 2.5.2
27
+ - !ruby/object:Gem::Dependency
28
+ name: rexml
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - '='
32
+ - !ruby/object:Gem::Version
33
+ version: 3.2.5
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - '='
39
+ - !ruby/object:Gem::Version
40
+ version: 3.2.5
41
+ description: Application performance monitoring
42
+ email:
43
+ - technology@dev2func.com
44
+ executables: []
45
+ extensions: []
46
+ extra_rdoc_files: []
47
+ files:
48
+ - CHANGELOG.md
49
+ - Gemfile
50
+ - README.md
51
+ - Rakefile
52
+ - lib/dev2func-rails.rb
53
+ - lib/dev2func/configuration.rb
54
+ - lib/dev2func/container.rb
55
+ - lib/dev2func/models/stream.rb
56
+ - lib/dev2func/rails.rb
57
+ - lib/dev2func/rails/railtie.rb
58
+ - lib/dev2func/rails/watch_dog.rb
59
+ - lib/dev2func/services/xray.rb
60
+ - lib/dev2func/sherif.rb
61
+ - lib/dev2func/shipper.rb
62
+ - lib/dev2func/version.rb
63
+ homepage: https://dev2func.com
64
+ licenses:
65
+ - MIT
66
+ metadata: {}
67
+ post_install_message:
68
+ rdoc_options: []
69
+ require_paths:
70
+ - lib
71
+ required_ruby_version: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: 2.6.0
76
+ required_rubygems_version: !ruby/object:Gem::Requirement
77
+ requirements:
78
+ - - ">="
79
+ - !ruby/object:Gem::Version
80
+ version: '0'
81
+ requirements: []
82
+ rubygems_version: 3.3.7
83
+ signing_key:
84
+ specification_version: 4
85
+ summary: Monitor application quality with Dev2func
86
+ test_files: []