atatus 1.2.0 → 1.3.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d6399d781fb6ed0fbf4d275871f8badd44feef60f0579fb98395471d837ab0a2
4
- data.tar.gz: 0da5efde082affe391be507829d4cfb2eac79e9e7d87e35143e86857167f2407
3
+ metadata.gz: 2602d9c1f9bd2eb164f36638cc774cbad5618f362a342be4f33b04c33b83b848
4
+ data.tar.gz: 20446fd8e0a732c8361a523d84ad3af68f4ae0a93e177773bd8f20350a58a2d0
5
5
  SHA512:
6
- metadata.gz: 9332acfc6e05a1627e05e98dcf9ab3bfee8c7e111f1ccc41300340b54650e5d56145a0cbc46da4f07bd4b2084cc4af0e57ccdadf55831d6732309d573dd8eb78
7
- data.tar.gz: b0570c4ea30150e82bdaaf1f61939ec405205a96e3808654bb3e2aaf5a156a0f25d825038c19286ca9d3774175ad5568156baa43fb5cd08b98703e3eeb55eb13
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 = 'custom'
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
 
@@ -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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Atatus
4
- VERSION = '1.2.0'
4
+ VERSION = '1.3.0'
5
5
  end
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.2.0
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-01-21 00:00:00.000000000 Z
11
+ date: 2020-03-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: concurrent-ruby