rack-request-tracker 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d84dd1925da9acbe4403d97daedafc691e22261c58bdb92d0ad85097a9e23eb6
|
4
|
+
data.tar.gz: 0db9f1df0bbd03dda244e771cbaf0dacd309e1b2e5b87f5480b01f2bc4eba8e6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f1788c0fc6426b9f2c38e93ff2abdd7e95fe2a4f1a0b1f8ae0bcf13171c787057d09269edc5d6b7927b05d2e9e8e5e42ba68d600808767dd0f7b0244bddd609f
|
7
|
+
data.tar.gz: 79c91a1dab8e2a33f7a4175f2b9e546fa97e19f7a9e69368c989896225b9971c7f9b046c5b68090eac0dfb59de608311bd1174f2566e02657d4583fba06d55f3
|
data/lib/rack/request_tracker.rb
CHANGED
@@ -2,7 +2,7 @@ require 'request_store'
|
|
2
2
|
require 'mumukit/core'
|
3
3
|
|
4
4
|
module Rack::RequestTracker
|
5
|
-
LOG_TAGS = %i(request_id forwarded_for request_uid)
|
5
|
+
LOG_TAGS = %i(request_id forwarded_for request_uid organization)
|
6
6
|
|
7
7
|
class << self
|
8
8
|
def transaction_headers
|
@@ -16,8 +16,7 @@ module Rack::RequestTracker
|
|
16
16
|
|
17
17
|
def compute_tags
|
18
18
|
LOG_TAGS
|
19
|
-
.map { |it| send
|
20
|
-
.compact
|
19
|
+
.map { |it| send(it) || 'tracker-tag-absent' }
|
21
20
|
.join(', ')
|
22
21
|
end
|
23
22
|
|
@@ -6,9 +6,11 @@ module Rack::RequestTracker::Middleware
|
|
6
6
|
|
7
7
|
def call(env)
|
8
8
|
request = ActionDispatch::Request.new(env)
|
9
|
+
|
9
10
|
Rack::RequestTracker.request_id = request.request_id
|
10
11
|
Rack::RequestTracker.forwarded_for = first_forward(request.x_forwarded_for) || request.remote_ip
|
11
12
|
Rack::RequestTracker.request_uid = request.headers['X-REQUEST-UID']
|
13
|
+
Rack::RequestTracker.organization = request.headers['X-ORGANIZATION']
|
12
14
|
|
13
15
|
@app.call(env)
|
14
16
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rack-request-tracker
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Julián Berbel Alt
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2020-09-11 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: actionpack
|
@@ -129,7 +129,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
129
129
|
- !ruby/object:Gem::Version
|
130
130
|
version: '0'
|
131
131
|
requirements: []
|
132
|
-
rubygems_version: 3.0.
|
132
|
+
rubygems_version: 3.0.8
|
133
133
|
signing_key:
|
134
134
|
specification_version: 4
|
135
135
|
summary: Bunch of patches and rack middlewares to allow for transactional logs
|