activeinsights 1.1.2 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +13 -6
- data/app/models/active_insights/request.rb +7 -5
- data/db/migrate/20241015142450_add_ip_address_to_requests.rb +7 -0
- data/db/migrate/20241016142157_add_user_agent_to_requests.rb +7 -0
- data/lib/active_insights/version.rb +1 -1
- data/lib/generators/active_insights/update/update_generator.rb +7 -0
- data/lib/tasks/active_insights_tasks.rake +8 -0
- metadata +6 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ee74ccb0286c40e6d26ff5d8afc796accaf4941632e517e975eddf0fe362106c
|
4
|
+
data.tar.gz: 39ebc303db5774d2b8215065a8b524071bc20fa8b3261111b8ad01071301acd1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cbba0c03ad4a0a8c63be5c9aed3fc336b0389f86a28319c10efb75e946ec4d8994aec453bfd446f8d1b79268b070f2a784577f23ae9309969a105de894216e04
|
7
|
+
data.tar.gz: 3f7f01153b7f7c2560a8234178830b0c7fd22cc9b9d2cde366982c8de3a1ad37e1fc3cd12659c4cfae6300a47fde9fddb31ebc27a1ef7695701633c68dfcb291
|
data/README.md
CHANGED
@@ -1,10 +1,12 @@
|
|
1
1
|
# ActiveInsights
|
2
2
|
|
3
|
-
One of the
|
4
|
-
a way to track response times. Unfortunately,
|
5
|
-
open source
|
3
|
+
One of the fundamental tools needed when taking your Rails app to production is
|
4
|
+
a way to track response times. Unfortunately, there aren't many free, easy,
|
5
|
+
open source ways to track them for small or medium apps. Skylight, Honeybadger,
|
6
6
|
Sentry, AppSignal, etc. are great, but they are are closed source and
|
7
7
|
there should be an easy open source alternative where you control the data.
|
8
|
+
With Rails 8's ethos of No PAAS, there should be a way for new apps to start out
|
9
|
+
with a basic error reporter and not be forced to pay a third party for one.
|
8
10
|
|
9
11
|
ActiveInsights hooks into the ActiveSupport [instrumention](https://guides.rubyonrails.org/active_support_instrumentation.html#)
|
10
12
|
baked directly into Rails. ActiveInsights tracks RPM, RPM per controller, and
|
@@ -34,13 +36,13 @@ Or install it yourself as:
|
|
34
36
|
$ gem install activeinsights
|
35
37
|
```
|
36
38
|
|
37
|
-
|
39
|
+
Run the installer and migrate:
|
38
40
|
```bash
|
39
|
-
bin/rails
|
41
|
+
bin/rails active_insights:install
|
40
42
|
bin/rails rails db:migrate
|
41
43
|
```
|
42
44
|
|
43
|
-
This
|
45
|
+
This will mount a route in your routes file to view the insights at `/insights`.
|
44
46
|
|
45
47
|
|
46
48
|
##### Config
|
@@ -58,6 +60,11 @@ You can supply an array of ignored endpoints
|
|
58
60
|
config.active_insights.ignored_endpoints = ["Rails::HealthController#show"]
|
59
61
|
```
|
60
62
|
|
63
|
+
If you are using Sprockets, add the ActiveInsights css file to manifest.js:
|
64
|
+
```javascript
|
65
|
+
//= link active_insights/application.css
|
66
|
+
```
|
67
|
+
|
61
68
|
## Development
|
62
69
|
|
63
70
|
After checking out the repo, run `bin/setup` to install dependencies. Then, run
|
@@ -3,11 +3,13 @@
|
|
3
3
|
module ActiveInsights
|
4
4
|
class Request < ::ActiveInsights::Record
|
5
5
|
def self.setup(started, finished, unique_id, payload)
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
6
|
+
req = paylooad[:request]
|
7
|
+
|
8
|
+
create!(started_at: started, ip_address: req.remote_ip,
|
9
|
+
finished_at: finished, uuid: unique_id,
|
10
|
+
http_method: payload[:method], user_agent: req.user_agent,
|
11
|
+
**payload.slice(:controller, :action, :format, :status,
|
12
|
+
:view_runtime, :db_runtime, :path))
|
11
13
|
end
|
12
14
|
|
13
15
|
def percentage(others)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: activeinsights
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nick Pezza
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-10-
|
11
|
+
date: 2024-10-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: chartkick
|
@@ -90,6 +90,8 @@ files:
|
|
90
90
|
- config/initializers/importmap.rb
|
91
91
|
- config/routes.rb
|
92
92
|
- db/migrate/20240111225806_create_active_insights_tables.rb
|
93
|
+
- db/migrate/20241015142450_add_ip_address_to_requests.rb
|
94
|
+
- db/migrate/20241016142157_add_user_agent_to_requests.rb
|
93
95
|
- lib/active_insights.rb
|
94
96
|
- lib/active_insights/engine.rb
|
95
97
|
- lib/active_insights/seeders/jobs.rb
|
@@ -97,6 +99,8 @@ files:
|
|
97
99
|
- lib/active_insights/version.rb
|
98
100
|
- lib/activeinsights.rb
|
99
101
|
- lib/generators/active_insights/install/install_generator.rb
|
102
|
+
- lib/generators/active_insights/update/update_generator.rb
|
103
|
+
- lib/tasks/active_insights_tasks.rake
|
100
104
|
homepage: https://github.com/npezza93/activeinsights
|
101
105
|
licenses:
|
102
106
|
- MIT
|