scout_apm 5.6.0 → 5.6.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.markdown +3 -0
- data/lib/scout_apm/config.rb +11 -4
- data/lib/scout_apm/sampling.rb +9 -1
- data/lib/scout_apm/version.rb +1 -1
- data/test/unit/config_test.rb +20 -0
- 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: 351ed300191874b86b1c402a2696897d05006266c2c88716a15d8588aefa00b2
|
4
|
+
data.tar.gz: dcdc4fb47007eb665f7a4df6a3a9a7bcde78550656692fc5023020739b0974d9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8fe62cd0646f58ad535d3912cf9c023fb8d7c52116dd30b3359e7f33f50f51ba3457090fe2df8f0bec5e5194b02bcccb44feaa466d76fa14938b91f11f1f74c0
|
7
|
+
data.tar.gz: cd20a788b47c33be24c8ee88eb00d443bf3d20990ba3fb769ca64353b14b090b931c121d6f07aa40bd366381f3f77646b41206e66cb9507cb204ee3eaadf62fe
|
data/CHANGELOG.markdown
CHANGED
@@ -1,5 +1,8 @@
|
|
1
1
|
# Unreleased
|
2
2
|
|
3
|
+
# 5.6.1
|
4
|
+
- Fix `job_sample_rate` and `endpoint_sample_rate` default configuration values (#529)
|
5
|
+
|
3
6
|
# 5.6.0
|
4
7
|
- New options for sampling and ignore configurationn (#521)
|
5
8
|
- `sample_rate` - Set the rate at which requests are sampled globally (1-100, a percentage of requests to keep).
|
data/lib/scout_apm/config.rb
CHANGED
@@ -184,6 +184,13 @@ module ScoutApm
|
|
184
184
|
end
|
185
185
|
end
|
186
186
|
|
187
|
+
class NullableIntegerCoercion
|
188
|
+
def coerce(val)
|
189
|
+
return val if val.nil?
|
190
|
+
val.to_i
|
191
|
+
end
|
192
|
+
end
|
193
|
+
|
187
194
|
# Simply returns the passed in value, without change
|
188
195
|
class NullCoercion
|
189
196
|
def coerce(val)
|
@@ -213,8 +220,8 @@ module ScoutApm
|
|
213
220
|
'sample_rate' => IntegerCoercion.new,
|
214
221
|
'sample_endpoints' => JsonCoercion.new,
|
215
222
|
'sample_jobs' => JsonCoercion.new,
|
216
|
-
'endpoint_sample_rate' =>
|
217
|
-
'job_sample_rate' =>
|
223
|
+
'endpoint_sample_rate' => NullableIntegerCoercion.new,
|
224
|
+
'job_sample_rate' => NullableIntegerCoercion.new,
|
218
225
|
'start_resque_server_instrument' => BooleanCoercion.new,
|
219
226
|
'timeline_traces' => BooleanCoercion.new,
|
220
227
|
'auto_instruments' => BooleanCoercion.new,
|
@@ -337,8 +344,8 @@ module ScoutApm
|
|
337
344
|
'sample_rate' => 100,
|
338
345
|
'sample_endpoints' => [],
|
339
346
|
'sample_jobs' => [],
|
340
|
-
'endpoint_sample_rate' =>
|
341
|
-
'job_sample_rate' =>
|
347
|
+
'endpoint_sample_rate' => nil,
|
348
|
+
'job_sample_rate' => nil,
|
342
349
|
'start_resque_server_instrument' => true, # still only starts if Resque is detected
|
343
350
|
'collect_remote_ip' => true,
|
344
351
|
'record_queue_time' => true,
|
data/lib/scout_apm/sampling.rb
CHANGED
@@ -16,7 +16,15 @@ module ScoutApm
|
|
16
16
|
@sample_jobs = individual_sample_to_hash(config.value('sample_jobs'))
|
17
17
|
@job_sample_rate = config.value('job_sample_rate')
|
18
18
|
|
19
|
-
|
19
|
+
log_string = "Sampling initialized with config: "
|
20
|
+
log_string += "global_sample_rate: #{@global_sample_rate.inspect}, "
|
21
|
+
log_string += "endpoint_sample_rate: #{@endpoint_sample_rate.inspect}, "
|
22
|
+
log_string += "sample_endpoints: #{@sample_endpoints.inspect}, "
|
23
|
+
log_string += "ignore_endpoints: #{@ignore_endpoints.inspect}, "
|
24
|
+
log_string += "job_sample_rate: #{@job_sample_rate.inspect}, "
|
25
|
+
log_string += "sample_jobs: #{@sample_jobs.inspect}, "
|
26
|
+
log_string += "ignore_jobs: #{@ignore_jobs.inspect}"
|
27
|
+
logger.info(log_string)
|
20
28
|
end
|
21
29
|
|
22
30
|
def drop_request?(transaction)
|
data/lib/scout_apm/version.rb
CHANGED
data/test/unit/config_test.rb
CHANGED
@@ -72,6 +72,26 @@ class ConfigTest < Minitest::Test
|
|
72
72
|
assert_equal ["a"], coercion.coerce(["a"])
|
73
73
|
end
|
74
74
|
|
75
|
+
def test_integer_coercion
|
76
|
+
coercion = ScoutApm::Config::IntegerCoercion.new
|
77
|
+
assert_equal 1, coercion.coerce("1")
|
78
|
+
assert_equal 1, coercion.coerce(1)
|
79
|
+
assert_equal 0, coercion.coerce("0")
|
80
|
+
assert_equal 0, coercion.coerce(0)
|
81
|
+
assert_equal 0, coercion.coerce("")
|
82
|
+
assert_equal 0, coercion.coerce(nil)
|
83
|
+
end
|
84
|
+
|
85
|
+
def test_nullable_integer_coercion
|
86
|
+
coercion = ScoutApm::Config::NullableIntegerCoercion.new
|
87
|
+
assert_equal 1, coercion.coerce("1")
|
88
|
+
assert_equal 1, coercion.coerce(1)
|
89
|
+
assert_equal 0, coercion.coerce("0")
|
90
|
+
assert_equal 0, coercion.coerce(0)
|
91
|
+
assert_equal 0, coercion.coerce("")
|
92
|
+
assert_equal nil, coercion.coerce(nil)
|
93
|
+
end
|
94
|
+
|
75
95
|
def test_any_keys_found
|
76
96
|
ENV.stubs(:has_key?).returns(nil)
|
77
97
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: scout_apm
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.6.
|
4
|
+
version: 5.6.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Derek Haynes
|
8
8
|
- Andre Lewis
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-
|
11
|
+
date: 2025-02-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: minitest
|