atatus 1.6.1 → 1.6.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/LICENSE +1 -1
- data/lib/atatus/collector/base.rb +81 -23
- data/lib/atatus/collector/builder.rb +2 -1
- data/lib/atatus/collector/transport.rb +20 -0
- data/lib/atatus/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: 48a2777c09d7af196314fb322c9a55feadb46f50d90ffd88976ff978eb5039a2
|
4
|
+
data.tar.gz: 59f1f63ebd4ad84f23359cc2c96ccb62e0c0eabceaa6b48bf63c711c3383bf64
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1a705d56af3228c31ce400a16eae3d961fe2bbcae949db3effc4828682563bd4ce3070adb14613cb096caa48d71e8ccce2969dc21f4b0c910c73ca99b28bf566
|
7
|
+
data.tar.gz: 30461593c406cf6f7b8f2e08c9bef4aa64b9f60f0f4c2b3f0bff9de1cff8a26f5cf25e07507b263e8638a37345916f15d479eb11bcb3e58f69a7f34d79d51d70
|
data/CHANGELOG.md
CHANGED
@@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.
|
|
4
4
|
|
5
5
|
This project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
|
6
6
|
|
7
|
+
## 1.6.2 (Mon, 31 Jan 2022)
|
8
|
+
|
9
|
+
- Fixed config environment.
|
10
|
+
- Supported ignore failure patterns, ignore exceptions and ignore transactions.
|
11
|
+
|
12
|
+
|
7
13
|
## 1.6.1 (Wed, 29 Dec 2021)
|
8
14
|
|
9
15
|
- Fixed a specific case where span duration goes less than 0.
|
data/LICENSE
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
All components of this product are Copyright (c)
|
1
|
+
All components of this product are Copyright (c) 2022 Atatus. All rights reserved.
|
2
2
|
|
3
3
|
Except as otherwise expressly provided in this Agreement,
|
4
4
|
End User shall not (and shall not permit any third party to):
|
@@ -42,6 +42,7 @@ module Atatus
|
|
42
42
|
@metrics_lock = Mutex.new
|
43
43
|
@metrics_agg = []
|
44
44
|
|
45
|
+
@hostinfo_response = {}
|
45
46
|
@transport = Atatus::BaseTransport.new(config)
|
46
47
|
@collect_counter = 0
|
47
48
|
@running = false
|
@@ -79,13 +80,38 @@ module Atatus
|
|
79
80
|
|
80
81
|
def add_error(error)
|
81
82
|
ensure_worker_running
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
83
|
+
ignore_error = false
|
84
|
+
if
|
85
|
+
!error.exception.nil? &&
|
86
|
+
!error.exception.type.nil? &&
|
87
|
+
!error.exception.message.nil?
|
88
|
+
then
|
89
|
+
if @hostinfo_response.key?("ignoreExceptionPatterns")
|
90
|
+
@hostinfo_response['ignoreExceptionPatterns'].each do |k, v|
|
91
|
+
if error.exception.type.match(k)
|
92
|
+
exception_values = v
|
93
|
+
if exception_values.length == 0
|
94
|
+
ignore_error = true
|
95
|
+
else
|
96
|
+
exception_values.each do |value|
|
97
|
+
if error.exception.message.include?(value)
|
98
|
+
ignore_error = true
|
99
|
+
end
|
100
|
+
end
|
101
|
+
end
|
102
|
+
break
|
103
|
+
end
|
104
|
+
end
|
105
|
+
end
|
106
|
+
end
|
107
|
+
if ignore_error == false
|
108
|
+
@errors_lock.synchronize do
|
109
|
+
if @errors_aggs.length < 20
|
110
|
+
@errors_aggs.push(error)
|
111
|
+
else
|
112
|
+
i = rand(20)
|
113
|
+
@errors_aggs[i] = error
|
114
|
+
end
|
89
115
|
end
|
90
116
|
end
|
91
117
|
end
|
@@ -156,6 +182,19 @@ module Atatus
|
|
156
182
|
return
|
157
183
|
end
|
158
184
|
|
185
|
+
ignore_txn = false
|
186
|
+
if @hostinfo_response.key?("ignoreTxnNamePatterns")
|
187
|
+
@hostinfo_response['ignoreTxnNamePatterns'].each do |k|
|
188
|
+
if txn.name.match(k)
|
189
|
+
ignore_txn = true
|
190
|
+
break
|
191
|
+
end
|
192
|
+
end
|
193
|
+
end
|
194
|
+
if ignore_txn == true
|
195
|
+
return
|
196
|
+
end
|
197
|
+
|
159
198
|
return if txn.name.empty?
|
160
199
|
return if txn.duration <= 0
|
161
200
|
|
@@ -296,25 +335,44 @@ module Atatus
|
|
296
335
|
!txn.context.response.status_code.nil?
|
297
336
|
then
|
298
337
|
status_code = txn.context.response.status_code.to_i
|
299
|
-
|
338
|
+
ignore_status_code = false
|
300
339
|
if status_code >= 400 && status_code != 404
|
301
|
-
if
|
302
|
-
@
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
340
|
+
if @hostinfo_response.key?("ignoreHTTPFailurePatterns")
|
341
|
+
@hostinfo_response['ignoreHTTPFailurePatterns'].each do |k, v|
|
342
|
+
if txn.name.match(k)
|
343
|
+
status_code_array_s = v
|
344
|
+
if status_code_array_s.length == 0
|
345
|
+
ignore_status_code = true
|
346
|
+
else
|
347
|
+
status_code_array_s.each do |code|
|
348
|
+
if code == txn.context.response.status_code.to_s
|
349
|
+
ignore_status_code = true
|
350
|
+
end
|
351
|
+
end
|
352
|
+
end
|
353
|
+
break
|
354
|
+
end
|
308
355
|
end
|
309
356
|
end
|
357
|
+
if ignore_status_code == false
|
358
|
+
if !@error_metrics_agg.key?(txn.name)
|
359
|
+
@error_metrics_agg[txn.name] = {status_code => 1}
|
360
|
+
else
|
361
|
+
if !@error_metrics_agg[txn.name].key?(status_code)
|
362
|
+
@error_metrics_agg[txn.name][status_code] = 1
|
363
|
+
else
|
364
|
+
@error_metrics_agg[txn.name][status_code] += 1
|
365
|
+
end
|
366
|
+
end
|
310
367
|
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
368
|
+
trace_id = ""
|
369
|
+
trace_id = txn.trace_id if !txn.trace_id.nil?
|
370
|
+
if @error_requests_agg.length < 20
|
371
|
+
@error_requests_agg.push({'name' => txn.name, 'txn_id' => txn.id, 'trace_id' => trace_id, 'context' => txn.context})
|
372
|
+
else
|
373
|
+
i = rand(20)
|
374
|
+
@error_requests_agg[i] = {'name' => txn.name, 'txn_id' => txn.id, 'trace_id' => trace_id, 'context' => txn.context}
|
375
|
+
end
|
318
376
|
end
|
319
377
|
end
|
320
378
|
end
|
@@ -356,7 +414,7 @@ module Atatus
|
|
356
414
|
end
|
357
415
|
|
358
416
|
if @collect_counter % 30 == 0
|
359
|
-
@transport.hostinfo(start_time)
|
417
|
+
@hostinfo_response = @transport.hostinfo(start_time)
|
360
418
|
@collect_counter = 0
|
361
419
|
end
|
362
420
|
@collect_counter += 1
|
@@ -30,11 +30,13 @@ module Atatus
|
|
30
30
|
|
31
31
|
@blocked = false
|
32
32
|
@capture_percentiles = false
|
33
|
+
@hostinfo_response = {}
|
33
34
|
end
|
34
35
|
|
35
36
|
def hostinfo(start_time)
|
36
37
|
payload = @builder.hostinfo(start_time)
|
37
38
|
post(HOSTINFO_ENDPOINT, payload)
|
39
|
+
@hostinfo_response
|
38
40
|
end
|
39
41
|
|
40
42
|
def txns(start_time, end_time, data)
|
@@ -109,7 +111,25 @@ module Atatus
|
|
109
111
|
if resp
|
110
112
|
if resp.key?("capturePercentiles")
|
111
113
|
@capture_percentiles = resp["capturePercentiles"]
|
114
|
+
@hostinfo_response['capturePercentiles'] = @capture_percentiles
|
112
115
|
end
|
116
|
+
|
117
|
+
if resp.key?("extRequestPatterns")
|
118
|
+
@hostinfo_response['extRequestPatterns'] = resp["extRequestPatterns"]
|
119
|
+
end
|
120
|
+
|
121
|
+
if resp.key?("ignoreTxnNamePatterns")
|
122
|
+
@hostinfo_response['ignoreTxnNamePatterns'] = resp["ignoreTxnNamePatterns"]
|
123
|
+
end
|
124
|
+
|
125
|
+
if resp.key?("ignoreHTTPFailurePatterns")
|
126
|
+
@hostinfo_response['ignoreHTTPFailurePatterns'] = resp["ignoreHTTPFailurePatterns"]
|
127
|
+
end
|
128
|
+
|
129
|
+
if resp.key?("ignoreExceptionPatterns")
|
130
|
+
@hostinfo_response['ignoreExceptionPatterns'] = resp["ignoreExceptionPatterns"]
|
131
|
+
end
|
132
|
+
|
113
133
|
end
|
114
134
|
else
|
115
135
|
true
|
data/lib/atatus/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: atatus
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.6.
|
4
|
+
version: 1.6.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Atatus
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-01-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: concurrent-ruby
|