appsignal 3.7.4 → 3.7.5

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: 2e1761916266f8e937324fdd06fc35239e346cef46a5835b3a4f605a724a4b32
4
- data.tar.gz: 83a356f5c62b027e785a3ee5718d26df65301fb0adfad597a5699c59f754da5d
3
+ metadata.gz: 01c402441faf18659ecff6becf0b7ae9db255825cc873edd5bf2ccc3aaa62c6b
4
+ data.tar.gz: 3b9e4c29a62c073f8c9395c26f26dcfc4496af5ca9352193f04983d11bca9476
5
5
  SHA512:
6
- metadata.gz: 6ddf7ffc0c9edfbe34ba1825f2e4abfc89df5238aa1866bae9652f11629c760ad7d638824650321b3e8728b409c0c9e30b64653ffd6ac1df07413490544bf7b0
7
- data.tar.gz: 41be1cf851cbf8c64b2a3c0e24811c47a838e77a9ed320a9ef1695690fd186a2101feb7603166e53f44a6de9992ebec306c2b4d513ea5e663b91354307a2cbe6
6
+ metadata.gz: 3c1994c27480cbc29310b88c81ad09534885cf3acd43b7d2439921cf54c2f252023b44e0bf40c0f4b6fa4145fc86f2ba9ff36feca8357874576e928c75bec3e4
7
+ data.tar.gz: 2d77c4799ba521b3832ebba0d632a70774d767a92e694cfa23a6e82c4c25c05556f5ebad03e571e09d1ce34be234ac7ede1ae3df601247b23cb4df7ccadfe5a9
data/CHANGELOG.md CHANGED
@@ -1,5 +1,32 @@
1
1
  # AppSignal for Ruby gem Changelog
2
2
 
3
+ ## 3.7.5
4
+
5
+ _Published on 2024-05-14._
6
+
7
+ ### Added
8
+
9
+ - [bf81e165](https://github.com/appsignal/appsignal-ruby/commit/bf81e16593c7598e266d1e4cfb108aeef2ed7e73) patch - Support events emitted by ViewComponent. Rendering of ViewComponent-based components will appear as events in your performance samples' event timeline.
10
+
11
+ For AppSignal to instrument ViewComponent events, you must first configure ViewComponent to emit those events:
12
+
13
+ ```ruby
14
+ # config/application.rb
15
+ module MyRailsApp
16
+ class Application < Rails::Application
17
+ config.view_component.instrumentation_enabled = true
18
+ config.view_component.use_deprecated_instrumentation_name = false
19
+ end
20
+ end
21
+ ```
22
+
23
+ Thanks to Trae Robrock (@trobrock) for providing a starting point for this implementation!
24
+ - [ad5c9955](https://github.com/appsignal/appsignal-ruby/commit/ad5c99556421fe86501205465053466a91f28448) patch - Support Kamal-based deployments. Read the `KAMAL_VERSION` environment variable, which Kamal exposes within the deployed container, if present, and use it as the application revision if it is not set. This will automatically report deploy markers for applications using Kamal.
25
+
26
+ ### Fixed
27
+
28
+ - [30bb675f](https://github.com/appsignal/appsignal-ruby/commit/30bb675ffa99ec1949a613f309e6c1792b88d4ce) patch - Fix an issue where an error about the AppSignal internal logger is raised when sending a heartbeat.
29
+
3
30
  ## 3.7.4
4
31
 
5
32
  _Published on 2024-05-09._
data/Rakefile CHANGED
@@ -324,7 +324,7 @@ begin
324
324
 
325
325
  desc "Run the AppSignal gem test suite."
326
326
  RSpec::Core::RakeTask.new :test do |t|
327
- t.rspec_opts = exclude_pattern
327
+ t.rspec_opts = "#{exclude_pattern} --format documentation"
328
328
  end
329
329
 
330
330
  namespace :test do
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.5",
9
+ "version" => "0.35.10",
10
10
  "mirrors" => [
11
11
  "https://appsignal-agent-releases.global.ssl.fastly.net",
12
12
  "https://d135dj0rjqvssy.cloudfront.net"
@@ -14,131 +14,131 @@ APPSIGNAL_AGENT_CONFIG = {
14
14
  "triples" => {
15
15
  "x86_64-darwin" => {
16
16
  "static" => {
17
- "checksum" => "3985b53b2a2814d44737182890e6fbe31b4b88361025140477a598e0e41fd948",
17
+ "checksum" => "8bdf6b162e03c5f63bc06f2d49ae789bb14e111636524ed78262bd543587a971",
18
18
  "filename" => "appsignal-x86_64-darwin-all-static.tar.gz"
19
19
  },
20
20
  "dynamic" => {
21
- "checksum" => "d135e2daf5c041a4ce7a7ab720cfd977fbae8375a007995e33a96558d3635792",
21
+ "checksum" => "92535e45232d5fe2eb7b9ff2f731115de566144390cd281449acd5c3a570ebb5",
22
22
  "filename" => "appsignal-x86_64-darwin-all-dynamic.tar.gz"
23
23
  }
24
24
  },
25
25
  "universal-darwin" => {
26
26
  "static" => {
27
- "checksum" => "3985b53b2a2814d44737182890e6fbe31b4b88361025140477a598e0e41fd948",
27
+ "checksum" => "8bdf6b162e03c5f63bc06f2d49ae789bb14e111636524ed78262bd543587a971",
28
28
  "filename" => "appsignal-x86_64-darwin-all-static.tar.gz"
29
29
  },
30
30
  "dynamic" => {
31
- "checksum" => "d135e2daf5c041a4ce7a7ab720cfd977fbae8375a007995e33a96558d3635792",
31
+ "checksum" => "92535e45232d5fe2eb7b9ff2f731115de566144390cd281449acd5c3a570ebb5",
32
32
  "filename" => "appsignal-x86_64-darwin-all-dynamic.tar.gz"
33
33
  }
34
34
  },
35
35
  "aarch64-darwin" => {
36
36
  "static" => {
37
- "checksum" => "79d22436bfe32dab4661f2a4149c6ab34c71e810c5d808ee3e60cd9f8a1395e4",
37
+ "checksum" => "c6453bb54a68cdb0b42864747b328e60a14b5b99921f11757de03db42041bed2",
38
38
  "filename" => "appsignal-aarch64-darwin-all-static.tar.gz"
39
39
  },
40
40
  "dynamic" => {
41
- "checksum" => "2c49c8f24a9dd8f9d55c28015b3e1096180807e7b13d4a9cd8ed30f58bc6612f",
41
+ "checksum" => "920fa90c131752a40287b55356cd2360e17417753087b74dbf63c339f04dacc9",
42
42
  "filename" => "appsignal-aarch64-darwin-all-dynamic.tar.gz"
43
43
  }
44
44
  },
45
45
  "arm64-darwin" => {
46
46
  "static" => {
47
- "checksum" => "79d22436bfe32dab4661f2a4149c6ab34c71e810c5d808ee3e60cd9f8a1395e4",
47
+ "checksum" => "c6453bb54a68cdb0b42864747b328e60a14b5b99921f11757de03db42041bed2",
48
48
  "filename" => "appsignal-aarch64-darwin-all-static.tar.gz"
49
49
  },
50
50
  "dynamic" => {
51
- "checksum" => "2c49c8f24a9dd8f9d55c28015b3e1096180807e7b13d4a9cd8ed30f58bc6612f",
51
+ "checksum" => "920fa90c131752a40287b55356cd2360e17417753087b74dbf63c339f04dacc9",
52
52
  "filename" => "appsignal-aarch64-darwin-all-dynamic.tar.gz"
53
53
  }
54
54
  },
55
55
  "arm-darwin" => {
56
56
  "static" => {
57
- "checksum" => "79d22436bfe32dab4661f2a4149c6ab34c71e810c5d808ee3e60cd9f8a1395e4",
57
+ "checksum" => "c6453bb54a68cdb0b42864747b328e60a14b5b99921f11757de03db42041bed2",
58
58
  "filename" => "appsignal-aarch64-darwin-all-static.tar.gz"
59
59
  },
60
60
  "dynamic" => {
61
- "checksum" => "2c49c8f24a9dd8f9d55c28015b3e1096180807e7b13d4a9cd8ed30f58bc6612f",
61
+ "checksum" => "920fa90c131752a40287b55356cd2360e17417753087b74dbf63c339f04dacc9",
62
62
  "filename" => "appsignal-aarch64-darwin-all-dynamic.tar.gz"
63
63
  }
64
64
  },
65
65
  "aarch64-linux" => {
66
66
  "static" => {
67
- "checksum" => "4a54587bb61f59d0b60032b2e0c1d14d2e726e20af049353c2ff279d07dd3028",
67
+ "checksum" => "4e90ec4bce1e632316a26fdaf03ccd8773bf7a9615eb7a1739c8c53f3fa5221a",
68
68
  "filename" => "appsignal-aarch64-linux-all-static.tar.gz"
69
69
  },
70
70
  "dynamic" => {
71
- "checksum" => "aa2d011c538ce547c87110e7c8e49a24597d60ea2d1418032fc3db06267efba2",
71
+ "checksum" => "d4e5811ab29f801c59caafe445a06c686245666459a45a28240c2db7395abf27",
72
72
  "filename" => "appsignal-aarch64-linux-all-dynamic.tar.gz"
73
73
  }
74
74
  },
75
75
  "i686-linux" => {
76
76
  "static" => {
77
- "checksum" => "01e2237029c3af23cc6f348fb63f65a92b8caf8f4731b78d014bb4001559aad5",
77
+ "checksum" => "f5bcb9f732cb5af53a5de2f2c916156bdd6677c0e563ddafd23f09576440dfdc",
78
78
  "filename" => "appsignal-i686-linux-all-static.tar.gz"
79
79
  },
80
80
  "dynamic" => {
81
- "checksum" => "c1043ac92b000a406d9afb77b6ec1d3ab6cfffd63c218a720c11daa3edb7fd1f",
81
+ "checksum" => "52bf105113a3dbe1e9527c0c733edd3ee05788e340bd41577ed38878df6748f0",
82
82
  "filename" => "appsignal-i686-linux-all-dynamic.tar.gz"
83
83
  }
84
84
  },
85
85
  "x86-linux" => {
86
86
  "static" => {
87
- "checksum" => "01e2237029c3af23cc6f348fb63f65a92b8caf8f4731b78d014bb4001559aad5",
87
+ "checksum" => "f5bcb9f732cb5af53a5de2f2c916156bdd6677c0e563ddafd23f09576440dfdc",
88
88
  "filename" => "appsignal-i686-linux-all-static.tar.gz"
89
89
  },
90
90
  "dynamic" => {
91
- "checksum" => "c1043ac92b000a406d9afb77b6ec1d3ab6cfffd63c218a720c11daa3edb7fd1f",
91
+ "checksum" => "52bf105113a3dbe1e9527c0c733edd3ee05788e340bd41577ed38878df6748f0",
92
92
  "filename" => "appsignal-i686-linux-all-dynamic.tar.gz"
93
93
  }
94
94
  },
95
95
  "x86_64-linux" => {
96
96
  "static" => {
97
- "checksum" => "beae1db2c122eb579f1ccb450177b0c64d65569d774efc7a1ee72c42d3382d39",
97
+ "checksum" => "6faa14f508f7c27b65d912eedb31f7808e1e2fb1dcaa077db2426c321e1f5c65",
98
98
  "filename" => "appsignal-x86_64-linux-all-static.tar.gz"
99
99
  },
100
100
  "dynamic" => {
101
- "checksum" => "67650f59d2ea9c99cde7dfe44da65a506522a3cdccabe697931d89ebaea96d18",
101
+ "checksum" => "0981839a288dc2ab6d024bae79789a20f5cadce55c4cbcade925066b83028b65",
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" => "521c4486d10cdafa1f72103cc439d6f0e4f549f1522c4473bf43dc487ec42436",
107
+ "checksum" => "8f54b734e56eae7867b5474c7ad4d79e049fd4063202e1b80989795708354e49",
108
108
  "filename" => "appsignal-x86_64-linux-musl-all-static.tar.gz"
109
109
  },
110
110
  "dynamic" => {
111
- "checksum" => "0a94fcee8eb1f8fd06fce3eacffbcf9f2a52f5cde040796e19a589176525db4b",
111
+ "checksum" => "01df4f408e2c0f83204bedfe33e132bfdc6c4a9dcff6581bacf30df45140a49e",
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" => "c29aab31f4ca59efb1483f48c0cb3c27d799347b81655a28f24c146b55aa7db6",
117
+ "checksum" => "b3d247d632e3465b2233dd8bb2e977f248f14286ca870e9bd7b855b550ba1c00",
118
118
  "filename" => "appsignal-aarch64-linux-musl-all-static.tar.gz"
119
119
  },
120
120
  "dynamic" => {
121
- "checksum" => "4b77ea0c1f50ada6e5f6ed693002e56db1e34e0e9d5fdb4ac80fc52fd51099b8",
121
+ "checksum" => "52d4a422bcf3a9bbbb6119abae21f6b1d1191309103bcfb90a1f786b1af64a71",
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" => "a3598e9df1b6b5970aabbbccbe4e77c2372d2320cd87bfa20f32fca53b8505e4",
127
+ "checksum" => "1cce550eac963e2edf405e551a613ffd15ae69e4b817b6155b8a5783a9fa9b7f",
128
128
  "filename" => "appsignal-x86_64-freebsd-all-static.tar.gz"
129
129
  },
130
130
  "dynamic" => {
131
- "checksum" => "4cbfd5e16776c8ea4308ee7f3a096c5cc137f2506f8a05d9c8504e3483fcd8ac",
131
+ "checksum" => "ea67b696f806127ac7e59d3dd02a5ca47de1526455b957bad4fd69d9b08913fe",
132
132
  "filename" => "appsignal-x86_64-freebsd-all-dynamic.tar.gz"
133
133
  }
134
134
  },
135
135
  "amd64-freebsd" => {
136
136
  "static" => {
137
- "checksum" => "a3598e9df1b6b5970aabbbccbe4e77c2372d2320cd87bfa20f32fca53b8505e4",
137
+ "checksum" => "1cce550eac963e2edf405e551a613ffd15ae69e4b817b6155b8a5783a9fa9b7f",
138
138
  "filename" => "appsignal-x86_64-freebsd-all-static.tar.gz"
139
139
  },
140
140
  "dynamic" => {
141
- "checksum" => "4cbfd5e16776c8ea4308ee7f3a096c5cc137f2506f8a05d9c8504e3483fcd8ac",
141
+ "checksum" => "ea67b696f806127ac7e59d3dd02a5ca47de1526455b957bad4fd69d9b08913fe",
142
142
  "filename" => "appsignal-x86_64-freebsd-all-dynamic.tar.gz"
143
143
  }
144
144
  }
@@ -3,6 +3,7 @@ source "https://rubygems.org"
3
3
  gem "rails", "~> 7.1.0"
4
4
  gem "rake", "> 12.2"
5
5
  gem "sidekiq"
6
+ gem "view_component"
6
7
 
7
8
  # Fix install issue for jruby on gem 3.1.8.
8
9
  # No java stub is published.
@@ -0,0 +1,33 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Appsignal
4
+ class EventFormatter
5
+ # @api private
6
+ module ViewComponent
7
+ class RenderFormatter
8
+ BLANK = ""
9
+
10
+ attr_reader :root_path
11
+
12
+ def initialize
13
+ @root_path = "#{Rails.root}/"
14
+ end
15
+
16
+ def format(payload)
17
+ [payload[:name], payload[:identifier].sub(@root_path, BLANK)]
18
+ end
19
+ end
20
+ end
21
+ end
22
+ end
23
+
24
+ if defined?(Rails) && defined?(ViewComponent)
25
+ Appsignal::EventFormatter.register(
26
+ "render.view_component",
27
+ Appsignal::EventFormatter::ViewComponent::RenderFormatter
28
+ )
29
+ Appsignal::EventFormatter.register(
30
+ "!render.view_component",
31
+ Appsignal::EventFormatter::ViewComponent::RenderFormatter
32
+ )
33
+ end
@@ -45,7 +45,7 @@ module Appsignal
45
45
  response = self.class.transmitter.transmit(event(kind))
46
46
 
47
47
  if response.code.to_i >= 200 && response.code.to_i < 300
48
- Appsignal.internal_logger.trace("Transmitted heartbeat `#{name}` (#{id}) #{kind} event")
48
+ Appsignal.internal_logger.debug("Transmitted heartbeat `#{name}` (#{id}) #{kind} event")
49
49
  else
50
50
  Appsignal.internal_logger.error(
51
51
  "Failed to transmit heartbeat event: status code was #{response.code}"
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Appsignal
4
- VERSION = "3.7.4"
4
+ VERSION = "3.7.5"
5
5
  end
@@ -0,0 +1,43 @@
1
+ describe Appsignal::EventFormatter::ViewComponent::RenderFormatter do
2
+ let(:klass) { Appsignal::EventFormatter::ViewComponent::RenderFormatter }
3
+
4
+ if DependencyHelper.rails_present? && DependencyHelper.view_component_present?
5
+ require "view_component"
6
+
7
+ context "when in a Rails app" do
8
+ let(:formatter) { klass.new }
9
+ before { allow(Rails.root).to receive(:to_s).and_return("/var/www/app/20130101") }
10
+
11
+ it "registers render.view_component and (deprecated) !render.view_component" do
12
+ expect(Appsignal::EventFormatter.registered?("render.view_component",
13
+ klass)).to be_truthy
14
+ expect(Appsignal::EventFormatter.registered?("!render.view_component",
15
+ klass)).to be_truthy
16
+ end
17
+
18
+ describe "#format" do
19
+ subject { formatter.format(payload) }
20
+
21
+ context "with a name and identifier" do
22
+ let(:payload) do
23
+ {
24
+ :name => "WhateverComponent",
25
+ :identifier => "/var/www/app/20130101/app/components/whatever_component.rb"
26
+ }
27
+ end
28
+
29
+ it { is_expected.to eq ["WhateverComponent", "app/components/whatever_component.rb"] }
30
+ end
31
+ end
32
+ end
33
+ else
34
+ context "when not in a Rails app with the ViewComponent gem" do
35
+ it "does not register the event formatter" do
36
+ expect(Appsignal::EventFormatter.registered?("render.view_component",
37
+ klass)).to be_falsy
38
+ expect(Appsignal::EventFormatter.registered?("!render.view_component",
39
+ klass)).to be_falsy
40
+ end
41
+ end
42
+ end
43
+ end
@@ -24,7 +24,26 @@ describe Appsignal::Heartbeat do
24
24
  expect(transmitter).to receive(:transmit).with(hash_including(
25
25
  :name => "heartbeat-name",
26
26
  :kind => "start"
27
- )).and_return(nil)
27
+ )).and_return(Net::HTTPResponse.new(nil, "200", nil))
28
+
29
+ expect(Appsignal.internal_logger).to receive(:debug).with(
30
+ "Transmitted heartbeat `heartbeat-name` (#{heartbeat.id}) start event"
31
+ )
32
+ expect(Appsignal.internal_logger).not_to receive(:error)
33
+
34
+ heartbeat.start
35
+ end
36
+
37
+ it "should log an error if it fails" do
38
+ expect(transmitter).to receive(:transmit).with(hash_including(
39
+ :name => "heartbeat-name",
40
+ :kind => "start"
41
+ )).and_return(Net::HTTPResponse.new(nil, "499", nil))
42
+
43
+ expect(Appsignal.internal_logger).not_to receive(:debug)
44
+ expect(Appsignal.internal_logger).to receive(:error).with(
45
+ "Failed to transmit heartbeat event: status code was 499"
46
+ )
28
47
 
29
48
  heartbeat.start
30
49
  end
@@ -35,7 +54,26 @@ describe Appsignal::Heartbeat do
35
54
  expect(transmitter).to receive(:transmit).with(hash_including(
36
55
  :name => "heartbeat-name",
37
56
  :kind => "finish"
38
- )).and_return(nil)
57
+ )).and_return(Net::HTTPResponse.new(nil, "200", nil))
58
+
59
+ expect(Appsignal.internal_logger).to receive(:debug).with(
60
+ "Transmitted heartbeat `heartbeat-name` (#{heartbeat.id}) finish event"
61
+ )
62
+ expect(Appsignal.internal_logger).not_to receive(:error)
63
+
64
+ heartbeat.finish
65
+ end
66
+
67
+ it "should log an error if it fails" do
68
+ expect(transmitter).to receive(:transmit).with(hash_including(
69
+ :name => "heartbeat-name",
70
+ :kind => "finish"
71
+ )).and_return(Net::HTTPResponse.new(nil, "499", nil))
72
+
73
+ expect(Appsignal.internal_logger).not_to receive(:debug)
74
+ expect(Appsignal.internal_logger).to receive(:error).with(
75
+ "Failed to transmit heartbeat event: status code was 499"
76
+ )
39
77
 
40
78
  heartbeat.finish
41
79
  end
@@ -131,6 +131,10 @@ module DependencyHelper # rubocop:disable Metrics/ModuleLength
131
131
  hanami_present? && Gem.loaded_specs["hanami"].version >= Gem::Version.new("2.0")
132
132
  end
133
133
 
134
+ def view_component_present?
135
+ dependency_present? "view_component"
136
+ end
137
+
134
138
  def dependency_present?(dependency_file)
135
139
  Gem.loaded_specs.key? dependency_file
136
140
  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: 3.7.4
4
+ version: 3.7.5
5
5
  platform: ruby
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-05-09 00:00:00.000000000 Z
13
+ date: 2024-05-14 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rack
@@ -203,6 +203,7 @@ files:
203
203
  - lib/appsignal/event_formatter/mongo_ruby_driver/query_formatter.rb
204
204
  - lib/appsignal/event_formatter/rom/sql_formatter.rb
205
205
  - lib/appsignal/event_formatter/sequel/sql_formatter.rb
206
+ - lib/appsignal/event_formatter/view_component/render_formatter.rb
206
207
  - lib/appsignal/extension.rb
207
208
  - lib/appsignal/extension/jruby.rb
208
209
  - lib/appsignal/garbage_collection.rb
@@ -313,6 +314,7 @@ files:
313
314
  - spec/lib/appsignal/event_formatter/mongo_ruby_driver/query_formatter_spec.rb
314
315
  - spec/lib/appsignal/event_formatter/rom/sql_formatter_spec.rb
315
316
  - spec/lib/appsignal/event_formatter/sequel/sql_formatter_spec.rb
317
+ - spec/lib/appsignal/event_formatter/view_component/render_formatter_spec.rb
316
318
  - spec/lib/appsignal/event_formatter_spec.rb
317
319
  - spec/lib/appsignal/extension/jruby_spec.rb
318
320
  - spec/lib/appsignal/extension_install_failure_spec.rb