elastic-apm 3.4.0 → 3.9.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.ci/.jenkins_exclude.yml +39 -20
- data/.ci/.jenkins_framework.yml +2 -2
- data/.ci/Jenkinsfile +286 -170
- data/.ci/docker/jruby/11-jdk/Dockerfile +40 -0
- data/.ci/docker/jruby/12-jdk/Dockerfile +40 -0
- data/.ci/docker/jruby/13-jdk/Dockerfile +40 -0
- data/.ci/docker/jruby/7-jdk/Dockerfile +40 -0
- data/.ci/docker/jruby/8-jdk/Dockerfile +40 -0
- data/.ci/docker/jruby/README.md +31 -0
- data/.ci/docker/jruby/run.sh +73 -0
- data/.ci/docker/jruby/test.sh +13 -0
- data/.ci/jobs/defaults.yml +1 -1
- data/.ci/packer_cache.sh +16 -0
- data/.github/ISSUE_TEMPLATE/Bug_report.md +13 -11
- data/.github/ISSUE_TEMPLATE/Feature_request.md +8 -8
- data/.github/PULL_REQUEST_TEMPLATE.md +51 -5
- data/.gitignore +5 -0
- data/.rspec +0 -1
- data/.rubocop.yml +13 -1
- data/CHANGELOG.asciidoc +94 -1
- data/CONTRIBUTING.md +6 -48
- data/Gemfile +34 -9
- data/README.md +62 -13
- data/Rakefile +37 -5
- data/bin/run-tests +4 -1
- data/docker-compose.yml +7 -0
- data/docs/api.asciidoc +15 -3
- data/docs/configuration.asciidoc +164 -32
- data/docs/debugging.asciidoc +14 -0
- data/docs/getting-started-rails.asciidoc +2 -0
- data/docs/graphql.asciidoc +23 -0
- data/docs/images/dynamic-config.svg +1 -0
- data/docs/index.asciidoc +6 -1
- data/docs/introduction.asciidoc +2 -1
- data/docs/performance-tuning.asciidoc +106 -0
- data/docs/set-up.asciidoc +5 -2
- data/docs/supported-technologies.asciidoc +68 -1
- data/docs/upgrading.asciidoc +45 -0
- data/elastic-apm.gemspec +17 -0
- data/lib/elastic-apm.rb +17 -0
- data/lib/elastic_apm.rb +29 -0
- data/lib/elastic_apm/agent.rb +49 -2
- data/lib/elastic_apm/central_config.rb +27 -8
- data/lib/elastic_apm/central_config/cache_control.rb +17 -0
- data/lib/elastic_apm/child_durations.rb +17 -0
- data/lib/elastic_apm/config.rb +82 -7
- data/lib/elastic_apm/config/bytes.rb +17 -0
- data/lib/elastic_apm/config/duration.rb +17 -0
- data/lib/elastic_apm/config/options.rb +18 -1
- data/lib/elastic_apm/config/regexp_list.rb +17 -0
- data/lib/elastic_apm/config/wildcard_pattern_list.rb +20 -1
- data/lib/elastic_apm/context.rb +17 -0
- data/lib/elastic_apm/context/request.rb +17 -0
- data/lib/elastic_apm/context/request/socket.rb +17 -0
- data/lib/elastic_apm/context/request/url.rb +17 -0
- data/lib/elastic_apm/context/response.rb +18 -1
- data/lib/elastic_apm/context/user.rb +17 -0
- data/lib/elastic_apm/context_builder.rb +17 -0
- data/lib/elastic_apm/deprecations.rb +17 -0
- data/lib/elastic_apm/error.rb +17 -0
- data/lib/elastic_apm/error/exception.rb +17 -0
- data/lib/elastic_apm/error/log.rb +17 -0
- data/lib/elastic_apm/error_builder.rb +17 -0
- data/lib/elastic_apm/grape.rb +17 -0
- data/lib/elastic_apm/graphql.rb +91 -0
- data/lib/elastic_apm/grpc.rb +99 -0
- data/lib/elastic_apm/instrumenter.rb +29 -4
- data/lib/elastic_apm/internal_error.rb +17 -0
- data/lib/elastic_apm/logging.rb +17 -0
- data/lib/elastic_apm/metadata.rb +17 -0
- data/lib/elastic_apm/metadata/process_info.rb +17 -0
- data/lib/elastic_apm/metadata/service_info.rb +22 -2
- data/lib/elastic_apm/metadata/system_info.rb +17 -0
- data/lib/elastic_apm/metadata/system_info/container_info.rb +17 -0
- data/lib/elastic_apm/metrics.rb +33 -1
- data/lib/elastic_apm/metrics/breakdown_set.rb +17 -0
- data/lib/elastic_apm/metrics/cpu_mem_set.rb +17 -0
- data/lib/elastic_apm/metrics/metric.rb +23 -4
- data/lib/elastic_apm/metrics/set.rb +17 -0
- data/lib/elastic_apm/metrics/span_scoped_set.rb +17 -0
- data/lib/elastic_apm/metrics/transaction_set.rb +17 -0
- data/lib/elastic_apm/metrics/vm_set.rb +17 -0
- data/lib/elastic_apm/metricset.rb +17 -0
- data/lib/elastic_apm/middleware.rb +20 -4
- data/lib/elastic_apm/naively_hashable.rb +17 -0
- data/lib/elastic_apm/normalizers.rb +17 -0
- data/lib/elastic_apm/normalizers/grape.rb +17 -0
- data/lib/elastic_apm/normalizers/grape/endpoint_run.rb +18 -1
- data/lib/elastic_apm/normalizers/rails.rb +17 -0
- data/lib/elastic_apm/normalizers/rails/action_controller.rb +17 -0
- data/lib/elastic_apm/normalizers/rails/action_mailer.rb +17 -0
- data/lib/elastic_apm/normalizers/rails/action_view.rb +17 -0
- data/lib/elastic_apm/normalizers/rails/active_record.rb +17 -0
- data/lib/elastic_apm/opentracing.rb +66 -24
- data/lib/elastic_apm/rails.rb +17 -0
- data/lib/elastic_apm/railtie.rb +17 -0
- data/lib/elastic_apm/resque.rb +29 -0
- data/lib/elastic_apm/sinatra.rb +17 -0
- data/lib/elastic_apm/span.rb +17 -0
- data/lib/elastic_apm/span/context.rb +17 -0
- data/lib/elastic_apm/span/context/db.rb +26 -2
- data/lib/elastic_apm/span/context/destination.rb +37 -4
- data/lib/elastic_apm/span/context/http.rb +17 -0
- data/lib/elastic_apm/span_helpers.rb +17 -0
- data/lib/elastic_apm/spies.rb +33 -14
- data/lib/elastic_apm/spies/action_dispatch.rb +17 -0
- data/lib/elastic_apm/spies/delayed_job.rb +17 -0
- data/lib/elastic_apm/spies/dynamo_db.rb +58 -0
- data/lib/elastic_apm/spies/elasticsearch.rb +37 -2
- data/lib/elastic_apm/spies/faraday.rb +18 -1
- data/lib/elastic_apm/spies/http.rb +19 -1
- data/lib/elastic_apm/spies/json.rb +17 -0
- data/lib/elastic_apm/spies/mongo.rb +18 -1
- data/lib/elastic_apm/spies/net_http.rb +25 -3
- data/lib/elastic_apm/spies/rake.rb +17 -0
- data/lib/elastic_apm/spies/redis.rb +17 -0
- data/lib/elastic_apm/spies/resque.rb +53 -0
- data/lib/elastic_apm/spies/sequel.rb +31 -4
- data/lib/elastic_apm/spies/shoryuken.rb +17 -0
- data/lib/elastic_apm/spies/sidekiq.rb +17 -0
- data/lib/elastic_apm/spies/sinatra.rb +17 -0
- data/lib/elastic_apm/spies/sneakers.rb +17 -0
- data/lib/elastic_apm/spies/sucker_punch.rb +54 -0
- data/lib/elastic_apm/spies/tilt.rb +17 -0
- data/lib/elastic_apm/sql.rb +21 -4
- data/lib/elastic_apm/sql/signature.rb +17 -0
- data/lib/elastic_apm/sql/tokenizer.rb +17 -0
- data/lib/elastic_apm/sql/tokens.rb +17 -0
- data/lib/elastic_apm/sql_summarizer.rb +17 -0
- data/lib/elastic_apm/stacktrace.rb +17 -0
- data/lib/elastic_apm/stacktrace/frame.rb +17 -0
- data/lib/elastic_apm/stacktrace_builder.rb +23 -1
- data/lib/elastic_apm/subscriber.rb +17 -0
- data/lib/elastic_apm/trace_context.rb +85 -49
- data/lib/elastic_apm/trace_context/traceparent.rb +113 -0
- data/lib/elastic_apm/trace_context/tracestate.rb +43 -0
- data/lib/elastic_apm/transaction.rb +33 -5
- data/lib/elastic_apm/transport/base.rb +39 -23
- data/lib/elastic_apm/transport/connection.rb +17 -0
- data/lib/elastic_apm/transport/connection/http.rb +17 -0
- data/lib/elastic_apm/transport/connection/proxy_pipe.rb +22 -0
- data/lib/elastic_apm/transport/filters.rb +17 -0
- data/lib/elastic_apm/transport/filters/hash_sanitizer.rb +77 -0
- data/lib/elastic_apm/transport/filters/secrets_filter.rb +29 -53
- data/lib/elastic_apm/transport/headers.rb +17 -0
- data/lib/elastic_apm/transport/serializers.rb +17 -0
- data/lib/elastic_apm/transport/serializers/context_serializer.rb +17 -0
- data/lib/elastic_apm/transport/serializers/error_serializer.rb +17 -0
- data/lib/elastic_apm/transport/serializers/metadata_serializer.rb +44 -20
- data/lib/elastic_apm/transport/serializers/metricset_serializer.rb +17 -0
- data/lib/elastic_apm/transport/serializers/span_serializer.rb +22 -2
- data/lib/elastic_apm/transport/serializers/transaction_serializer.rb +17 -0
- data/lib/elastic_apm/transport/user_agent.rb +17 -0
- data/lib/elastic_apm/transport/worker.rb +17 -0
- data/lib/elastic_apm/util.rb +17 -0
- data/lib/elastic_apm/util/inflector.rb +17 -0
- data/lib/elastic_apm/util/lru_cache.rb +17 -0
- data/lib/elastic_apm/util/throttle.rb +17 -0
- data/lib/elastic_apm/version.rb +18 -1
- metadata +29 -12
- data/.ci/downstreamTests.groovy +0 -185
- data/.ci/prepare-git-context.sh +0 -27
- data/CHANGELOG.md +0 -1
- data/codecov.yml +0 -32
@@ -1,3 +1,20 @@
|
|
1
|
+
# Licensed to Elasticsearch B.V. under one or more contributor
|
2
|
+
# license agreements. See the NOTICE file distributed with
|
3
|
+
# this work for additional information regarding copyright
|
4
|
+
# ownership. Elasticsearch B.V. licenses this file to you under
|
5
|
+
# the Apache License, Version 2.0 (the "License"); you may
|
6
|
+
# not use this file except in compliance with the License.
|
7
|
+
# You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing,
|
12
|
+
# software distributed under the License is distributed on an
|
13
|
+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
14
|
+
# KIND, either express or implied. See the License for the
|
15
|
+
# specific language governing permissions and limitations
|
16
|
+
# under the License.
|
17
|
+
|
1
18
|
# frozen_string_literal: true
|
2
19
|
|
3
20
|
require 'elastic_apm/central_config/cache_control'
|
@@ -81,15 +98,16 @@ module ElasticAPM
|
|
81
98
|
update[key] = @modified_options.delete(key)
|
82
99
|
end
|
83
100
|
|
84
|
-
|
101
|
+
@config.replace_options(update)
|
85
102
|
end
|
86
103
|
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
@config = config.dup.tap { |new_config| new_config.assign(new_options) }
|
104
|
+
def handle_forking!
|
105
|
+
stop
|
106
|
+
start
|
91
107
|
end
|
92
108
|
|
109
|
+
private
|
110
|
+
|
93
111
|
# rubocop:disable Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity
|
94
112
|
def handle_success(resp)
|
95
113
|
if (etag = resp.headers['Etag'])
|
@@ -104,9 +122,10 @@ module ElasticAPM
|
|
104
122
|
assign(update)
|
105
123
|
end
|
106
124
|
|
107
|
-
if
|
125
|
+
if update && update.any?
|
108
126
|
info 'Updated config from Kibana'
|
109
|
-
debug 'Modified: %s',
|
127
|
+
debug 'Modified: %s', update.inspect
|
128
|
+
debug 'Modified original options: %s', @modified_options.inspect
|
110
129
|
end
|
111
130
|
end
|
112
131
|
|
@@ -151,7 +170,7 @@ module ElasticAPM
|
|
151
170
|
def schedule_next_fetch(resp = nil)
|
152
171
|
headers = resp&.headers
|
153
172
|
seconds =
|
154
|
-
if headers['Cache-Control']
|
173
|
+
if headers && headers['Cache-Control']
|
155
174
|
CacheControl.new(headers['Cache-Control']).max_age
|
156
175
|
else
|
157
176
|
DEFAULT_MAX_AGE
|
@@ -1,3 +1,20 @@
|
|
1
|
+
# Licensed to Elasticsearch B.V. under one or more contributor
|
2
|
+
# license agreements. See the NOTICE file distributed with
|
3
|
+
# this work for additional information regarding copyright
|
4
|
+
# ownership. Elasticsearch B.V. licenses this file to you under
|
5
|
+
# the Apache License, Version 2.0 (the "License"); you may
|
6
|
+
# not use this file except in compliance with the License.
|
7
|
+
# You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing,
|
12
|
+
# software distributed under the License is distributed on an
|
13
|
+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
14
|
+
# KIND, either express or implied. See the License for the
|
15
|
+
# specific language governing permissions and limitations
|
16
|
+
# under the License.
|
17
|
+
|
1
18
|
# frozen_string_literal: true
|
2
19
|
|
3
20
|
module ElasticAPM
|
@@ -1,3 +1,20 @@
|
|
1
|
+
# Licensed to Elasticsearch B.V. under one or more contributor
|
2
|
+
# license agreements. See the NOTICE file distributed with
|
3
|
+
# this work for additional information regarding copyright
|
4
|
+
# ownership. Elasticsearch B.V. licenses this file to you under
|
5
|
+
# the Apache License, Version 2.0 (the "License"); you may
|
6
|
+
# not use this file except in compliance with the License.
|
7
|
+
# You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing,
|
12
|
+
# software distributed under the License is distributed on an
|
13
|
+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
14
|
+
# KIND, either express or implied. See the License for the
|
15
|
+
# specific language governing permissions and limitations
|
16
|
+
# under the License.
|
17
|
+
|
1
18
|
# frozen_string_literal: true
|
2
19
|
|
3
20
|
module ElasticAPM
|
data/lib/elastic_apm/config.rb
CHANGED
@@ -1,3 +1,20 @@
|
|
1
|
+
# Licensed to Elasticsearch B.V. under one or more contributor
|
2
|
+
# license agreements. See the NOTICE file distributed with
|
3
|
+
# this work for additional information regarding copyright
|
4
|
+
# ownership. Elasticsearch B.V. licenses this file to you under
|
5
|
+
# the Apache License, Version 2.0 (the "License"); you may
|
6
|
+
# not use this file except in compliance with the License.
|
7
|
+
# You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing,
|
12
|
+
# software distributed under the License is distributed on an
|
13
|
+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
14
|
+
# KIND, either express or implied. See the License for the
|
15
|
+
# specific language governing permissions and limitations
|
16
|
+
# under the License.
|
17
|
+
|
1
18
|
# frozen_string_literal: true
|
2
19
|
|
3
20
|
require 'elastic_apm/config/options'
|
@@ -19,26 +36,26 @@ module ElasticAPM
|
|
19
36
|
option :secret_token, type: :string
|
20
37
|
option :api_key, type: :string
|
21
38
|
|
22
|
-
option :active, type: :bool, default: true
|
23
39
|
option :api_buffer_size, type: :int, default: 256
|
24
40
|
option :api_request_size, type: :bytes, default: '750kb', converter: Bytes.new
|
25
41
|
option :api_request_time, type: :float, default: '10s', converter: Duration.new
|
26
42
|
option :breakdown_metrics, type: :bool, default: true
|
27
43
|
option :capture_body, type: :string, default: 'off'
|
28
44
|
option :capture_headers, type: :bool, default: true
|
45
|
+
option :capture_elasticsearch_queries, type: :bool, default: false
|
29
46
|
option :capture_env, type: :bool, default: true
|
30
47
|
option :central_config, type: :bool, default: true
|
31
48
|
option :current_user_email_method, type: :string, default: 'email'
|
32
49
|
option :current_user_id_method, type: :string, default: 'id'
|
33
50
|
option :current_user_username_method, type: :string, default: 'username'
|
34
51
|
option :custom_key_filters, type: :list, default: [], converter: RegexpList.new
|
35
|
-
option :default_tags, type: :dict, default: {}
|
36
52
|
option :default_labels, type: :dict, default: {}
|
37
53
|
option :disable_metrics, type: :list, default: [], converter: WildcardPatternList.new
|
38
54
|
option :disable_send, type: :bool, default: false
|
39
55
|
option :disable_start_message, type: :bool, default: false
|
40
|
-
option :
|
56
|
+
option :disable_instrumentations, type: :list, default: %w[json]
|
41
57
|
option :disabled_spies, type: :list, default: []
|
58
|
+
option :enabled, type: :bool, default: true
|
42
59
|
option :environment, type: :string, default: ENV['RAILS_ENV'] || ENV['RACK_ENV']
|
43
60
|
option :framework_name, type: :string
|
44
61
|
option :framework_version, type: :string
|
@@ -58,8 +75,11 @@ module ElasticAPM
|
|
58
75
|
option :proxy_password, type: :string
|
59
76
|
option :proxy_port, type: :int
|
60
77
|
option :proxy_username, type: :string
|
78
|
+
option :recording, type: :bool, default: true
|
79
|
+
option :sanitize_field_names, type: :list, default: [], converter: WildcardPatternList.new
|
61
80
|
option :server_ca_cert, type: :string
|
62
81
|
option :service_name, type: :string
|
82
|
+
option :service_node_name, type: :string
|
63
83
|
option :service_version, type: :string
|
64
84
|
option :source_lines_error_app_frames, type: :int, default: 5
|
65
85
|
option :source_lines_error_library_frames, type: :int, default: 0
|
@@ -69,10 +89,10 @@ module ElasticAPM
|
|
69
89
|
option :stack_trace_limit, type: :int, default: 999_999
|
70
90
|
option :transaction_max_spans, type: :int, default: 500
|
71
91
|
option :transaction_sample_rate, type: :float, default: 1.0
|
92
|
+
option :use_elastic_traceparent_header, type: :bool, default: true
|
93
|
+
option :use_legacy_sql_parser, type: :bool, default: false
|
72
94
|
option :verify_server_cert, type: :bool, default: true
|
73
95
|
|
74
|
-
option :use_experimental_sql_parser, type: :bool, default: false
|
75
|
-
|
76
96
|
# rubocop:enable Metrics/LineLength, Layout/ExtraSpacing
|
77
97
|
def initialize(options = {})
|
78
98
|
@options = load_schema
|
@@ -111,6 +131,7 @@ module ElasticAPM
|
|
111
131
|
%w[
|
112
132
|
action_dispatch
|
113
133
|
delayed_job
|
134
|
+
dynamo_db
|
114
135
|
elasticsearch
|
115
136
|
faraday
|
116
137
|
http
|
@@ -119,17 +140,19 @@ module ElasticAPM
|
|
119
140
|
net_http
|
120
141
|
rake
|
121
142
|
redis
|
143
|
+
resque
|
122
144
|
sequel
|
123
145
|
shoryuken
|
124
146
|
sidekiq
|
125
147
|
sinatra
|
126
148
|
sneakers
|
149
|
+
sucker_punch
|
127
150
|
tilt
|
128
151
|
]
|
129
152
|
end
|
130
153
|
|
131
154
|
def enabled_instrumentations
|
132
|
-
available_instrumentations -
|
155
|
+
available_instrumentations - disable_instrumentations
|
133
156
|
end
|
134
157
|
|
135
158
|
def method_missing(name, *args)
|
@@ -137,6 +160,15 @@ module ElasticAPM
|
|
137
160
|
warn "The option `#{name}' has been removed."
|
138
161
|
end
|
139
162
|
|
163
|
+
def replace_options(new_options)
|
164
|
+
return if new_options.nil? || new_options.empty?
|
165
|
+
options_copy = @options.dup
|
166
|
+
new_options.each do |key, value|
|
167
|
+
options_copy.fetch(key.to_sym).set(value)
|
168
|
+
end
|
169
|
+
@options = options_copy
|
170
|
+
end
|
171
|
+
|
140
172
|
def app=(app)
|
141
173
|
case app_type?(app)
|
142
174
|
when :sinatra
|
@@ -194,6 +226,49 @@ module ElasticAPM
|
|
194
226
|
super.split.first + '>'
|
195
227
|
end
|
196
228
|
|
229
|
+
# Deprecations
|
230
|
+
|
231
|
+
def default_tags=(value)
|
232
|
+
warn '[DEPRECATED] The option default_tags has been renamed to ' \
|
233
|
+
'default_labels.'
|
234
|
+
self.default_labels = value
|
235
|
+
end
|
236
|
+
|
237
|
+
def custom_key_filters=(value)
|
238
|
+
unless value == self.class.schema[:custom_key_filters][:default]
|
239
|
+
warn '[DEPRECATED] The option custom_key_filters is being removed. ' \
|
240
|
+
'See sanitize_field_names for an alternative.'
|
241
|
+
end
|
242
|
+
|
243
|
+
set(:custom_key_filters, value)
|
244
|
+
end
|
245
|
+
|
246
|
+
def disabled_instrumentations
|
247
|
+
disable_instrumentations
|
248
|
+
end
|
249
|
+
|
250
|
+
def active
|
251
|
+
enabled
|
252
|
+
end
|
253
|
+
alias active? active
|
254
|
+
|
255
|
+
def disabled_instrumentations=(value)
|
256
|
+
warn '[DEPRECATED] The option disabled_instrumentations has been ' \
|
257
|
+
'renamed to disable_instrumentations to align with other agents.'
|
258
|
+
self.disable_instrumentations = value
|
259
|
+
end
|
260
|
+
|
261
|
+
def use_experimental_sql_parser=(value)
|
262
|
+
warn '[DEPRECATED] The new SQL parser is now the default. To use the old one, '
|
263
|
+
'use use_legacy_sql_parser and please report why you wish to do so.'
|
264
|
+
end
|
265
|
+
|
266
|
+
def active=(value)
|
267
|
+
warn '[DEPRECATED] The option active has been renamed to enabled ' \
|
268
|
+
'to align with other agents and with the remote config.'
|
269
|
+
self.enabled = value
|
270
|
+
end
|
271
|
+
|
197
272
|
private
|
198
273
|
|
199
274
|
def load_config_file
|
@@ -243,7 +318,7 @@ module ElasticAPM
|
|
243
318
|
self.logger ||= ::Rails.logger
|
244
319
|
|
245
320
|
self.__root_path = ::Rails.root.to_s
|
246
|
-
self.__view_paths =
|
321
|
+
self.__view_paths = ::ActionController::Base.view_paths.map(&:to_s)
|
247
322
|
end
|
248
323
|
|
249
324
|
def rails_app_name(app)
|
@@ -1,3 +1,20 @@
|
|
1
|
+
# Licensed to Elasticsearch B.V. under one or more contributor
|
2
|
+
# license agreements. See the NOTICE file distributed with
|
3
|
+
# this work for additional information regarding copyright
|
4
|
+
# ownership. Elasticsearch B.V. licenses this file to you under
|
5
|
+
# the Apache License, Version 2.0 (the "License"); you may
|
6
|
+
# not use this file except in compliance with the License.
|
7
|
+
# You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing,
|
12
|
+
# software distributed under the License is distributed on an
|
13
|
+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
14
|
+
# KIND, either express or implied. See the License for the
|
15
|
+
# specific language governing permissions and limitations
|
16
|
+
# under the License.
|
17
|
+
|
1
18
|
# frozen_string_literal: true
|
2
19
|
|
3
20
|
module ElasticAPM
|
@@ -1,3 +1,20 @@
|
|
1
|
+
# Licensed to Elasticsearch B.V. under one or more contributor
|
2
|
+
# license agreements. See the NOTICE file distributed with
|
3
|
+
# this work for additional information regarding copyright
|
4
|
+
# ownership. Elasticsearch B.V. licenses this file to you under
|
5
|
+
# the Apache License, Version 2.0 (the "License"); you may
|
6
|
+
# not use this file except in compliance with the License.
|
7
|
+
# You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing,
|
12
|
+
# software distributed under the License is distributed on an
|
13
|
+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
14
|
+
# KIND, either express or implied. See the License for the
|
15
|
+
# specific language governing permissions and limitations
|
16
|
+
# under the License.
|
17
|
+
|
1
18
|
# frozen_string_literal: true
|
2
19
|
|
3
20
|
module ElasticAPM
|
@@ -1,3 +1,20 @@
|
|
1
|
+
# Licensed to Elasticsearch B.V. under one or more contributor
|
2
|
+
# license agreements. See the NOTICE file distributed with
|
3
|
+
# this work for additional information regarding copyright
|
4
|
+
# ownership. Elasticsearch B.V. licenses this file to you under
|
5
|
+
# the Apache License, Version 2.0 (the "License"); you may
|
6
|
+
# not use this file except in compliance with the License.
|
7
|
+
# You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing,
|
12
|
+
# software distributed under the License is distributed on an
|
13
|
+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
14
|
+
# KIND, either express or implied. See the License for the
|
15
|
+
# specific language governing permissions and limitations
|
16
|
+
# under the License.
|
17
|
+
|
1
18
|
# frozen_string_literal: true
|
2
19
|
|
3
20
|
module ElasticAPM
|
@@ -35,7 +52,7 @@ module ElasticAPM
|
|
35
52
|
|
36
53
|
# rubocop:disable Metrics/CyclomaticComplexity
|
37
54
|
def normalize(val)
|
38
|
-
return
|
55
|
+
return if val.nil?
|
39
56
|
|
40
57
|
if @converter
|
41
58
|
return @converter.call(val)
|
@@ -1,3 +1,20 @@
|
|
1
|
+
# Licensed to Elasticsearch B.V. under one or more contributor
|
2
|
+
# license agreements. See the NOTICE file distributed with
|
3
|
+
# this work for additional information regarding copyright
|
4
|
+
# ownership. Elasticsearch B.V. licenses this file to you under
|
5
|
+
# the Apache License, Version 2.0 (the "License"); you may
|
6
|
+
# not use this file except in compliance with the License.
|
7
|
+
# You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing,
|
12
|
+
# software distributed under the License is distributed on an
|
13
|
+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
14
|
+
# KIND, either express or implied. See the License for the
|
15
|
+
# specific language governing permissions and limitations
|
16
|
+
# under the License.
|
17
|
+
|
1
18
|
# frozen_string_literal: true
|
2
19
|
|
3
20
|
module ElasticAPM
|
@@ -1,3 +1,20 @@
|
|
1
|
+
# Licensed to Elasticsearch B.V. under one or more contributor
|
2
|
+
# license agreements. See the NOTICE file distributed with
|
3
|
+
# this work for additional information regarding copyright
|
4
|
+
# ownership. Elasticsearch B.V. licenses this file to you under
|
5
|
+
# the Apache License, Version 2.0 (the "License"); you may
|
6
|
+
# not use this file except in compliance with the License.
|
7
|
+
# You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing,
|
12
|
+
# software distributed under the License is distributed on an
|
13
|
+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
14
|
+
# KIND, either express or implied. See the License for the
|
15
|
+
# specific language governing permissions and limitations
|
16
|
+
# under the License.
|
17
|
+
|
1
18
|
# frozen_string_literal: true
|
2
19
|
|
3
20
|
module ElasticAPM
|
@@ -14,6 +31,8 @@ module ElasticAPM
|
|
14
31
|
!!@pattern.match(other)
|
15
32
|
end
|
16
33
|
|
34
|
+
alias :match :match?
|
35
|
+
|
17
36
|
private
|
18
37
|
|
19
38
|
def convert(str)
|
@@ -22,7 +41,7 @@ module ElasticAPM
|
|
22
41
|
arr << (char == '*' ? '.*' : Regexp.escape(char))
|
23
42
|
end
|
24
43
|
|
25
|
-
Regexp.new('\A' + parts.join + '\Z')
|
44
|
+
Regexp.new('\A' + parts.join + '\Z', Regexp::IGNORECASE)
|
26
45
|
end
|
27
46
|
end
|
28
47
|
|
data/lib/elastic_apm/context.rb
CHANGED
@@ -1,3 +1,20 @@
|
|
1
|
+
# Licensed to Elasticsearch B.V. under one or more contributor
|
2
|
+
# license agreements. See the NOTICE file distributed with
|
3
|
+
# this work for additional information regarding copyright
|
4
|
+
# ownership. Elasticsearch B.V. licenses this file to you under
|
5
|
+
# the Apache License, Version 2.0 (the "License"); you may
|
6
|
+
# not use this file except in compliance with the License.
|
7
|
+
# You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing,
|
12
|
+
# software distributed under the License is distributed on an
|
13
|
+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
14
|
+
# KIND, either express or implied. See the License for the
|
15
|
+
# specific language governing permissions and limitations
|
16
|
+
# under the License.
|
17
|
+
|
1
18
|
# frozen_string_literal: true
|
2
19
|
|
3
20
|
require 'elastic_apm/context/request'
|
@@ -1,3 +1,20 @@
|
|
1
|
+
# Licensed to Elasticsearch B.V. under one or more contributor
|
2
|
+
# license agreements. See the NOTICE file distributed with
|
3
|
+
# this work for additional information regarding copyright
|
4
|
+
# ownership. Elasticsearch B.V. licenses this file to you under
|
5
|
+
# the Apache License, Version 2.0 (the "License"); you may
|
6
|
+
# not use this file except in compliance with the License.
|
7
|
+
# You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing,
|
12
|
+
# software distributed under the License is distributed on an
|
13
|
+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
14
|
+
# KIND, either express or implied. See the License for the
|
15
|
+
# specific language governing permissions and limitations
|
16
|
+
# under the License.
|
17
|
+
|
1
18
|
# frozen_string_literal: true
|
2
19
|
|
3
20
|
module ElasticAPM
|