appsignal 4.2.3-java → 4.3.1-java

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 784861d0e654bc150f7aa6a6b7770d157ae56cb539102c3be3d43a74f23cb6d2
4
- data.tar.gz: 41664ff55a4afcf2b0d2bf8f0c5869e72490998305450169095020b48b33d7b9
3
+ metadata.gz: 04dea4dd43fa462f7f09f27c8bfb76fc5d1cb8f46cabc0795564e0f2ea6cd68a
4
+ data.tar.gz: 326804ebc3cd24787261ae0a7f3f8a5f84dd2dad77631dc8f3b5a0465b2e3e3c
5
5
  SHA512:
6
- metadata.gz: f818ffac31f93c26fb2f47731868c3c705687fef154bb8814e768abc2f02c42d2873e84c280f4661de5aa5ff2f2b49aa1af7c9967ca868d9e075d4873a9fbda8
7
- data.tar.gz: 37fc851eda0c8e730ba962239d6962cc1939bfb0109f7fd0c372a8635381fd986aeb4ec12711b5f82c7ca861b53c23ca73893b566449442bd3da1e6e5a93fe0d
6
+ metadata.gz: b2e53de627786e08f1b335854737e59cabcfbf0b849033664e16669a8f47b6d9430b3e30c11fa9ddbcf0541258d1fffec223d28da3a09116d4339c2165d3faf2
7
+ data.tar.gz: f7454f83955ecf86ccfaf9ec17562a994f26e32bb38a9c168603f21bc41b7e19d0fff45ef13d1092943244f28710bafefb7f2c64a6efcc73017b5b9f8410ea0c
data/CHANGELOG.md CHANGED
@@ -1,5 +1,80 @@
1
1
  # AppSignal for Ruby gem Changelog
2
2
 
3
+ ## 4.3.1
4
+
5
+ _Published on 2024-12-20._
6
+
7
+ ### Fixed
8
+
9
+ - Fix a performance issue when sanitising `INSERT INTO ... VALUES` queries. (patch [9791d9a1](https://github.com/appsignal/appsignal-ruby/commit/9791d9a1ef18bd18b96ad449cae90425a621bfb3))
10
+
11
+ ## 4.3.0
12
+
13
+ _Published on 2024-12-20._
14
+
15
+ ### Added
16
+
17
+ - Add logger broadcasting. This change implements an alternative within `Appsignal::Logger` to `ActiveSupport::BroadcastLogger`, following the same interface. This enables a proper workaround to the issues with `ActiveSupport::BroadcastLogger` (([#49745](https://github.com/rails/rails/issues/49745), [#51883](https://github.com/rails/rails/issues/51883))) when used alongside tagged logging.
18
+
19
+ For example, to use tagged logging both in logs emitted by the default `Rails.logger` and in logs sent to AppSignal, replace the `Rails.logger` with an AppSignal logger that broadcasts to the default `Rails.logger`:
20
+
21
+ ```ruby
22
+ appsignal_logger = Appsignal::Logger.new("app")
23
+ appsignal_logger.broadcast_to(Rails.logger)
24
+ Rails.logger = ActiveSupport::TaggedLogging.new(appsignal_logger)
25
+ ```
26
+
27
+ (minor [5cb1464b](https://github.com/appsignal/appsignal-ruby/commit/5cb1464bcf12f043774fb55850e6b82aeba9c1ca))
28
+
29
+ ### Removed
30
+
31
+ - Remove tagged logging support from `Appsignal::Logger`.
32
+
33
+ Tagged logging is still supported by wrapping an instance of `Appsignal::Logger` with `ActiveSupport::TaggedLogging`:
34
+
35
+ ```ruby
36
+ appsignal_logger = Appsignal::Logger.new("rails")
37
+ tagged_logger = ActiveSupport::TaggedLogging.new(appsignal_logger)
38
+ Rails.logger = tagged_logger
39
+ ```
40
+
41
+ Removing this functionality allows for a workaround to issues within Rails ([#49745](https://github.com/rails/rails/issues/49745), [#51883](https://github.com/rails/rails/issues/51883)), where using the broadcast logger to log to more than one tagged logger results in incorrect behaviour of the tagged logging methods, resulting in breakage throughout Rails' internals:
42
+
43
+ ```ruby
44
+ # We use the built-in request ID middleware as an example that triggers
45
+ # the issue:
46
+ Rails.config.log_tags = [:request_id]
47
+
48
+ appsignal_logger = Appsignal::Logger.new("rails")
49
+ tagged_logger = ActiveSupport::TaggedLogging.new(appsignal_logger)
50
+
51
+ # This does not work correctly, because the default `Rails.logger` is a
52
+ # broadcast logger that is already broadcasting to a tagged logger.
53
+ # When asked to broadcast to a second tagged logger, the return value of
54
+ # `Rails.logger.tagged { ... }` will be incorrect, in turn causing the
55
+ # `RequestID` middleware, which uses it internally, to return broken
56
+ # Rack responses.
57
+ Rails.logger.broadcast_to(tagged_logger)
58
+ ```
59
+
60
+ By reverting the changes to our logger so that it is no longer a tagged logger, we enable a workaround to this issue:
61
+
62
+ ```ruby
63
+ Rails.config.log_tags = [:request_id]
64
+
65
+ appsignal_logger = Appsignal::Logger.new("rails")
66
+
67
+ # This works correctly, because `appsignal_logger` is not a tagged logger.
68
+ # Note that `appsignal_logger` will not have the `request_id` tags.
69
+ Rails.logger.broadcast_to(appsignal_logger)
70
+ ```
71
+
72
+ (patch [c061aa4e](https://github.com/appsignal/appsignal-ruby/commit/c061aa4e3f9485a1549ea90316534cddd36e238e))
73
+
74
+ ### Fixed
75
+
76
+ - Fix `#silence` implementation for `Appsignal::Logger`. (patch [d08a1cec](https://github.com/appsignal/appsignal-ruby/commit/d08a1cec705db71999afa9c4af36e244a7b6483a))
77
+
3
78
  ## 4.2.3
4
79
 
5
80
  _Published on 2024-12-17._
data/ext/agent.rb CHANGED
@@ -6,7 +6,7 @@
6
6
  # Modifications to this file will be overwritten with the next agent release.
7
7
 
8
8
  APPSIGNAL_AGENT_CONFIG = {
9
- "version" => "0.35.28",
9
+ "version" => "0.35.29",
10
10
  "mirrors" => [
11
11
  "https://d135dj0rjqvssy.cloudfront.net",
12
12
  "https://appsignal-agent-releases.global.ssl.fastly.net"
@@ -14,131 +14,131 @@ APPSIGNAL_AGENT_CONFIG = {
14
14
  "triples" => {
15
15
  "x86_64-darwin" => {
16
16
  "static" => {
17
- "checksum" => "8759daae4f842a7dcf370e521de8de9390b3883e09abe8b4f868b6827c855bb3",
17
+ "checksum" => "880b317fc23d3cfa11ba88c80d11129bd02742b8b9c100bb038b66e73f85b723",
18
18
  "filename" => "appsignal-x86_64-darwin-all-static.tar.gz"
19
19
  },
20
20
  "dynamic" => {
21
- "checksum" => "bf65784cd4b082db18f241f02e21472f7356b59c5be1a1ef19788ffdac82e737",
21
+ "checksum" => "0b9503e12862fb4824d78b1388bc4f51a9821f5c45ff78ae0782c2200632eac9",
22
22
  "filename" => "appsignal-x86_64-darwin-all-dynamic.tar.gz"
23
23
  }
24
24
  },
25
25
  "universal-darwin" => {
26
26
  "static" => {
27
- "checksum" => "8759daae4f842a7dcf370e521de8de9390b3883e09abe8b4f868b6827c855bb3",
27
+ "checksum" => "880b317fc23d3cfa11ba88c80d11129bd02742b8b9c100bb038b66e73f85b723",
28
28
  "filename" => "appsignal-x86_64-darwin-all-static.tar.gz"
29
29
  },
30
30
  "dynamic" => {
31
- "checksum" => "bf65784cd4b082db18f241f02e21472f7356b59c5be1a1ef19788ffdac82e737",
31
+ "checksum" => "0b9503e12862fb4824d78b1388bc4f51a9821f5c45ff78ae0782c2200632eac9",
32
32
  "filename" => "appsignal-x86_64-darwin-all-dynamic.tar.gz"
33
33
  }
34
34
  },
35
35
  "aarch64-darwin" => {
36
36
  "static" => {
37
- "checksum" => "247551894b2195bb7e9cc6b52e8a42e10af0723b67f757d3eb84fe34791d0509",
37
+ "checksum" => "64b0107722401f5ee39eebec03b9c5a68a14967e8aa8806848df930f85a8afaf",
38
38
  "filename" => "appsignal-aarch64-darwin-all-static.tar.gz"
39
39
  },
40
40
  "dynamic" => {
41
- "checksum" => "21941505aed9051c31883e29e3b2de1816ef881ae68dc30cb0fd39104b5fcd4f",
41
+ "checksum" => "3c1e8da7ce62cfd72b3f83c212baf8ddcf3998b8c37fdcb990d1fc9397488428",
42
42
  "filename" => "appsignal-aarch64-darwin-all-dynamic.tar.gz"
43
43
  }
44
44
  },
45
45
  "arm64-darwin" => {
46
46
  "static" => {
47
- "checksum" => "247551894b2195bb7e9cc6b52e8a42e10af0723b67f757d3eb84fe34791d0509",
47
+ "checksum" => "64b0107722401f5ee39eebec03b9c5a68a14967e8aa8806848df930f85a8afaf",
48
48
  "filename" => "appsignal-aarch64-darwin-all-static.tar.gz"
49
49
  },
50
50
  "dynamic" => {
51
- "checksum" => "21941505aed9051c31883e29e3b2de1816ef881ae68dc30cb0fd39104b5fcd4f",
51
+ "checksum" => "3c1e8da7ce62cfd72b3f83c212baf8ddcf3998b8c37fdcb990d1fc9397488428",
52
52
  "filename" => "appsignal-aarch64-darwin-all-dynamic.tar.gz"
53
53
  }
54
54
  },
55
55
  "arm-darwin" => {
56
56
  "static" => {
57
- "checksum" => "247551894b2195bb7e9cc6b52e8a42e10af0723b67f757d3eb84fe34791d0509",
57
+ "checksum" => "64b0107722401f5ee39eebec03b9c5a68a14967e8aa8806848df930f85a8afaf",
58
58
  "filename" => "appsignal-aarch64-darwin-all-static.tar.gz"
59
59
  },
60
60
  "dynamic" => {
61
- "checksum" => "21941505aed9051c31883e29e3b2de1816ef881ae68dc30cb0fd39104b5fcd4f",
61
+ "checksum" => "3c1e8da7ce62cfd72b3f83c212baf8ddcf3998b8c37fdcb990d1fc9397488428",
62
62
  "filename" => "appsignal-aarch64-darwin-all-dynamic.tar.gz"
63
63
  }
64
64
  },
65
65
  "aarch64-linux" => {
66
66
  "static" => {
67
- "checksum" => "02d62cfab5ab81faec40db6d80d47e53b2fca640026715697ab43f19539ace34",
67
+ "checksum" => "02dd40769daa5cde64dfee9e0931d0432c4ccffeb6c08197cccc454234fdae2c",
68
68
  "filename" => "appsignal-aarch64-linux-all-static.tar.gz"
69
69
  },
70
70
  "dynamic" => {
71
- "checksum" => "8b580113f28781063be3538c8097c837ac85c3213c80d2597c00e32786921ef1",
71
+ "checksum" => "1eaeed41ec98cb930454944cf27d45e5bb35805d303503ea00f59dbaccce7c37",
72
72
  "filename" => "appsignal-aarch64-linux-all-dynamic.tar.gz"
73
73
  }
74
74
  },
75
75
  "i686-linux" => {
76
76
  "static" => {
77
- "checksum" => "d5771f360fbb24eb6d39459a910fcbb097904f8459a1735747dde3589c7d710d",
77
+ "checksum" => "4e19e1db93add17a71aaf2fd14ddf4cbd6913338f8ebeb0569baa59e154e8999",
78
78
  "filename" => "appsignal-i686-linux-all-static.tar.gz"
79
79
  },
80
80
  "dynamic" => {
81
- "checksum" => "03a066d55a5722802d053f8bdfdbe4bcb4ba9ee72b27d6a39aa62adad037f273",
81
+ "checksum" => "df508739e7f67824566e6388966c1f88df1b835abc519cb1f3c8297dd6ff1fe2",
82
82
  "filename" => "appsignal-i686-linux-all-dynamic.tar.gz"
83
83
  }
84
84
  },
85
85
  "x86-linux" => {
86
86
  "static" => {
87
- "checksum" => "d5771f360fbb24eb6d39459a910fcbb097904f8459a1735747dde3589c7d710d",
87
+ "checksum" => "4e19e1db93add17a71aaf2fd14ddf4cbd6913338f8ebeb0569baa59e154e8999",
88
88
  "filename" => "appsignal-i686-linux-all-static.tar.gz"
89
89
  },
90
90
  "dynamic" => {
91
- "checksum" => "03a066d55a5722802d053f8bdfdbe4bcb4ba9ee72b27d6a39aa62adad037f273",
91
+ "checksum" => "df508739e7f67824566e6388966c1f88df1b835abc519cb1f3c8297dd6ff1fe2",
92
92
  "filename" => "appsignal-i686-linux-all-dynamic.tar.gz"
93
93
  }
94
94
  },
95
95
  "x86_64-linux" => {
96
96
  "static" => {
97
- "checksum" => "f3efd7973a0a4b5a0dca7ef23a896a866f011e70d90e2d22cd77c343ffbdf0c1",
97
+ "checksum" => "1150865e4a9b6d773a10702414b9b0b7cc69a72c0cbb17f5a01cebf40cabbcc4",
98
98
  "filename" => "appsignal-x86_64-linux-all-static.tar.gz"
99
99
  },
100
100
  "dynamic" => {
101
- "checksum" => "0900dd8f79838943532db19876018d95065b851eeb5f01c15dfb227bce7a01d8",
101
+ "checksum" => "b17ed8c85171638f14d0ff3bca9d83894a9d2966da0a4554ba9b6cd1197a0a54",
102
102
  "filename" => "appsignal-x86_64-linux-all-dynamic.tar.gz"
103
103
  }
104
104
  },
105
105
  "x86_64-linux-musl" => {
106
106
  "static" => {
107
- "checksum" => "9e0cc593389e08527d2e62cc4389711a137511021fd59abd311da8ef5343aee6",
107
+ "checksum" => "86fe06ca6dcc93e68a9c603c9087f15b0cef213f4df0eab6c0b495034045cde0",
108
108
  "filename" => "appsignal-x86_64-linux-musl-all-static.tar.gz"
109
109
  },
110
110
  "dynamic" => {
111
- "checksum" => "b4420a303780e8733387338dca5a0f7dce03c4e0ec95526ec108bc66f39970ab",
111
+ "checksum" => "6b68164b768fda589390d34f3c20ac7fe19c7a64a864af723fad52abf981492b",
112
112
  "filename" => "appsignal-x86_64-linux-musl-all-dynamic.tar.gz"
113
113
  }
114
114
  },
115
115
  "aarch64-linux-musl" => {
116
116
  "static" => {
117
- "checksum" => "5112c3d0b22f27e6ed108d671ec2903f4cbe084c8d104a05bc946d88ccfed633",
117
+ "checksum" => "a3b2e4eb3a32408cbbc5b0a12b1d61322378ce0dc30edfb1c541a43d0c5306ff",
118
118
  "filename" => "appsignal-aarch64-linux-musl-all-static.tar.gz"
119
119
  },
120
120
  "dynamic" => {
121
- "checksum" => "f15aaacdb197b114113c9a382ab371623e49ed0593af8a7d3c7d84aa10b77556",
121
+ "checksum" => "72163a268416a7171e69bd68f3cf4b732989107eb25b9a910618cc66079a1c87",
122
122
  "filename" => "appsignal-aarch64-linux-musl-all-dynamic.tar.gz"
123
123
  }
124
124
  },
125
125
  "x86_64-freebsd" => {
126
126
  "static" => {
127
- "checksum" => "5d87cf82173f95440277b4565a58742c2843f0ddb17bf8f285023c294d1d30ad",
127
+ "checksum" => "a4982fab5a7b4a4292bd0002e3bc571cbeced167c6a3e36f6c26e7898b3d38a7",
128
128
  "filename" => "appsignal-x86_64-freebsd-all-static.tar.gz"
129
129
  },
130
130
  "dynamic" => {
131
- "checksum" => "9ba8d1c731212b23dccd76f22ad6979da160fe0d688f383acf8126c8922ecbdf",
131
+ "checksum" => "0dd1afc8e0896b87ce76b65358806e0b89213ffb8727a50d926c987978c5e1ee",
132
132
  "filename" => "appsignal-x86_64-freebsd-all-dynamic.tar.gz"
133
133
  }
134
134
  },
135
135
  "amd64-freebsd" => {
136
136
  "static" => {
137
- "checksum" => "5d87cf82173f95440277b4565a58742c2843f0ddb17bf8f285023c294d1d30ad",
137
+ "checksum" => "a4982fab5a7b4a4292bd0002e3bc571cbeced167c6a3e36f6c26e7898b3d38a7",
138
138
  "filename" => "appsignal-x86_64-freebsd-all-static.tar.gz"
139
139
  },
140
140
  "dynamic" => {
141
- "checksum" => "9ba8d1c731212b23dccd76f22ad6979da160fe0d688f383acf8126c8922ecbdf",
141
+ "checksum" => "0dd1afc8e0896b87ce76b65358806e0b89213ffb8727a50d926c987978c5e1ee",
142
142
  "filename" => "appsignal-x86_64-freebsd-all-dynamic.tar.gz"
143
143
  }
144
144
  }
@@ -38,7 +38,7 @@ module Appsignal
38
38
  @mutex = Mutex.new
39
39
  @default_attributes = attributes
40
40
  @appsignal_attributes = {}
41
- @tags = []
41
+ @loggers = []
42
42
  end
43
43
 
44
44
  # We support the various methods in the Ruby
@@ -59,13 +59,14 @@ module Appsignal
59
59
  end
60
60
  return if message.nil?
61
61
 
62
- if @tags.any?
63
- formatted_tags = @tags.map { |tag| "[#{tag}]" }
64
- message = "#{formatted_tags.join(" ")} #{message}"
65
- end
66
-
67
62
  message = formatter.call(severity, Time.now, group, message) if formatter
68
63
 
64
+ @loggers.each do |logger|
65
+ logger.add(severity, message, group)
66
+ rescue
67
+ nil
68
+ end
69
+
69
70
  unless message.is_a?(String)
70
71
  Appsignal.internal_logger.warn(
71
72
  "Logger message was ignored, because it was not a String: #{message.inspect}"
@@ -150,41 +151,23 @@ module Appsignal
150
151
  add_with_attributes(FATAL, message, @group, attributes)
151
152
  end
152
153
 
153
- # Listen to ActiveSupport tagged logging tags set with `Rails.logger.tagged`.
154
- def tagged(tags)
155
- @tags.append(*tags)
156
- yield self
157
- ensure
158
- @tags.pop(tags.length)
159
- end
160
-
161
- # Listen to ActiveSupport tagged logging tags set with `Rails.config.log_tags`.
162
- def push_tags(*tags)
163
- @tags.append(*tags)
164
- end
165
-
166
- # Remove a set of ActiveSupport tagged logging tags set with `Rails.config.log_tags`.
167
- def pop_tags(count = 1)
168
- @tags.pop(count)
169
- end
170
-
171
- # Remove all ActiveSupport tagged logging tags set with `Rails.config.log_tags`.
172
- def clear_tags!
173
- @tags.clear
174
- end
175
-
176
154
  # When using ActiveSupport::TaggedLogging without the broadcast feature,
177
155
  # the passed logger is required to respond to the `silence` method.
178
- # In our case it behaves as the broadcast feature of the Rails logger, but
179
- # we don't have to check if the parent logger has the `silence` method defined
180
- # as our logger directly inherits from Ruby base logger.
181
156
  #
182
- # Links:
157
+ # Reference links:
183
158
  #
184
159
  # - https://github.com/rails/rails/blob/e11ebc04cfbe41c06cdfb70ee5a9fdbbd98bb263/activesupport/lib/active_support/logger.rb#L60-L76
185
- # - https://github.com/rails/rails/blob/main/activesupport/e11ebc04cfbe41c06cdfb70ee5a9fdbbd98bb263/active_support/logger_silence.rb
186
- def silence(_severity = ERROR, &block)
187
- block.call
160
+ # - https://github.com/rails/rails/blob/e11ebc04cfbe41c06cdfb70ee5a9fdbbd98bb263/activesupport/lib/active_support/logger_silence.rb
161
+ def silence(severity = ERROR, &block)
162
+ previous_level = @level
163
+ @level = severity
164
+ block.call(self)
165
+ ensure
166
+ @level = previous_level
167
+ end
168
+
169
+ def broadcast_to(logger)
170
+ @loggers << logger
188
171
  end
189
172
 
190
173
  private
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Appsignal
4
- VERSION = "4.2.3"
4
+ VERSION = "4.3.1"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: appsignal
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.2.3
4
+ version: 4.3.1
5
5
  platform: java
6
6
  authors:
7
7
  - Robert Beekman
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2024-12-17 00:00:00.000000000 Z
13
+ date: 2024-12-20 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: logger