elastic-apm 0.4.2 → 0.4.3
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 +4 -4
- data/lib/elastic_apm/stacktrace.rb +24 -9
- data/lib/elastic_apm/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: 2048d68aba066259b3448d694b4114bc2eb9d28ed089ed1b1ed58315204454ca
|
4
|
+
data.tar.gz: 2450babb2527f469cfe7d64ddfae2a9483e6af33a2275ef658b49a59c8107896
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c4ab0f4a603297e34e2b7d266557f34476c12ab840fa4d4a214315df2ac960977890a7d9125db3c42486abf834ced00a2b1ffce9b76e341034d2cb10e7a83ec1
|
7
|
+
data.tar.gz: 69263285fb5c5fc9385666768235ae2a7c06a5824d089e22d3e212fe2d6a331429d5b0f206765cf3c7512aa91327dd15e0512e677e729820f920651f185813bf
|
@@ -6,7 +6,11 @@ require 'elastic_apm/stacktrace/line_cache'
|
|
6
6
|
module ElasticAPM
|
7
7
|
# @api private
|
8
8
|
class Stacktrace
|
9
|
-
|
9
|
+
JAVA_FORMAT = /^(.+)\.([^\.]+)\(([^\:]+)\:(\d+)\)$/
|
10
|
+
RUBY_FORMAT = /^(.+?):(\d+)(?::in `(.+?)')?$/
|
11
|
+
|
12
|
+
RUBY_VERS_REGEX = %r{ruby[-/](\d+\.)+\d}
|
13
|
+
JRUBY_ORG_REGEX = %r{org/jruby}
|
10
14
|
|
11
15
|
def initialize(backtrace)
|
12
16
|
@backtrace = backtrace
|
@@ -38,9 +42,6 @@ module ElasticAPM
|
|
38
42
|
|
39
43
|
private
|
40
44
|
|
41
|
-
JAVA_FORMAT = /^(.+)\.([^\.]+)\(([^\:]+)\:(\d+)\)$/
|
42
|
-
RUBY_FORMAT = /^(.+?):(\d+)(?::in `(.+?)')?$/
|
43
|
-
|
44
45
|
def parse_line(line)
|
45
46
|
ruby_match = line.match(RUBY_FORMAT)
|
46
47
|
|
@@ -56,24 +57,38 @@ module ElasticAPM
|
|
56
57
|
[file, number, method, module_name]
|
57
58
|
end
|
58
59
|
|
59
|
-
|
60
|
+
def library_frame?(config, abs_path)
|
61
|
+
return false unless abs_path
|
62
|
+
|
63
|
+
if abs_path.start_with?(config.root_path)
|
64
|
+
return true if abs_path.match(config.root_path + '/vendor')
|
65
|
+
return false
|
66
|
+
end
|
67
|
+
|
68
|
+
return true if abs_path.match(RUBY_VERS_REGEX)
|
69
|
+
return true if abs_path.match(JRUBY_ORG_REGEX)
|
70
|
+
|
71
|
+
false
|
72
|
+
end
|
73
|
+
|
74
|
+
# rubocop:disable Metrics/MethodLength
|
60
75
|
def build_frame(config, line, type)
|
61
76
|
abs_path, lineno, function, _module_name = parse_line(line)
|
62
|
-
library_frame = !(abs_path && abs_path.start_with?(config.root_path))
|
63
77
|
|
64
78
|
frame = Frame.new
|
65
79
|
frame.abs_path = abs_path
|
66
80
|
frame.filename = strip_load_path(abs_path)
|
67
81
|
frame.function = function
|
68
82
|
frame.lineno = lineno.to_i
|
69
|
-
frame.library_frame = library_frame
|
83
|
+
frame.library_frame = library_frame?(config, abs_path)
|
70
84
|
|
71
|
-
line_count =
|
85
|
+
line_count =
|
86
|
+
context_lines_for(config, type, library_frame: frame.library_frame)
|
72
87
|
frame.build_context line_count
|
73
88
|
|
74
89
|
frame
|
75
90
|
end
|
76
|
-
# rubocop:enable Metrics/
|
91
|
+
# rubocop:enable Metrics/MethodLength
|
77
92
|
|
78
93
|
def strip_load_path(path)
|
79
94
|
return nil unless path
|
data/lib/elastic_apm/version.rb
CHANGED
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.4.
|
4
|
+
version: 0.4.3
|
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-02-
|
11
|
+
date: 2018-02-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|