nexaas-auditor 1.0.2 → 1.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +4 -0
- data/TODO.md +8 -6
- data/lib/nexaas/auditor/subscriber.rb +8 -0
- data/lib/nexaas/auditor/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c08401a6d6365bf876971aa27083a52b05bd439d
|
4
|
+
data.tar.gz: d19eb0e9021bdc97b32f1798d4c540effbac9409
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3f912ad859cfe4342e3ae78a884cec21ad7641b3424faaea3c740d1f35cb6e043a866b0d603bcc75b9af344dd5ccf58eaea7419efd40d09c1d852ae706fd9255
|
7
|
+
data.tar.gz: a709f06fac327e6c2b41908b397d36237b3a86f8cf152d9684242944f4bc135bfb80375e5246161b9d716c7a23c8fe75c8926197a155a509b6d43533164d753c
|
data/README.md
CHANGED
@@ -70,6 +70,10 @@ Nexaas::Auditor.configure do |config|
|
|
70
70
|
end
|
71
71
|
end
|
72
72
|
|
73
|
+
# make sure all subscribers are loaded before subscribing below
|
74
|
+
Dir[Rails.root.join("app/loggers/*.rb")].each { |f| require f }
|
75
|
+
Dir[Rails.root.join("app/statistics/*.rb")].each { |f| require f }
|
76
|
+
|
73
77
|
# setup all subscribers
|
74
78
|
Nexaas::Auditor.subscribe_all
|
75
79
|
```
|
data/TODO.md
CHANGED
@@ -2,11 +2,13 @@
|
|
2
2
|
|
3
3
|
Tasks yet to be done, in order of importance. Feel free to help out ;-)
|
4
4
|
|
5
|
-
-
|
6
|
-
- Only require [
|
7
|
-
-
|
8
|
-
-
|
9
|
-
- Add
|
10
|
-
- Add
|
5
|
+
- Figure out a way to make sure all app-level subscribers (subclasses of `Nexaas::Auditor::LogsSubscriber` and `Nexaas::Auditor::StatsSubscriber`) are loaded by Rails before calling `Nexaas::Auditor.subscribe_all` automatically, without having to require them manually first.
|
6
|
+
- Only require [Nunes](https://github.com/jnunemaker/nunes) gem if the configuration says `track_rails_events = true`, and "fail fast" if `Nunes` is not loaded.
|
7
|
+
- Only require [StatHat](https://github.com/patrickxb/stathat) gem if the configuration says `statistics_service = 'stathat'`, and "fail fast" if `StatHat` is not loaded.
|
8
|
+
- Extract log formating logic out of Nexaas::Auditor::AuditLogger into a proper log formating class.
|
9
|
+
- Add possibility of supporting more log formats (currently only logfmt format is supported).
|
10
|
+
- Add options to limit the metrics subscribed by default when `track_rails_events = true`; by default [Nunes](https://github.com/jnunemaker/nunes) sends **a lot** of metrics, some of them may not be so useful and end up "polluting" the statistics service (or, more importantly, cost unnecessary money if the service restricts the number of metrics created).
|
11
|
+
- Add more statistic services support ([Instrumental](https://instrumentalapp.com/), [self-hosted StatsD](https://github.com/etsy/statsd), [Librato](https://www.librato.com/), [DataDoc](https://www.datadoghq.com/), etc).
|
11
12
|
- Separate the audit logging part from the statistics tracking part, maybe in separate gems as well, but in a way that they could just as easily be all used togheter and share common code.
|
12
13
|
- Separate the bussiness-logic statistics tracking part from the Rails (Nunes) statistics tracking, maybe in separate gems as well, but in a way that they could just as easily be all used togheter and share common code.
|
14
|
+
- Separeate log-formatting logic into a gem, that requires and uses lograge, etc, and is compatible with the Rails logger and also Sidekiq, RPush and other common gems and etc.
|
@@ -5,6 +5,7 @@ module Nexaas
|
|
5
5
|
class Subscriber
|
6
6
|
|
7
7
|
def self.subscribe_all
|
8
|
+
validate_subclasses!
|
8
9
|
subscribers = []
|
9
10
|
subclasses.each do |klass|
|
10
11
|
subscribers << klass.subscribe()
|
@@ -35,6 +36,13 @@ module Nexaas
|
|
35
36
|
raise "Not Implemented, override in subclass."
|
36
37
|
end
|
37
38
|
|
39
|
+
# raise error if no app-level subclasses (of StatsSubscriber and
|
40
|
+
# LogsSubscriber) are found.
|
41
|
+
def self.validate_subclasses!
|
42
|
+
raise RuntimeError,
|
43
|
+
"no subclasses of #{self} found!" if subclasses.empty?
|
44
|
+
end
|
45
|
+
|
38
46
|
end
|
39
47
|
end
|
40
48
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nexaas-auditor
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rodrigo Tassinari de Oliveira
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-06-
|
11
|
+
date: 2016-06-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|