atatus 1.2.0 → 1.3.0
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/lib/atatus/span.rb +3 -2
- data/lib/atatus/span_helpers.rb +16 -7
- 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: 2602d9c1f9bd2eb164f36638cc774cbad5618f362a342be4f33b04c33b83b848
|
4
|
+
data.tar.gz: 20446fd8e0a732c8361a523d84ad3af68f4ae0a93e177773bd8f20350a58a2d0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2d0f3386ee29b3785096f9832bbae6a4d73e374cc1c5b181a98baafc3f12a52bb67ab82d1d183850459ac8b67f96250a3cba3475ca1fd6527f6f176d44091f41
|
7
|
+
data.tar.gz: 446edc9f0c6bf1c636592bc256807aea85261be9ec53008657df658ca3a5d7d179b0731cf74462ec4e0b0a29562dc878bfda84b0e7587ba84ea4babff48cc97b
|
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
|
+
|
8
|
+
## 1.3.0 (Wed, 18 Mar 2020)
|
9
|
+
|
10
|
+
- Added custom instrumentation via annotate method.
|
11
|
+
|
12
|
+
|
7
13
|
## 1.2.0 (Tue, 21 Jan 2020)
|
8
14
|
|
9
15
|
- Updated Sidekiq operation as background transaction.
|
data/lib/atatus/span.rb
CHANGED
@@ -12,7 +12,8 @@ module Atatus
|
|
12
12
|
|
13
13
|
def_delegators :@trace_context, :trace_id, :parent_id, :id
|
14
14
|
|
15
|
-
DEFAULT_TYPE = '
|
15
|
+
DEFAULT_TYPE = 'Custom'
|
16
|
+
DEFAULT_SUBTYPE = 'Ruby'
|
16
17
|
|
17
18
|
# rubocop:disable Metrics/ParameterLists, Metrics/MethodLength
|
18
19
|
def initialize(
|
@@ -31,7 +32,7 @@ module Atatus
|
|
31
32
|
@type, @subtype, @action = type.split('.')
|
32
33
|
else
|
33
34
|
@type = type || DEFAULT_TYPE
|
34
|
-
@subtype = subtype
|
35
|
+
@subtype = subtype || DEFAULT_SUBTYPE
|
35
36
|
@action = action
|
36
37
|
end
|
37
38
|
|
data/lib/atatus/span_helpers.rb
CHANGED
@@ -5,19 +5,28 @@ module Atatus
|
|
5
5
|
module SpanHelpers
|
6
6
|
# @api private
|
7
7
|
module ClassMethods
|
8
|
-
def span_class_method(method, name = nil, type = nil)
|
9
|
-
__span_method_on(singleton_class, method, name, type)
|
8
|
+
def span_class_method(method, name = nil, type = nil, subtype = nil)
|
9
|
+
__span_method_on(singleton_class, method, name, type, subtype)
|
10
10
|
end
|
11
11
|
|
12
|
-
def span_method(method, name = nil, type = nil)
|
13
|
-
__span_method_on(self, method, name, type)
|
12
|
+
def span_method(method, name = nil, type = nil, subtype = nil)
|
13
|
+
__span_method_on(self, method, name, type, subtype)
|
14
|
+
end
|
15
|
+
|
16
|
+
def instrument_class_method(method, name = nil, type = nil, subtype = nil)
|
17
|
+
__span_method_on(singleton_class, method, name, type, subtype)
|
18
|
+
end
|
19
|
+
|
20
|
+
def instrument_method(method, name = nil, type = nil, subtype = nil)
|
21
|
+
__span_method_on(self, method, name, type, subtype)
|
14
22
|
end
|
15
23
|
|
16
24
|
private
|
17
25
|
|
18
|
-
def __span_method_on(klass, method, name = nil, type = nil)
|
26
|
+
def __span_method_on(klass, method, name = nil, type = nil, subtype = nil)
|
19
27
|
name ||= method.to_s
|
20
28
|
type ||= Span::DEFAULT_TYPE
|
29
|
+
subtype ||= Span::DEFAULT_SUBTYPE
|
21
30
|
|
22
31
|
klass.class_eval <<-RUBY, __FILE__, __LINE__ + 1
|
23
32
|
alias :"__without_apm_#{method}" :"#{method}"
|
@@ -27,7 +36,7 @@ module Atatus
|
|
27
36
|
return __without_apm_#{method}(*args, &block)
|
28
37
|
end
|
29
38
|
|
30
|
-
Atatus.with_span "#{name}", "#{type}" do
|
39
|
+
Atatus.with_span "#{name}", "#{type}", subtype: "#{subtype}" do
|
31
40
|
__without_apm_#{method}(*args, &block)
|
32
41
|
end
|
33
42
|
end
|
@@ -41,4 +50,4 @@ module Atatus
|
|
41
50
|
end
|
42
51
|
end
|
43
52
|
end
|
44
|
-
end
|
53
|
+
end
|
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.
|
4
|
+
version: 1.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Atatus
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-03-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: concurrent-ruby
|