elastic-apm 1.0.1 → 1.0.2

Sign up to get free protection for your applications and to get access to all the features.

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: e445ae7019c027e5e0b9e18aeb36b6bb646c650175d32389dee1cfafe2a274bc
4
- data.tar.gz: d5868c15d2844076b6abea3ce55c90e10183cfba812116bc95293a26f09dfad5
3
+ metadata.gz: 5cf86b8835f2524fc990aad795d4f2f4fc8a4ed3c3742436649f5ceb44b96c82
4
+ data.tar.gz: c0a0a828cdd4f4eb0306131bb5b12d423e519bd57c0f19420928299505c08f03
5
5
  SHA512:
6
- metadata.gz: 77fe20eda7fe120cbe7a4ff6b295cc5e5229a3f08be1373c9a4b5196a9dd355d48932acc157999ce1f4e8af777938054412bb3de9af2cd6bcf4ddca23058e8d4
7
- data.tar.gz: a3c1627c60684229f7aae7379910d8ef21799ed7e05923e86cca819d7a77f4c85a43f31c003713dcafd84694d60fd474f084d7329ebaae0330a7f43c27c3508b
6
+ metadata.gz: b404e23f7056ece4ee3603a91e3d1f95894fb0ed62a32e7bbccf8a83ed462e17afc99073fa36ef317e430a13dce343396e1059a28b1d03c4497070f992e4133f
7
+ data.tar.gz: 667f2932cf52bd2eaeeb4dbdd7c37fb183ab9e78f49eafa7dfa004f16b3361dd9d71183648ab40aee996d9e4c04d8f789298acc872de2f532173ab579eb4882e
@@ -4,20 +4,28 @@ 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
- ## Unreleased
7
+ ## 1.0.2 (2018-09-07)
8
8
 
9
+ ### Added
10
+
11
+ - Rake task instrumentation ([#192](https://github.com/elastic/apm-agent-ruby/pull/192))
12
+ - `default_tags` option ([#183](https://github.com/elastic/apm-agent-ruby/pull/183))
13
+
14
+ ### Fixed
15
+
16
+ - Fallback from missing JRUBY_VERSION ([#180](https://github.com/elastic/apm-agent-ruby/pull/180))
9
17
 
10
18
  ## 1.0.1 (2018-07-30)
11
19
 
12
20
  ### Fixed
13
21
 
14
- - Fixed internal LRU cache to be threadsafe ([#178](https://github.com/elastic/apm-agent-ruby/pulls/178))
22
+ - Fixed internal LRU cache to be threadsafe ([#178](https://github.com/elastic/apm-agent-ruby/pull/178))
15
23
 
16
24
  ## 1.0.0 (2018-06-29)
17
25
 
18
26
  ### Added
19
27
 
20
- - Added config.disable_send ([#156](https://github.com/elastic/apm-agent-ruby/pulls/156))
28
+ - Added config.disable_send ([#156](https://github.com/elastic/apm-agent-ruby/pull/156))
21
29
 
22
30
  ### Changed
23
31
 
@@ -25,14 +33,14 @@ This project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html
25
33
 
26
34
  ### Fixed
27
35
 
28
- - Fixed some Elasticsearch spans not validating JSON Schema ([#157](https://github.com/elastic/apm-agent-ruby/pulls/157))
36
+ - Fixed some Elasticsearch spans not validating JSON Schema ([#157](https://github.com/elastic/apm-agent-ruby/pull/157))
29
37
 
30
38
  ## 0.8.0 (2018-06-13)
31
39
 
32
40
  ### Added
33
41
 
34
- - Added an option to disable metrics collection ([#145](https://github.com/elastic/apm-agent-ruby/pulls/145))
35
- - Filters can cancel the entire payload by returning `nil` ([#148](https://github.com/elastic/apm-agent-ruby/pulls/148))
42
+ - Added an option to disable metrics collection ([#145](https://github.com/elastic/apm-agent-ruby/pull/145))
43
+ - Filters can cancel the entire payload by returning `nil` ([#148](https://github.com/elastic/apm-agent-ruby/pull/148))
36
44
  - Added `ENV` version of the logging options ([#146](https://github.com/elastic/apm-agent-ruby/pull/146))
37
45
  - Added `config.ignore_url_patterns` ([#151](https://github.com/elastic/apm-agent-ruby/pull/151))
38
46
 
data/Gemfile CHANGED
@@ -12,6 +12,7 @@ gem 'json-schema'
12
12
  gem 'mongo'
13
13
  gem 'pry'
14
14
  gem 'rack-test'
15
+ gem 'rake'
15
16
  gem 'redis', require: nil
16
17
  gem 'rspec'
17
18
  gem 'rubocop'
@@ -42,7 +42,11 @@ def do_bench(transaction_count: 10, **config)
42
42
  bench = Benchmark.benchmark(CAPTION, 7, FORMAT, 'avg:') do |x|
43
43
  benchmarks =
44
44
  with_app(config) do |app|
45
- 10.times.map do |i|
45
+ # warm-up
46
+ puts "1 run of warm-up"
47
+ perform(app, count: transaction_count)
48
+
49
+ 5.times.map do |i|
46
50
  x.report("run[#{i}]") { perform(app, count: transaction_count) }
47
51
  end
48
52
  end
@@ -51,7 +55,7 @@ def do_bench(transaction_count: 10, **config)
51
55
  end
52
56
  end
53
57
 
54
- transaction_count = Integer(ARGV.shift || 10_000)
58
+ transaction_count = Integer(ARGV.shift || 100_000)
55
59
 
56
60
  banner 'Default settings'
57
61
  do_bench transaction_count: transaction_count
@@ -13,8 +13,10 @@ if ELASTICSEARCH_URL == ''
13
13
  puts 'ELASTICSEARCH_URL missing, exiting ...'
14
14
  exit 1
15
15
  else
16
- # debug
17
- # puts ELASTICSEARCH_URL.gsub(/:[^\/]+(.*)@/) { |m| ":#{Array.new(m.length - 2).map { '*' }.join}@" }
16
+ # DEBUG
17
+ # puts ELASTICSEARCH_URL.gsub(/:[^\/]+(.*)@/) do |m|
18
+ # ":#{Array.new(m.length - 2).map { '*' }.join}@"
19
+ # end
18
20
  end
19
21
 
20
22
  CONN = Faraday.new(url: ELASTICSEARCH_URL) do |f|
@@ -35,30 +37,31 @@ titles = input.grep(/^===/).map { |t| t.gsub(/^=== /, '') }
35
37
  counts = input.grep(/^Count: /).map { |a| a.gsub(/^Count: /, '').to_i }
36
38
  averages = input.grep(/^avg/).map { |a| a.match(/\((.+)\)/)[1].to_f }
37
39
 
38
- git_sha, git_date, git_msg = `git log -n 1 --pretty="format:%H|||%ai|||%s"`.split('|||')
39
- git_date ||= Time.new.iso8601
40
- git_branch = `git branch | grep '\*' | awk '{print $2}'`
40
+ git_sha, git_msg = `git log -n 1 --pretty="format:%H|||%s"`.split('|||')
41
+ git_date = `git log -n 1 --pretty="format:%ai"`
41
42
  platform = Gem::Platform.local
42
43
 
43
44
  payloads = titles.zip(averages, counts).map do |(title, avg, count)|
45
+ return nil unless avg
46
+
44
47
  {
45
48
  title: title,
46
49
  avg: avg,
47
50
  transaction_count: count,
48
51
  executed_at: Time.new.iso8601,
49
52
  'git.commit' => git_sha,
50
- 'git.date' => Time.parse(git_date).iso8601,
53
+ 'git.date' => String(git_date).strip != '' && Time.parse(git_date).iso8601,
51
54
  'git.subject' => git_msg,
52
- 'git.branch' => git_branch,
53
55
  hostname: `hostname`.chomp,
54
56
  engine: RUBY_ENGINE,
55
57
  arch: platform.cpu,
56
58
  os: platform.os,
57
- ruby_version: RUBY_VERSION
59
+ ruby_version: "#{RUBY_ENGINE == 'jruby' ? 'j' : ''}#{RUBY_VERSION}"
58
60
  }
59
- end
61
+ end.compact
60
62
 
61
63
  puts '=== Reporting to ES'
64
+ puts payloads.inspect
62
65
 
63
66
  payloads.each do |payload|
64
67
  result = CONN.post('/benchmark-ruby/_doc') do |req|
@@ -208,6 +208,8 @@ Arguments:
208
208
 
209
209
  Returns the set `value`.
210
210
 
211
+ WARNING: Be aware that tags are indexed in Elasticsearch. Using too many unique keys will result in *https://www.elastic.co/blog/found-crash-elasticsearch#mapping-explosion[Mapping explosion]*.
212
+
211
213
  [float]
212
214
  [[api-agent-set-custom-context]]
213
215
  ==== `ElasticAPM.set_custom_context`
@@ -389,6 +389,32 @@ Use this option to disable any of these.
389
389
 
390
390
  Get an array of enabled spies with `ElasticAPM.agent.config.enabled_spies`.
391
391
 
392
+ [float]
393
+ [[config-instrumented-rake-tasks]]
394
+ ==== `instrumented_rake_tasks`
395
+
396
+ [options="header"]
397
+ |============
398
+ | Environment | `Config` key | Default | Example
399
+ | `ELASTIC_APM_INSTRUMENTED_RAKE_TASKS` | `instrumented_rake_tasks` | `[]` | `['my_task']`
400
+ |============
401
+
402
+ Elastic APM can instrument your Rake tasks but given that they are used for a multitude of sometimes very different and not always relevant things, this is opt in.
403
+
404
+ [float]
405
+ [[config-default-tags]]
406
+ ==== `default_tags`
407
+
408
+ [options="header"]
409
+ |============
410
+ | Environment | `Config` key | Default | Example
411
+ | `ELASTIC_APM_DEFAULT_TAGS` | `default_tags` | `{}` | `region=us1`
412
+ |============
413
+
414
+ Add default tags to add to every transaction.
415
+
416
+ WARNING: Be aware that tags are indexed in Elasticsearch. Using too many unique keys will result in *https://www.elastic.co/blog/found-crash-elasticsearch#mapping-explosion[Mapping explosion]*.
417
+
392
418
  [float]
393
419
  [[config-custom-key-filters]]
394
420
  ==== `custom_key_filters`
@@ -5,7 +5,7 @@ ifdef::env-github[]
5
5
  NOTE: For the best reading experience, please view this documentation at https://www.elastic.co/guide/en/apm/agent/ruby[elastic.co]
6
6
  endif::[]
7
7
 
8
- = APM Ruby Agent Reference (Beta)
8
+ = APM Ruby Agent Reference
9
9
 
10
10
  [[introduction]]
11
11
  == Introduction
@@ -31,6 +31,7 @@ include::./configuration.asciidoc[]
31
31
  == Advanced Topics
32
32
  include::./context.asciidoc[]
33
33
  include::./custom-instrumentation.asciidoc[]
34
+ include::./troubleshooting.asciidoc[]
34
35
 
35
36
  include::./api.asciidoc[]
36
37
 
@@ -0,0 +1,28 @@
1
+ [[debugging]]
2
+ === Debugging APM
3
+
4
+ The agent not working for you? There are a few settings that might help:
5
+
6
+ [float]
7
+ [[debugging-debug-transactions]]
8
+ ==== `debug_transactions`
9
+
10
+ [options="header"]
11
+ |============
12
+ | Environment | `Config` key | Default
13
+ | `ELASTIC_APM_DEBUG_TRANSACTIONS` | `debug_transactions` | `false`
14
+ |============
15
+
16
+ When on, Elastic APM will log a summary of each transaction when submitted.
17
+
18
+ [float]
19
+ [[debugging-debug-http]]
20
+ ==== `debug_http`
21
+
22
+ [options="header"]
23
+ |============
24
+ | Environment | `Config` key | Default
25
+ | `ELASTIC_APM_DEBUG_HTTP` | `debug_http` | `false`
26
+ |============
27
+
28
+ When on, Elastic APM will log debug information from all the requests it makes to APM Server.
@@ -132,12 +132,24 @@ module ElasticAPM
132
132
  instrumenter.current_transaction
133
133
  end
134
134
 
135
- def transaction(*args, &block)
136
- instrumenter.transaction(*args, &block)
135
+ def transaction(name = nil, type = nil, context: nil, sampled: nil, &block)
136
+ instrumenter.transaction(
137
+ name,
138
+ type,
139
+ context: context,
140
+ sampled: sampled,
141
+ &block
142
+ )
137
143
  end
138
144
 
139
- def span(*args, &block)
140
- instrumenter.span(*args, &block)
145
+ def span(name, type = nil, backtrace: nil, context: nil, &block)
146
+ instrumenter.span(
147
+ name,
148
+ type,
149
+ backtrace: backtrace,
150
+ context: context,
151
+ &block
152
+ )
141
153
  end
142
154
 
143
155
  def build_context(rack_env)
@@ -167,16 +179,16 @@ module ElasticAPM
167
179
 
168
180
  # context
169
181
 
170
- def set_tag(*args)
171
- instrumenter.set_tag(*args)
182
+ def set_tag(key, value)
183
+ instrumenter.set_tag(key, value)
172
184
  end
173
185
 
174
- def set_custom_context(*args)
175
- instrumenter.set_custom_context(*args)
186
+ def set_custom_context(context)
187
+ instrumenter.set_custom_context(context)
176
188
  end
177
189
 
178
- def set_user(*args)
179
- instrumenter.set_user(*args)
190
+ def set_user(user)
191
+ instrumenter.set_user(user)
180
192
  end
181
193
 
182
194
  def add_filter(key, callback)
@@ -42,6 +42,9 @@ module ElasticAPM
42
42
  span_frames_min_duration: 5,
43
43
 
44
44
  disabled_spies: %w[json],
45
+ instrumented_rake_tasks: [],
46
+
47
+ default_tags: {},
45
48
 
46
49
  current_user_id_method: :id,
47
50
  current_user_email_method: :email,
@@ -95,7 +98,11 @@ module ElasticAPM
95
98
  'ELASTIC_APM_TRANSACTION_MAX_SPANS' => [:int, 'transaction_max_spans'],
96
99
 
97
100
  'ELASTIC_APM_DISABLE_SEND' => [:bool, 'disable_send'],
98
- 'ELASTIC_APM_DISABLED_SPIES' => [:list, 'disabled_spies']
101
+ 'ELASTIC_APM_DISABLED_SPIES' => [:list, 'disabled_spies'],
102
+ 'ELASTIC_APM_INSTRUMENTED_RAKE_TASKS' =>
103
+ [:list, 'instrumented_rake_tasks'],
104
+
105
+ 'ELASTIC_APM_DEFAULT_TAGS' => [:dict, 'default_tags']
99
106
  }.freeze
100
107
 
101
108
  def initialize(options = {})
@@ -153,6 +160,7 @@ module ElasticAPM
153
160
  attr_accessor :span_frames_min_duration
154
161
 
155
162
  attr_accessor :disabled_spies
163
+ attr_accessor :instrumented_rake_tasks
156
164
 
157
165
  attr_accessor :view_paths
158
166
  attr_accessor :root_path
@@ -162,12 +170,14 @@ module ElasticAPM
162
170
  attr_accessor :current_user_email_method
163
171
  attr_accessor :current_user_username_method
164
172
 
173
+ attr_accessor :default_tags
174
+
165
175
  attr_reader :custom_key_filters
166
176
  attr_reader :ignore_url_patterns
167
177
 
168
178
  alias :disable_environment_warning? :disable_environment_warning
169
- alias :verify_server_cert? :verify_server_cert
170
179
  alias :disable_send? :disable_send
180
+ alias :verify_server_cert? :verify_server_cert
171
181
 
172
182
  def app=(app)
173
183
  case app_type?(app)
@@ -182,7 +192,7 @@ module ElasticAPM
182
192
  end
183
193
 
184
194
  def app_type?(app)
185
- if defined?(::Rails) && app.is_a?(Rails::Application)
195
+ if defined?(Rails::Application) && app.is_a?(Rails::Application)
186
196
  return :rails
187
197
  end
188
198
 
@@ -219,6 +229,7 @@ module ElasticAPM
219
229
  sidekiq
220
230
  sinatra
221
231
  tilt
232
+ rake
222
233
  ]
223
234
  end
224
235
  # rubocop:enable Metrics/MethodLength
@@ -252,6 +263,7 @@ module ElasticAPM
252
263
  when :float then value.to_f
253
264
  when :bool then !%w[0 false].include?(value.strip.downcase)
254
265
  when :list then value.split(/[ ,]/)
266
+ when :dict then Hash[value.split('&').map { |kv| kv.split('=') }]
255
267
  else value
256
268
  end
257
269
 
@@ -14,9 +14,9 @@ module ElasticAPM
14
14
  attr_accessor :request, :response, :user
15
15
  attr_reader :custom, :tags
16
16
 
17
- def initialize
18
- @custom = {}
19
- @tags = {}
17
+ def initialize(custom: {}, tags: {})
18
+ @custom = custom
19
+ @tags = tags
20
20
  end
21
21
  end
22
22
  end
@@ -48,11 +48,11 @@ module ElasticAPM
48
48
  end
49
49
 
50
50
  def filter_key?(key)
51
- @key_filters.any? { |regex| key =~ regex }
51
+ @key_filters.any? { |regex| key.match regex }
52
52
  end
53
53
 
54
54
  def filter_value?(value)
55
- VALUE_FILTERS.any? { |regex| value =~ regex }
55
+ VALUE_FILTERS.any? { |regex| value.match regex }
56
56
  end
57
57
  end
58
58
  end
@@ -55,9 +55,9 @@ module ElasticAPM
55
55
  @transaction_info.current = transaction
56
56
  end
57
57
 
58
- # rubocop:disable Metrics/MethodLength, Metrics/AbcSize
59
- # rubocop:disable Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity
60
- def transaction(*args)
58
+ # rubocop:disable Metrics/MethodLength
59
+ # rubocop:disable Metrics/CyclomaticComplexity
60
+ def transaction(name = nil, type = nil, context: nil, sampled: nil)
61
61
  unless config.instrument
62
62
  yield if block_given?
63
63
  return
@@ -68,13 +68,10 @@ module ElasticAPM
68
68
  return transaction
69
69
  end
70
70
 
71
- if args.last.is_a? Hash
72
- args.last[:sampled] = random_sample?
73
- else
74
- args.push(sampled: random_sample?)
75
- end
71
+ sampled = random_sample? if sampled.nil?
76
72
 
77
- transaction = Transaction.new self, *args
73
+ transaction =
74
+ Transaction.new self, name, type, context: context, sampled: sampled
78
75
 
79
76
  self.current_transaction = transaction
80
77
  return transaction unless block_given?
@@ -88,21 +85,29 @@ module ElasticAPM
88
85
 
89
86
  transaction
90
87
  end
91
- # rubocop:enable Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity
92
- # rubocop:enable Metrics/MethodLength, Metrics/AbcSize
88
+ # rubocop:enable Metrics/CyclomaticComplexity
89
+ # rubocop:enable Metrics/MethodLength
93
90
 
94
91
  def random_sample?
95
92
  rand <= config.transaction_sample_rate
96
93
  end
97
94
 
98
- def span(*args, &block)
95
+ # rubocop:disable Metrics/MethodLength
96
+ def span(name, type = nil, backtrace: nil, context: nil, &block)
99
97
  unless current_transaction
100
98
  return yield if block_given?
101
99
  return
102
100
  end
103
101
 
104
- current_transaction.span(*args, &block)
102
+ current_transaction.span(
103
+ name,
104
+ type,
105
+ backtrace: backtrace,
106
+ context: context,
107
+ &block
108
+ )
105
109
  end
110
+ # rubocop:enable Metrics/MethodLength
106
111
 
107
112
  def set_tag(key, value)
108
113
  return unless current_transaction
@@ -16,7 +16,8 @@ module ElasticAPM
16
16
 
17
17
  resp = @app.call env
18
18
 
19
- submit_transaction(transaction, *resp) if transaction
19
+ status, headers, body = resp
20
+ submit_transaction(transaction, status, headers, body) if transaction
20
21
  rescue InternalError
21
22
  raise # Don't report ElasticAPM errors
22
23
  rescue ::Exception => e
@@ -38,7 +39,7 @@ module ElasticAPM
38
39
 
39
40
  def path_ignored?(env)
40
41
  config.ignore_url_patterns.any? do |r|
41
- env['PATH_INFO'] =~ r
42
+ env['PATH_INFO'].match r
42
43
  end
43
44
  end
44
45
 
@@ -10,7 +10,7 @@ module ElasticAPM
10
10
  register 'sql.active_record'
11
11
 
12
12
  def initialize(*args)
13
- super(*args)
13
+ super
14
14
 
15
15
  @type = format('db.%s.sql', lookup_adapter || 'unknown').freeze
16
16
  @summarizer = SqlSummarizer.new
@@ -30,7 +30,7 @@ module ElasticAPM
30
30
  # rubocop:enable Metrics/AbcSize, Metrics/MethodLength
31
31
 
32
32
  def build_all(errors)
33
- { errors: Array(errors).map(&method(:build)) }
33
+ { errors: Array(errors).map { |e| build(e) } }
34
34
  end
35
35
 
36
36
  private
@@ -13,7 +13,7 @@ module ElasticAPM
13
13
  result: transaction.result.to_s,
14
14
  duration: ms(transaction.duration),
15
15
  timestamp: micros_to_time(transaction.timestamp).utc.iso8601(3),
16
- spans: transaction.spans.map(&method(:build_span)),
16
+ spans: transaction.spans.map { |s| build_span(s) },
17
17
  sampled: transaction.sampled,
18
18
  context: transaction.context.to_h
19
19
  }
@@ -27,7 +27,7 @@ module ElasticAPM
27
27
  # rubocop:enable Metrics/AbcSize, Metrics/MethodLength
28
28
 
29
29
  def build_all(transactions)
30
- { transactions: Array(transactions).map(&method(:build)) }
30
+ { transactions: Array(transactions).map { |t| build(t) } }
31
31
  end
32
32
 
33
33
  private
@@ -45,9 +45,9 @@ module ElasticAPM
45
45
  def runtime
46
46
  case RUBY_ENGINE
47
47
  when 'ruby'
48
- { name: RUBY_ENGINE, version: RUBY_VERSION }
48
+ { name: RUBY_ENGINE, version: RUBY_VERSION || RUBY_ENGINE_VERSION }
49
49
  when 'jruby'
50
- { name: RUBY_ENGINE, version: ENV['JRUBY_VERSION'] }
50
+ { name: RUBY_ENGINE, version: JRUBY_VERSION || RUBY_ENGINE_VERSION }
51
51
  end
52
52
  end
53
53
  end
@@ -0,0 +1,46 @@
1
+ # frozen_string_literal: true
2
+
3
+ module ElasticAPM
4
+ # @api private
5
+ module Spies
6
+ # @api private
7
+ class RakeSpy
8
+ # rubocop:disable Metrics/AbcSize, Metrics/MethodLength
9
+ # rubocop:disable Metrics/CyclomaticComplexity
10
+ def install
11
+ ::Rake::Task.class_eval do
12
+ alias execute_without_apm execute
13
+
14
+ def execute(*args)
15
+ agent = ElasticAPM.start
16
+
17
+ unless agent && agent.config.instrumented_rake_tasks.include?(name)
18
+ return execute_without_apm(*args)
19
+ end
20
+
21
+ transaction = ElasticAPM.transaction("Rake::Task[#{name}]", 'Rake')
22
+
23
+ begin
24
+ result = execute_without_apm(*args)
25
+
26
+ transaction.submit('success') if transaction
27
+ rescue StandardError => e
28
+ transaction.submit(:error) if transaction
29
+ ElasticAPM.report(e)
30
+
31
+ raise
32
+ ensure
33
+ transaction.release if transaction
34
+ ElasticAPM.stop
35
+ end
36
+
37
+ result
38
+ end
39
+ end
40
+ end
41
+ # rubocop:enable Metrics/CyclomaticComplexity
42
+ # rubocop:enable Metrics/AbcSize, Metrics/MethodLength
43
+ end
44
+ register 'Rake::Task', 'rake', RakeSpy.new
45
+ end
46
+ end
@@ -29,6 +29,7 @@ module ElasticAPM
29
29
  @notifications = [] # for AS::Notifications
30
30
 
31
31
  @context = context || Context.new
32
+ @context.tags.merge!(instrumenter.config.default_tags) { |_, old, _| old }
32
33
 
33
34
  @sampled = sampled
34
35
 
@@ -85,7 +85,7 @@ module ElasticAPM
85
85
  raise if e.name && !(camel_cased_word.to_s.split("::").include?(e.name.to_s) ||
86
86
  e.name.to_s == camel_cased_word.to_s)
87
87
  rescue ArgumentError => e
88
- raise unless /not missing constant #{const_regexp(camel_cased_word)}!$/.match?(e.message)
88
+ raise unless /not missing constant #{const_regexp(camel_cased_word)}!$/.match(e.message)
89
89
  end
90
90
  end
91
91
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ElasticAPM
4
- VERSION = '1.0.1'.freeze
4
+ VERSION = '1.0.2'.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: 1.0.1
4
+ version: 1.0.2
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-07-30 00:00:00.000000000 Z
11
+ date: 2018-09-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: concurrent-ruby
@@ -60,6 +60,7 @@ files:
60
60
  - docs/getting-started-rack.asciidoc
61
61
  - docs/getting-started-rails.asciidoc
62
62
  - docs/index.asciidoc
63
+ - docs/troubleshooting.asciidoc
63
64
  - elastic-apm.gemspec
64
65
  - lib/elastic-apm.rb
65
66
  - lib/elastic_apm.rb
@@ -106,6 +107,7 @@ files:
106
107
  - lib/elastic_apm/spies/json.rb
107
108
  - lib/elastic_apm/spies/mongo.rb
108
109
  - lib/elastic_apm/spies/net_http.rb
110
+ - lib/elastic_apm/spies/rake.rb
109
111
  - lib/elastic_apm/spies/redis.rb
110
112
  - lib/elastic_apm/spies/sequel.rb
111
113
  - lib/elastic_apm/spies/sidekiq.rb