elastic-apm 0.5.0 → 0.5.1

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.

Potentially problematic release.


This version of elastic-apm might be problematic. Click here for more details.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 98b3dde3453861c6e77db385bea9d0bd54c6d76dd2cb8dd253c046a4f42beb8c
4
- data.tar.gz: a1b948919538e6e5c3eecd1db3fc6bcccff95eef8be335c7cc8913183b47f9fc
3
+ metadata.gz: 2efd1832264da2eb5036fdbf6b3fcb26e47b0f3272779caed2d92c8315a0db7a
4
+ data.tar.gz: c9f91f38ae3433566cdc16584ee862e7c8ac7f364c0fd05879c96ef87a6406d5
5
5
  SHA512:
6
- metadata.gz: d454b1c732c8acc5b2e5ce5cb1b3d5243f563cd0697ae126a104a9bd1c1be8c9b1adbdcadc50d45e9c9e6e9e31aebb6ed6dfc74e68620d859d591d4b7597e9aa
7
- data.tar.gz: 77b6649b0b80b2a1294e1d628cee48b47db707c688766fa517ad2e360ae88ae9ff75645f8b8d9fe50a69afb17dd4f15f94e2c7320c5a5521dd9333dc3360c82d
6
+ metadata.gz: 29c6d93909f2726527d09a62345ef920aba5b301a0fef1bd72e7739e2ace645afb22fd73039360e321e1d2cf68ac26745341deeada4f2e2aeb37e5f7bd3d70d3
7
+ data.tar.gz: 48e84149066cb00fd66f2dc03d275626e7b4a9750b1cd97c6530f5cbf0c7d70f1fade887b228ad9d6e178f5e51c7225673e0f0a1a97a2ffe25dae9cab44721df
@@ -42,7 +42,7 @@ module ElasticAPM
42
42
  source_lines_error_library_frames: 0,
43
43
  source_lines_span_library_frames: 0,
44
44
 
45
- enabled_injectors: %w[net_http],
45
+ disabled_injectors: %w[],
46
46
 
47
47
  current_user_id_method: :id,
48
48
  current_user_email_method: :email,
@@ -78,7 +78,9 @@ module ElasticAPM
78
78
  'ELASTIC_APM_TRANSACTION_SAMPLE_RATE' =>
79
79
  [:float, 'transaction_sample_rate'],
80
80
  'ELASTIC_APM_VERIFY_SERVER_CERT' => [:bool, 'verify_server_cert'],
81
- 'ELASTIC_APM_TRANSACTION_MAX_SPANS' => [:int, 'transaction_max_spans']
81
+ 'ELASTIC_APM_TRANSACTION_MAX_SPANS' => [:int, 'transaction_max_spans'],
82
+
83
+ 'ELASTIC_APM_DISABLED_INJECTORS' => [:list, 'disabled_injectors']
82
84
  }.freeze
83
85
 
84
86
  def initialize(options = {})
@@ -125,7 +127,7 @@ module ElasticAPM
125
127
  attr_accessor :source_lines_error_library_frames
126
128
  attr_accessor :source_lines_span_library_frames
127
129
 
128
- attr_accessor :enabled_injectors
130
+ attr_accessor :disabled_injectors
129
131
 
130
132
  attr_accessor :view_paths
131
133
  attr_accessor :root_path
@@ -171,6 +173,27 @@ module ElasticAPM
171
173
  @logger = logger || build_logger(log_path, log_level)
172
174
  end
173
175
 
176
+ # rubocop:disable Metrics/MethodLength
177
+ def available_injectors
178
+ %w[
179
+ action_dispatch
180
+ delayed_job
181
+ elasticsearch
182
+ json
183
+ net_http
184
+ redis
185
+ sequel
186
+ sidekiq
187
+ sinatra
188
+ tilt
189
+ ]
190
+ end
191
+ # rubocop:enable Metrics/MethodLength
192
+
193
+ def enabled_injectors
194
+ available_injectors - disabled_injectors
195
+ end
196
+
174
197
  private
175
198
 
176
199
  def assign(options)
@@ -217,7 +240,6 @@ module ElasticAPM
217
240
  self.service_name = format_name(service_name || app.to_s)
218
241
  self.framework_name = framework_name || 'Sinatra'
219
242
  self.framework_version = framework_version || Sinatra::VERSION
220
- self.enabled_injectors += %w[sinatra]
221
243
  self.root_path = Dir.pwd
222
244
  end
223
245
 
@@ -1,7 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'net/http'
4
-
5
3
  module ElasticAPM
6
4
  # @api private
7
5
  module Injectors
@@ -48,5 +48,12 @@ module ElasticAPM
48
48
  def running?
49
49
  relative_start && !done?
50
50
  end
51
+
52
+ def inspect
53
+ "<ElasticAPM::Span id:#{id}" \
54
+ " name:#{name.inspect}" \
55
+ " type:#{type.inspect}" \
56
+ '>'
57
+ end
51
58
  end
52
59
  end
@@ -42,7 +42,7 @@ module ElasticAPM
42
42
  return cached
43
43
  end
44
44
 
45
- LineCache.set(path, range, File.readlines(path)[range])
45
+ LineCache.set(path, range, File.readlines(path)[range]) || []
46
46
  rescue Errno::ENOENT
47
47
  []
48
48
  end
@@ -112,7 +112,10 @@ module ElasticAPM
112
112
  end
113
113
 
114
114
  def inspect
115
- "<ElasticAPM::Transaction id:#{id}>"
115
+ "<ElasticAPM::Transaction id:#{id}" \
116
+ " name:#{name.inspect}" \
117
+ " type:#{type.inspect}" \
118
+ '>'
116
119
  end
117
120
 
118
121
  private
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ElasticAPM
4
- VERSION = '0.5.0'.freeze
4
+ VERSION = '0.5.1'.freeze
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: elastic-apm
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mikkel Malmberg
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-03-23 00:00:00.000000000 Z
11
+ date: 2018-03-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport