appsignal-mongo 0.1.3.beta.0 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/appsignal/middleware/mongo_event_sanitizer.rb +1 -1
- data/lib/appsignal/mongo/instrumentation.rb +1 -1
- data/lib/appsignal/mongo/version.rb +1 -1
- metadata +49 -56
- data/lib/appsignal/middleware/mongo_event_sanitizer.rb~ +0 -35
- data/lib/appsignal/mongo/instrumentation.rb~ +0 -16
- data/lib/appsignal/mongo/version.rb~ +0 -5
- data/lib/appsignal-mongo.rb~ +0 -12
metadata
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: appsignal-mongo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
|
4
|
+
version: 0.1.3
|
5
|
+
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Thijs Cadier
|
@@ -10,120 +10,120 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2013-
|
13
|
+
date: 2013-05-16 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
|
-
version_requirements: !ruby/object:Gem::Requirement
|
17
|
-
requirements:
|
18
|
-
- - ! '>'
|
19
|
-
- !ruby/object:Gem::Version
|
20
|
-
version: '1.5'
|
21
|
-
none: false
|
22
|
-
prerelease: false
|
23
16
|
name: mongo
|
24
17
|
requirement: !ruby/object:Gem::Requirement
|
18
|
+
none: false
|
25
19
|
requirements:
|
26
20
|
- - ! '>'
|
27
21
|
- !ruby/object:Gem::Version
|
28
22
|
version: '1.5'
|
29
|
-
none: false
|
30
23
|
type: :runtime
|
31
|
-
|
24
|
+
prerelease: false
|
32
25
|
version_requirements: !ruby/object:Gem::Requirement
|
26
|
+
none: false
|
33
27
|
requirements:
|
34
|
-
- -
|
28
|
+
- - ! '>'
|
35
29
|
- !ruby/object:Gem::Version
|
36
|
-
version: '
|
37
|
-
|
38
|
-
prerelease: false
|
30
|
+
version: '1.5'
|
31
|
+
- !ruby/object:Gem::Dependency
|
39
32
|
name: activesupport
|
40
33
|
requirement: !ruby/object:Gem::Requirement
|
34
|
+
none: false
|
41
35
|
requirements:
|
42
36
|
- - ~>
|
43
37
|
- !ruby/object:Gem::Version
|
44
38
|
version: '3'
|
45
|
-
none: false
|
46
39
|
type: :runtime
|
47
|
-
|
40
|
+
prerelease: false
|
48
41
|
version_requirements: !ruby/object:Gem::Requirement
|
42
|
+
none: false
|
49
43
|
requirements:
|
50
44
|
- - ~>
|
51
45
|
- !ruby/object:Gem::Version
|
52
|
-
version:
|
53
|
-
|
54
|
-
prerelease: false
|
46
|
+
version: '3'
|
47
|
+
- !ruby/object:Gem::Dependency
|
55
48
|
name: appsignal
|
56
49
|
requirement: !ruby/object:Gem::Requirement
|
50
|
+
none: false
|
57
51
|
requirements:
|
58
52
|
- - ~>
|
59
53
|
- !ruby/object:Gem::Version
|
60
54
|
version: 0.5.0.beta1
|
61
|
-
none: false
|
62
55
|
type: :runtime
|
63
|
-
|
56
|
+
prerelease: false
|
64
57
|
version_requirements: !ruby/object:Gem::Requirement
|
58
|
+
none: false
|
65
59
|
requirements:
|
66
|
-
- -
|
60
|
+
- - ~>
|
67
61
|
- !ruby/object:Gem::Version
|
68
|
-
version:
|
69
|
-
|
70
|
-
prerelease: false
|
62
|
+
version: 0.5.0.beta1
|
63
|
+
- !ruby/object:Gem::Dependency
|
71
64
|
name: bson_ext
|
72
65
|
requirement: !ruby/object:Gem::Requirement
|
66
|
+
none: false
|
73
67
|
requirements:
|
74
68
|
- - ! '>='
|
75
69
|
- !ruby/object:Gem::Version
|
76
70
|
version: '0'
|
77
|
-
none: false
|
78
71
|
type: :development
|
79
|
-
|
72
|
+
prerelease: false
|
80
73
|
version_requirements: !ruby/object:Gem::Requirement
|
74
|
+
none: false
|
81
75
|
requirements:
|
82
76
|
- - ! '>='
|
83
77
|
- !ruby/object:Gem::Version
|
84
78
|
version: '0'
|
85
|
-
|
86
|
-
prerelease: false
|
79
|
+
- !ruby/object:Gem::Dependency
|
87
80
|
name: rake
|
88
81
|
requirement: !ruby/object:Gem::Requirement
|
82
|
+
none: false
|
89
83
|
requirements:
|
90
84
|
- - ! '>='
|
91
85
|
- !ruby/object:Gem::Version
|
92
86
|
version: '0'
|
93
|
-
none: false
|
94
87
|
type: :development
|
95
|
-
|
88
|
+
prerelease: false
|
96
89
|
version_requirements: !ruby/object:Gem::Requirement
|
90
|
+
none: false
|
97
91
|
requirements:
|
98
|
-
- -
|
92
|
+
- - ! '>='
|
99
93
|
- !ruby/object:Gem::Version
|
100
|
-
version:
|
101
|
-
|
102
|
-
prerelease: false
|
94
|
+
version: '0'
|
95
|
+
- !ruby/object:Gem::Dependency
|
103
96
|
name: rspec
|
104
97
|
requirement: !ruby/object:Gem::Requirement
|
98
|
+
none: false
|
105
99
|
requirements:
|
106
100
|
- - ~>
|
107
101
|
- !ruby/object:Gem::Version
|
108
102
|
version: 2.12.0
|
109
|
-
none: false
|
110
103
|
type: :development
|
111
|
-
|
104
|
+
prerelease: false
|
112
105
|
version_requirements: !ruby/object:Gem::Requirement
|
106
|
+
none: false
|
113
107
|
requirements:
|
114
|
-
- -
|
108
|
+
- - ~>
|
115
109
|
- !ruby/object:Gem::Version
|
116
|
-
version:
|
117
|
-
|
118
|
-
prerelease: false
|
110
|
+
version: 2.12.0
|
111
|
+
- !ruby/object:Gem::Dependency
|
119
112
|
name: pry
|
120
113
|
requirement: !ruby/object:Gem::Requirement
|
114
|
+
none: false
|
121
115
|
requirements:
|
122
116
|
- - ! '>='
|
123
117
|
- !ruby/object:Gem::Version
|
124
118
|
version: '0'
|
125
|
-
none: false
|
126
119
|
type: :development
|
120
|
+
prerelease: false
|
121
|
+
version_requirements: !ruby/object:Gem::Requirement
|
122
|
+
none: false
|
123
|
+
requirements:
|
124
|
+
- - ! '>='
|
125
|
+
- !ruby/object:Gem::Version
|
126
|
+
version: '0'
|
127
127
|
description: Wrap all mongo queries withActiveSupport::Notifications.instrument calls.
|
128
128
|
For use with Appsignal.
|
129
129
|
email:
|
@@ -133,13 +133,9 @@ extensions: []
|
|
133
133
|
extra_rdoc_files: []
|
134
134
|
files:
|
135
135
|
- lib/appsignal/middleware/mongo_event_sanitizer.rb
|
136
|
-
- lib/appsignal/middleware/mongo_event_sanitizer.rb~
|
137
136
|
- lib/appsignal/mongo/instrumentation.rb
|
138
|
-
- lib/appsignal/mongo/instrumentation.rb~
|
139
137
|
- lib/appsignal/mongo/version.rb
|
140
|
-
- lib/appsignal/mongo/version.rb~
|
141
138
|
- lib/appsignal-mongo.rb
|
142
|
-
- lib/appsignal-mongo.rb~
|
143
139
|
- README.md
|
144
140
|
homepage: https://github.com/appsignal/appsignal-mongo
|
145
141
|
licenses: []
|
@@ -148,23 +144,20 @@ rdoc_options: []
|
|
148
144
|
require_paths:
|
149
145
|
- lib
|
150
146
|
required_ruby_version: !ruby/object:Gem::Requirement
|
147
|
+
none: false
|
151
148
|
requirements:
|
152
149
|
- - ! '>='
|
153
150
|
- !ruby/object:Gem::Version
|
154
151
|
version: '0'
|
155
|
-
segments:
|
156
|
-
- 0
|
157
|
-
hash: -4000561256811814464
|
158
|
-
none: false
|
159
152
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
153
|
+
none: false
|
160
154
|
requirements:
|
161
|
-
- - ! '
|
155
|
+
- - ! '>='
|
162
156
|
- !ruby/object:Gem::Version
|
163
|
-
version:
|
164
|
-
none: false
|
157
|
+
version: '0'
|
165
158
|
requirements: []
|
166
159
|
rubyforge_project:
|
167
|
-
rubygems_version: 1.8.
|
160
|
+
rubygems_version: 1.8.25
|
168
161
|
signing_key:
|
169
162
|
specification_version: 3
|
170
163
|
summary: Add instrument calls to mongodb queries made with mongo. For use with Appsignal.
|
@@ -1,35 +0,0 @@
|
|
1
|
-
module Appsignal
|
2
|
-
module Middleware
|
3
|
-
class MongoEventSanitizer
|
4
|
-
WHITELISTED_KEYS = [:fields, :order]
|
5
|
-
|
6
|
-
def call(event)
|
7
|
-
if target?(event)
|
8
|
-
event.payload.each_value do |parameters|
|
9
|
-
selected(parameters).each_value do |value|
|
10
|
-
scrub!(value)
|
11
|
-
end
|
12
|
-
end
|
13
|
-
end
|
14
|
-
yield
|
15
|
-
end
|
16
|
-
|
17
|
-
protected
|
18
|
-
|
19
|
-
def target?(event)
|
20
|
-
event.name == Appsignal::Mongo::Instrumentation::EVENT_NAME
|
21
|
-
end
|
22
|
-
|
23
|
-
def selected(parameters)
|
24
|
-
parameters.reject { |key, value| WHITELISTED_KEYS.include?(key) }
|
25
|
-
end
|
26
|
-
|
27
|
-
def scrub!(value)
|
28
|
-
if value.is_a?(Hash) || value.is_a?(Array)
|
29
|
-
Appsignal::ParamsSanitizer.scrub!(value)
|
30
|
-
end
|
31
|
-
end
|
32
|
-
|
33
|
-
end
|
34
|
-
end
|
35
|
-
end
|
@@ -1,16 +0,0 @@
|
|
1
|
-
module Appsignal
|
2
|
-
module Mongo
|
3
|
-
module Instrumentation
|
4
|
-
|
5
|
-
private
|
6
|
-
|
7
|
-
def instrument_with_appsignal_instrumentation(name, payload={}, &block)
|
8
|
-
ActiveSupport::Notifications.instrument(
|
9
|
-
'query.mongodb', name => payload) do
|
10
|
-
instrument_without_appsignal_instrumentation(name, payload, &block)
|
11
|
-
end
|
12
|
-
end
|
13
|
-
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|
data/lib/appsignal-mongo.rb~
DELETED
@@ -1,12 +0,0 @@
|
|
1
|
-
require 'mongo'
|
2
|
-
require 'rails'
|
3
|
-
require 'appsignal'
|
4
|
-
require 'appsignal/mongo/instrumentation'
|
5
|
-
require 'appsignal/middleware/mongo_event_sanitizer'
|
6
|
-
|
7
|
-
::Mongo::Logging.module_eval do
|
8
|
-
include Appsignal::Mongo::Instrumentation
|
9
|
-
|
10
|
-
alias_method :instrument_without_appsignal_instrumentation, :instrument
|
11
|
-
alias_method :instrument, :instrument_with_appsignal_instrumentation
|
12
|
-
end
|