logister-ruby 0.2.0 → 0.2.2
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 +47 -0
- data/lib/logister/active_job_reporter.rb +83 -0
- data/lib/logister/client.rb +33 -18
- data/lib/logister/configuration.rb +12 -1
- data/lib/logister/context_helpers.rb +262 -0
- data/lib/logister/context_store.rb +134 -0
- data/lib/logister/middleware.rb +167 -39
- data/lib/logister/railtie.rb +18 -0
- data/lib/logister/reporter.rb +83 -38
- data/lib/logister/request_subscriber.rb +104 -0
- data/lib/logister/sql_subscriber.rb +31 -15
- data/lib/logister/version.rb +3 -1
- data/lib/logister.rb +24 -8
- metadata +5 -1
data/lib/logister.rb
CHANGED
|
@@ -2,8 +2,11 @@ require_relative 'logister/version'
|
|
|
2
2
|
require_relative 'logister/configuration'
|
|
3
3
|
require_relative 'logister/client'
|
|
4
4
|
require_relative 'logister/reporter'
|
|
5
|
+
require_relative 'logister/context_helpers'
|
|
6
|
+
require_relative 'logister/context_store'
|
|
5
7
|
require_relative 'logister/middleware'
|
|
6
8
|
require_relative 'logister/sql_subscriber'
|
|
9
|
+
require_relative 'logister/request_subscriber'
|
|
7
10
|
|
|
8
11
|
module Logister
|
|
9
12
|
class << self
|
|
@@ -28,14 +31,6 @@ module Logister
|
|
|
28
31
|
reporter.report_metric(**kwargs)
|
|
29
32
|
end
|
|
30
33
|
|
|
31
|
-
def set_user(id: nil, email: nil, name: nil, **extra)
|
|
32
|
-
reporter.set_user(id: id, email: email, name: name, **extra)
|
|
33
|
-
end
|
|
34
|
-
|
|
35
|
-
def clear_user
|
|
36
|
-
reporter.clear_user
|
|
37
|
-
end
|
|
38
|
-
|
|
39
34
|
def flush(timeout: 2)
|
|
40
35
|
reporter.flush(timeout: timeout)
|
|
41
36
|
end
|
|
@@ -43,6 +38,27 @@ module Logister
|
|
|
43
38
|
def shutdown
|
|
44
39
|
reporter.shutdown
|
|
45
40
|
end
|
|
41
|
+
|
|
42
|
+
def add_breadcrumb(category:, message:, data: {}, level: "info")
|
|
43
|
+
ContextStore.add_manual_breadcrumb(
|
|
44
|
+
category: category,
|
|
45
|
+
message: message,
|
|
46
|
+
data: data,
|
|
47
|
+
level: level
|
|
48
|
+
)
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
def add_dependency(name:, host: nil, method: nil, status: nil, duration_ms: nil, kind: nil, data: {})
|
|
52
|
+
ContextStore.add_manual_dependency(
|
|
53
|
+
name: name,
|
|
54
|
+
host: host,
|
|
55
|
+
method: method,
|
|
56
|
+
status: status,
|
|
57
|
+
duration_ms: duration_ms,
|
|
58
|
+
kind: kind,
|
|
59
|
+
data: data
|
|
60
|
+
)
|
|
61
|
+
end
|
|
46
62
|
end
|
|
47
63
|
end
|
|
48
64
|
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: logister-ruby
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.2.
|
|
4
|
+
version: 0.2.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Logister
|
|
@@ -50,11 +50,15 @@ files:
|
|
|
50
50
|
- lib/generators/logister/templates/logister.rb
|
|
51
51
|
- lib/logister-ruby.rb
|
|
52
52
|
- lib/logister.rb
|
|
53
|
+
- lib/logister/active_job_reporter.rb
|
|
53
54
|
- lib/logister/client.rb
|
|
54
55
|
- lib/logister/configuration.rb
|
|
56
|
+
- lib/logister/context_helpers.rb
|
|
57
|
+
- lib/logister/context_store.rb
|
|
55
58
|
- lib/logister/middleware.rb
|
|
56
59
|
- lib/logister/railtie.rb
|
|
57
60
|
- lib/logister/reporter.rb
|
|
61
|
+
- lib/logister/request_subscriber.rb
|
|
58
62
|
- lib/logister/sql_subscriber.rb
|
|
59
63
|
- lib/logister/version.rb
|
|
60
64
|
- logister-ruby.gemspec
|