elastic-apm 3.12.0 → 3.12.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.asciidoc +8 -0
- data/lib/elastic_apm/metadata/cloud_info.rb +3 -3
- data/lib/elastic_apm/spies/elasticsearch.rb +1 -1
- data/lib/elastic_apm/transport/filters/hash_sanitizer.rb +6 -0
- data/lib/elastic_apm/transport/filters/secrets_filter.rb +2 -0
- data/lib/elastic_apm/util/deep_dup.rb +66 -0
- data/lib/elastic_apm/version.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: de9bb2ac6873a987cb7c7d0cdf51f8c11908d0d3ada729bd21bb4bc24d3aa3dc
|
4
|
+
data.tar.gz: 571507faa100bb620c116dbe11bdcad1b958c718c89a7f8572732ef3939ad70f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 916cfb05143133cf1c0680d2495f2877997d607cac710063d3862acf62105d256434f0e3f9170599fa5d6c2a59c80ff39dace42584a0cce493b5f476ad6e8e5e
|
7
|
+
data.tar.gz: af7f87595e02ec5996c7a1ecf5aac7e7deb376ae4a32d30c250ad6293be3ce086a8a64074e88b79f6dcb2ce52b1c9861e7d7031119da58026bfff9e2ca841eb4
|
data/CHANGELOG.asciidoc
CHANGED
@@ -35,6 +35,14 @@ endif::[]
|
|
35
35
|
[[release-notes-3.x]]
|
36
36
|
=== Ruby Agent version 3.x
|
37
37
|
|
38
|
+
[[release-notes-3.12.1]]
|
39
|
+
==== 3.12.1 (2020-11-16)
|
40
|
+
|
41
|
+
[float]
|
42
|
+
===== Fixed
|
43
|
+
|
44
|
+
- `capture_elasticsearch_queries` no longer modifies the original query {pull}894[#894]
|
45
|
+
|
38
46
|
[[release-notes-3.12.0]]
|
39
47
|
==== 3.12.0 (2020-11-10)
|
40
48
|
|
@@ -73,7 +73,7 @@ module ElasticAPM
|
|
73
73
|
def fetch_aws
|
74
74
|
resp = @client.get(AWS_URI)
|
75
75
|
|
76
|
-
return unless resp.status
|
76
|
+
return unless resp.status == 200
|
77
77
|
return unless (metadata = JSON.parse(resp.body))
|
78
78
|
|
79
79
|
self.provider = "aws"
|
@@ -89,7 +89,7 @@ module ElasticAPM
|
|
89
89
|
def fetch_gcp
|
90
90
|
resp = @client.headers("Metadata-Flavor" => "Google").get(GCP_URI)
|
91
91
|
|
92
|
-
return unless resp.status
|
92
|
+
return unless resp.status == 200
|
93
93
|
return unless (metadata = JSON.parse(resp.body))
|
94
94
|
|
95
95
|
zone = metadata["instance"]["zone"]&.split("/")&.at(-1)
|
@@ -109,7 +109,7 @@ module ElasticAPM
|
|
109
109
|
def fetch_azure
|
110
110
|
resp = @client.headers("Metadata" => "true").get(AZURE_URI)
|
111
111
|
|
112
|
-
return unless resp.status
|
112
|
+
return unless resp.status == 200
|
113
113
|
return unless (metadata = JSON.parse(resp.body))
|
114
114
|
|
115
115
|
self.provider = 'azure'
|
@@ -53,7 +53,7 @@ module ElasticAPM
|
|
53
53
|
if ElasticAPM.agent.config.capture_elasticsearch_queries
|
54
54
|
unless args[1].nil? || args[1].empty?
|
55
55
|
statement << {
|
56
|
-
body: ElasticAPM::Spies::ElasticsearchSpy.sanitizer.strip_from
|
56
|
+
body: ElasticAPM::Spies::ElasticsearchSpy.sanitizer.strip_from(args[1])
|
57
57
|
}
|
58
58
|
end
|
59
59
|
end
|
@@ -17,6 +17,8 @@
|
|
17
17
|
|
18
18
|
# frozen_string_literal: true
|
19
19
|
|
20
|
+
require 'elastic_apm/util/deep_dup'
|
21
|
+
|
20
22
|
module ElasticAPM
|
21
23
|
module Transport
|
22
24
|
module Filters
|
@@ -38,6 +40,10 @@ module ElasticAPM
|
|
38
40
|
|
39
41
|
attr_accessor :key_patterns
|
40
42
|
|
43
|
+
def strip_from(obj)
|
44
|
+
strip_from!(Util::DeepDup.dup(obj))
|
45
|
+
end
|
46
|
+
|
41
47
|
def strip_from!(obj)
|
42
48
|
return unless obj&.is_a?(Hash)
|
43
49
|
|
@@ -38,7 +38,9 @@ module ElasticAPM
|
|
38
38
|
@sanitizer.strip_from! payload.dig(:transaction, :context, :request, :env)
|
39
39
|
@sanitizer.strip_from! payload.dig(:transaction, :context, :request, :headers)
|
40
40
|
@sanitizer.strip_from! payload.dig(:transaction, :context, :response, :headers)
|
41
|
+
@sanitizer.strip_from! payload.dig(:error, :context, :request, :body)
|
41
42
|
@sanitizer.strip_from! payload.dig(:error, :context, :request, :cookies)
|
43
|
+
@sanitizer.strip_from! payload.dig(:error, :context, :request, :env)
|
42
44
|
@sanitizer.strip_from! payload.dig(:error, :context, :request, :headers)
|
43
45
|
@sanitizer.strip_from! payload.dig(:error, :context, :response, :headers)
|
44
46
|
|
@@ -0,0 +1,66 @@
|
|
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
|
+
|
18
|
+
# frozen_string_literal: true
|
19
|
+
|
20
|
+
module ElasticAPM
|
21
|
+
module Util
|
22
|
+
# @api private
|
23
|
+
#
|
24
|
+
# Makes a deep copy of an Array or Hash
|
25
|
+
# NB: Not guaranteed to work well with complex objects, only simple Hash,
|
26
|
+
# Array, String, Number, etc…
|
27
|
+
class DeepDup
|
28
|
+
def initialize(obj)
|
29
|
+
@obj = obj
|
30
|
+
end
|
31
|
+
|
32
|
+
def dup
|
33
|
+
deep_dup(@obj)
|
34
|
+
end
|
35
|
+
|
36
|
+
def self.dup(obj)
|
37
|
+
new(obj).dup
|
38
|
+
end
|
39
|
+
|
40
|
+
private
|
41
|
+
|
42
|
+
def deep_dup(obj)
|
43
|
+
case obj
|
44
|
+
when Hash then hash(obj)
|
45
|
+
when Array then array(obj)
|
46
|
+
else obj.dup
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
def array(arr)
|
51
|
+
arr.map(&method(:deep_dup))
|
52
|
+
end
|
53
|
+
|
54
|
+
def hash(hsh)
|
55
|
+
result = hsh.dup
|
56
|
+
|
57
|
+
hsh.each_pair do |key, value|
|
58
|
+
result[key] = deep_dup(value)
|
59
|
+
end
|
60
|
+
|
61
|
+
result
|
62
|
+
end
|
63
|
+
end
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
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: 3.12.
|
4
|
+
version: 3.12.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: 2020-11-
|
11
|
+
date: 2020-11-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: concurrent-ruby
|
@@ -235,6 +235,7 @@ files:
|
|
235
235
|
- lib/elastic_apm/transport/user_agent.rb
|
236
236
|
- lib/elastic_apm/transport/worker.rb
|
237
237
|
- lib/elastic_apm/util.rb
|
238
|
+
- lib/elastic_apm/util/deep_dup.rb
|
238
239
|
- lib/elastic_apm/util/inflector.rb
|
239
240
|
- lib/elastic_apm/util/lru_cache.rb
|
240
241
|
- lib/elastic_apm/util/precision_validator.rb
|
@@ -260,7 +261,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
260
261
|
- !ruby/object:Gem::Version
|
261
262
|
version: '0'
|
262
263
|
requirements: []
|
263
|
-
rubygems_version: 3.
|
264
|
+
rubygems_version: 3.1.4
|
264
265
|
signing_key:
|
265
266
|
specification_version: 4
|
266
267
|
summary: The official Elastic APM agent for Ruby
|