jcw 0.2.3 → 0.2.4
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/.rubocop.yml +3 -0
- data/Gemfile.lock +3 -3
- data/README.md +2 -2
- data/lib/jcw/config.rb +3 -3
- data/lib/jcw/rack_tracer.rb +5 -4
- data/lib/jcw/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: e7f97935444bb8d0285e96565c731f99e65df848573cc0257eb041dc90d3bf8b
|
|
4
|
+
data.tar.gz: a119efdd207f9ebf9965cb8a62fab5c8e3541db7535e5649a14808f02a0683f9
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b70cfaecfca2e89dda7c95eb471d0169afc9deb286fb42481f36663db89c07850ef8c7d5185b7cb47658313e812d01328f95d8f68a88a8e4db6b0b37007f5a2f
|
|
7
|
+
data.tar.gz: 14ca08c194b0c3c710670f7b9e77f6584a269366167a3ec4bfadaf042c7fa0e60776981af46b2dff7af69ed0a96fafd116585fbfa1a2721624225d9aeec399c1
|
data/.rubocop.yml
CHANGED
data/Gemfile.lock
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
jcw (0.2.
|
|
4
|
+
jcw (0.2.4)
|
|
5
5
|
activesupport (>= 5.0, < 7.0.0)
|
|
6
6
|
gruf (~> 2.10)
|
|
7
7
|
httprb-opentracing (~> 0.4.0)
|
|
@@ -49,7 +49,7 @@ GEM
|
|
|
49
49
|
ffi-compiler (1.0.1)
|
|
50
50
|
ffi (>= 1.0.0)
|
|
51
51
|
rake
|
|
52
|
-
google-protobuf (3.19.
|
|
52
|
+
google-protobuf (3.19.3)
|
|
53
53
|
googleapis-common-protos-types (1.3.0)
|
|
54
54
|
google-protobuf (~> 3.14)
|
|
55
55
|
grpc (1.41.0)
|
|
@@ -215,4 +215,4 @@ DEPENDENCIES
|
|
|
215
215
|
simplecov-lcov
|
|
216
216
|
|
|
217
217
|
BUNDLED WITH
|
|
218
|
-
2.2.
|
|
218
|
+
2.2.27
|
data/README.md
CHANGED
|
@@ -42,7 +42,7 @@ UDP Sender(default):
|
|
|
42
42
|
hostname: "custom-hostname",
|
|
43
43
|
custom_tag: "custom-tag-value",
|
|
44
44
|
}
|
|
45
|
-
config.
|
|
45
|
+
config.rack_ignore_path_patterns = ["/api/test", %r{/sidekiq}]
|
|
46
46
|
end
|
|
47
47
|
|
|
48
48
|
# Set middleware for wrapping all requests
|
|
@@ -60,7 +60,7 @@ TCP Sender:
|
|
|
60
60
|
hostname: "custom-hostname",
|
|
61
61
|
custom_tag: "custom-tag-value",
|
|
62
62
|
}
|
|
63
|
-
config.
|
|
63
|
+
config.rack_ignore_path_patterns = ["/api/test", %r{/sidekiq}]
|
|
64
64
|
end
|
|
65
65
|
|
|
66
66
|
# Set middleware for wrapping all requests
|
data/lib/jcw/config.rb
CHANGED
|
@@ -9,7 +9,7 @@ module JCW
|
|
|
9
9
|
:flush_interval,
|
|
10
10
|
:tags,
|
|
11
11
|
:grpc_ignore_methods,
|
|
12
|
-
:
|
|
12
|
+
:rack_ignore_path_patterns
|
|
13
13
|
|
|
14
14
|
def enabled
|
|
15
15
|
@enabled ||= false
|
|
@@ -41,8 +41,8 @@ module JCW
|
|
|
41
41
|
@grpc_ignore_methods ||= []
|
|
42
42
|
end
|
|
43
43
|
|
|
44
|
-
def
|
|
45
|
-
@
|
|
44
|
+
def rack_ignore_path_patterns
|
|
45
|
+
@rack_ignore_path_patterns ||= []
|
|
46
46
|
end
|
|
47
47
|
end
|
|
48
48
|
end
|
data/lib/jcw/rack_tracer.rb
CHANGED
|
@@ -15,7 +15,7 @@ module JCW
|
|
|
15
15
|
# is called.
|
|
16
16
|
# @param on_start_span [Proc, nil] A callback evaluated after a new span is created.
|
|
17
17
|
# @param on_finish_span [Proc, nil] A callback evaluated after a span is finished.
|
|
18
|
-
# @param
|
|
18
|
+
# @param ignore_path_patterns [Array<Class>] An array of paths to be skiped by the tracer.
|
|
19
19
|
# @param errors [Array<Class>] An array of error classes to be captured by the tracer
|
|
20
20
|
# as errors. Errors are **not** muted by the middleware, they're re-raised afterwards.
|
|
21
21
|
def initialize(app, # rubocop:disable Metrics/ParameterLists
|
|
@@ -23,7 +23,7 @@ module JCW
|
|
|
23
23
|
on_start_span: nil,
|
|
24
24
|
on_finish_span: nil,
|
|
25
25
|
trust_incoming_span: true,
|
|
26
|
-
|
|
26
|
+
ignore_path_patterns: Wrapper.config.rack_ignore_path_patterns,
|
|
27
27
|
errors: [StandardError])
|
|
28
28
|
@app = app
|
|
29
29
|
@tracer = tracer
|
|
@@ -31,14 +31,15 @@ module JCW
|
|
|
31
31
|
@on_finish_span = on_finish_span
|
|
32
32
|
@trust_incoming_span = trust_incoming_span
|
|
33
33
|
@errors = errors
|
|
34
|
-
@
|
|
34
|
+
@ignore_path_patterns = ignore_path_patterns
|
|
35
35
|
end
|
|
36
36
|
|
|
37
37
|
def call(env)
|
|
38
38
|
method = env[REQUEST_METHOD]
|
|
39
39
|
path = env[REQUEST_PATH]
|
|
40
40
|
url = env[REQUEST_URI]
|
|
41
|
-
|
|
41
|
+
|
|
42
|
+
return @app.call(env) if @ignore_path_patterns.find { |pattern| pattern === path }
|
|
42
43
|
|
|
43
44
|
set_extract_env(env)
|
|
44
45
|
context = @tracer.extract(OpenTracing::FORMAT_TEXT_MAP, env) if @trust_incoming_span
|
data/lib/jcw/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: jcw
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.2.
|
|
4
|
+
version: 0.2.4
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Alexander Starovojtov
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2022-01-
|
|
11
|
+
date: 2022-01-25 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: activesupport
|