mnemosyne-ruby 1.1.0.rc1 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +0 -3
- data/CHANGELOG.md +1 -0
- data/README.md +1 -0
- data/lib/mnemosyne/client.rb +1 -1
- data/lib/mnemosyne/configuration.rb +12 -0
- data/lib/mnemosyne/middleware/rack.rb +15 -2
- data/lib/mnemosyne/probes/msgr/consumer.rb +3 -2
- data/lib/mnemosyne/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d3041b1bd2093674c509a9d037f7fa864a06e669
|
4
|
+
data.tar.gz: 66714af6d59848f008438c18f2ac3429bdd54f23
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0bdb13b855926133b2250c82d607c35d397b744c4f2704deb9e27305067e79a212f66c2ef37f5556e1cbcde0d58c3618203c3fba063d18b7e87cffc851c60d88
|
7
|
+
data.tar.gz: bcf5d485d708c55b286788c9c8302694bec75cee1b2f2bf30da30d785bc92cd520266586809deb2b9a51df42330572a792cb73c2955524a4ed63a787fec7e7e4
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
data/lib/mnemosyne/client.rb
CHANGED
@@ -28,6 +28,18 @@ module Mnemosyne
|
|
28
28
|
@amqp = AMQ::Settings.configure(server).freeze
|
29
29
|
@server = make_amqp_uri(@amqp).to_s.freeze
|
30
30
|
|
31
|
+
raise ArgumentError.new 'Platform is required' if platform.blank?
|
32
|
+
|
33
|
+
if @platform =~ /[^a-zA-Z0-9\-]/
|
34
|
+
raise ArgumentError.new \
|
35
|
+
'Platform may only contain alphanumeric characters'
|
36
|
+
end
|
37
|
+
|
38
|
+
unless @platform =~ /\A[a-zA-Z0-9]+(\-[a-zA-Z0-9]+)*\z/
|
39
|
+
raise ArgumentError.new \
|
40
|
+
'Platform must start and end with a alphanumeric characters'
|
41
|
+
end
|
42
|
+
|
31
43
|
raise ArgumentError.new('Application is required') if application.blank?
|
32
44
|
raise ArgumentError.new('Hostname is required') if hostname.blank?
|
33
45
|
end
|
@@ -54,15 +54,28 @@ module Mnemosyne
|
|
54
54
|
@app = app
|
55
55
|
end
|
56
56
|
|
57
|
-
def call(env)
|
57
|
+
def call(env) # rubocop:disable AbcSize
|
58
58
|
origin = env.fetch('HTTP_X_MNEMOSYNE_ORIGIN', false)
|
59
59
|
transaction = env.fetch('HTTP_X_MNEMOSYNE_TRANSACTION') do
|
60
60
|
::SecureRandom.uuid
|
61
61
|
end
|
62
62
|
|
63
|
+
meta = {
|
64
|
+
method: env['REQUEST_METHOD'],
|
65
|
+
path: env['REQUEST_PATH'],
|
66
|
+
query: env['QUERY_STRING'],
|
67
|
+
protocol: env['SERVER_PROTOCOL'],
|
68
|
+
headers: {
|
69
|
+
'Accept': env['HTTP_ACCEPT'],
|
70
|
+
'Host': env['HTTP_HOST'],
|
71
|
+
'User-Agent': env['HTTP_USER_AGENT']
|
72
|
+
}
|
73
|
+
}
|
74
|
+
|
63
75
|
trace = ::Mnemosyne::Instrumenter.trace 'app.web.request.rack',
|
64
76
|
transaction: transaction,
|
65
|
-
origin: origin
|
77
|
+
origin: origin,
|
78
|
+
meta: meta
|
66
79
|
|
67
80
|
if trace
|
68
81
|
trace.start!
|
@@ -16,10 +16,11 @@ module Mnemosyne
|
|
16
16
|
def dispatch(message) # rubocop:disable AbcSize
|
17
17
|
route = message.route
|
18
18
|
metadata = message.metadata
|
19
|
+
headers = metadata.headers || {}
|
19
20
|
delivery_info = message.delivery_info
|
20
21
|
|
21
|
-
origin =
|
22
|
-
transaction =
|
22
|
+
origin = headers.delete('mnemosyne.origin')
|
23
|
+
transaction = headers.delete('mnemosyne.transaction') do
|
23
24
|
::SecureRandom.uuid
|
24
25
|
end
|
25
26
|
|
data/lib/mnemosyne/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mnemosyne-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.0
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jan Graichen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-05-
|
11
|
+
date: 2017-05-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bunny
|
@@ -176,9 +176,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
176
176
|
version: '0'
|
177
177
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
178
178
|
requirements:
|
179
|
-
- - "
|
179
|
+
- - ">="
|
180
180
|
- !ruby/object:Gem::Version
|
181
|
-
version:
|
181
|
+
version: '0'
|
182
182
|
requirements: []
|
183
183
|
rubyforge_project:
|
184
184
|
rubygems_version: 2.6.11
|