appsignal 2.10.8 → 2.10.12
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.semaphore/semaphore.yml +1 -1
- data/CHANGELOG.md +19 -0
- data/README.md +4 -4
- data/appsignal.gemspec +1 -1
- data/build_matrix.yml +2 -2
- data/ext/agent.yml +19 -19
- data/ext/base.rb +11 -2
- data/lib/appsignal/cli/diagnose.rb +1 -1
- data/lib/appsignal/config.rb +36 -2
- data/lib/appsignal/integrations/resque_active_job.rb +10 -4
- data/lib/appsignal/rack/js_exception_catcher.rb +5 -2
- data/lib/appsignal/version.rb +1 -1
- data/spec/lib/appsignal/capistrano2_spec.rb +1 -1
- data/spec/lib/appsignal/capistrano3_spec.rb +1 -1
- data/spec/lib/appsignal/cli/diagnose_spec.rb +44 -1
- data/spec/lib/appsignal/config_spec.rb +25 -1
- data/spec/lib/appsignal/integrations/resque_active_job_spec.rb +55 -13
- data/spec/lib/appsignal/marker_spec.rb +1 -1
- data/spec/lib/appsignal/rack/js_exception_catcher_spec.rb +9 -4
- data/spec/support/helpers/config_helpers.rb +3 -2
- data/spec/support/helpers/dependency_helper.rb +5 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a5be928ff6008a98a5927b4af5b1aff886fa614c977bd0c15949d5058812271f
|
4
|
+
data.tar.gz: 281d028e86f29716f4686ed4bb24ee6ee980796501f7884d812244ba3b5bc26b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fd2e0585cdb1b54d8b517fcacb3580d17bee2836c0c387ee13b9c345d17ea8f75a3a1c5b4279e58938ec2f53d9ccf309a84047de3088a0e239663b6e07b1c968
|
7
|
+
data.tar.gz: cebe9bd028f453e4febcb4db07eef315b1b4e13353a412d9134e040f3cda8912247f566a275436e6798e5f49eea0f0424e5d1dfeb0a811cd37c213ab55d69f24
|
data/.semaphore/semaphore.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,24 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
# 2.10.12
|
4
|
+
- Fix `working_directory_path` config option loaded from environment variables.
|
5
|
+
PR #653
|
6
|
+
|
7
|
+
# 2.10.11
|
8
|
+
- Fix extension install report status output in `appsignal diagnose`. PR #636
|
9
|
+
- Support setting a specific configuration file to load with the
|
10
|
+
`Appsignal::Config` initializer. PR #638
|
11
|
+
|
12
|
+
# 2.10.10
|
13
|
+
- Bump agent to v-4548c88. PR #634
|
14
|
+
- Fix issue with host metrics values being reported as "Infinity".
|
15
|
+
|
16
|
+
# 2.10.9
|
17
|
+
- Use http proxy if configured when downloading agent. PR #606
|
18
|
+
- Clear event details cache every 48 hours.
|
19
|
+
Commit eb5e899db69fcd7cfa221567bfd6ac04f2654c9c
|
20
|
+
- Add support for Resque ActiveJob queue time reporting. PR #616
|
21
|
+
|
3
22
|
## 2.10.8
|
4
23
|
- Fix failed checksum error log. PR #609
|
5
24
|
- Fix DelayedJob action name detection for objects that listen to the `[]`
|
data/README.md
CHANGED
@@ -9,7 +9,7 @@ issues.
|
|
9
9
|
- [Ruby code documentation][ruby-doc]
|
10
10
|
- [Support][contact]
|
11
11
|
|
12
|
-
[![Build status](https://appsignal.semaphoreci.com/badges/appsignal-ruby/branches/
|
12
|
+
[![Build status](https://appsignal.semaphoreci.com/badges/appsignal-ruby/branches/main.svg)](https://appsignal.semaphoreci.com/projects/appsignal-ruby)
|
13
13
|
[![Gem Version](https://badge.fury.io/rb/appsignal.svg)](http://badge.fury.io/rb/appsignal)
|
14
14
|
[![Code Climate](https://codeclimate.com/github/appsignal/appsignal.png)](https://codeclimate.com/github/appsignal/appsignal)
|
15
15
|
|
@@ -183,7 +183,7 @@ installing the AppSignal C-extension.
|
|
183
183
|
# Gemfile
|
184
184
|
gem "appsignal",
|
185
185
|
:git => "https://github.com/appsignal/appsignal-ruby.git",
|
186
|
-
:branch => "
|
186
|
+
:branch => "main"
|
187
187
|
```
|
188
188
|
|
189
189
|
When you need to use a git source of the gem in your JRuby install, you'll need
|
@@ -242,12 +242,12 @@ a number of different Ruby versions.
|
|
242
242
|
|
243
243
|
This gem uses [Semantic Versioning][semver].
|
244
244
|
|
245
|
-
The `
|
245
|
+
The `main` branch corresponds to the current stable release of the gem.
|
246
246
|
|
247
247
|
The `develop` branch is used for development of features that will end up in
|
248
248
|
the next minor release.
|
249
249
|
|
250
|
-
Open a Pull Request on the `
|
250
|
+
Open a Pull Request on the `main` branch if you're fixing a bug. For new new
|
251
251
|
features, open a Pull Request on the `develop` branch.
|
252
252
|
|
253
253
|
Every stable and unstable release is tagged in git with a version tag.
|
data/appsignal.gemspec
CHANGED
@@ -29,7 +29,7 @@ Gem::Specification.new do |gem| # rubocop:disable Metrics/BlockLength
|
|
29
29
|
gem.metadata = {
|
30
30
|
"bug_tracker_uri" => "https://github.com/appsignal/appsignal-ruby/issues",
|
31
31
|
"changelog_uri" =>
|
32
|
-
"https://github.com/appsignal/appsignal-ruby/blob/
|
32
|
+
"https://github.com/appsignal/appsignal-ruby/blob/main/CHANGELOG.md",
|
33
33
|
"documentation_uri" => "https://docs.appsignal.com/ruby/",
|
34
34
|
"homepage_uri" => "https://docs.appsignal.com/ruby/",
|
35
35
|
"source_code_uri" => "https://github.com/appsignal/appsignal-ruby"
|
data/build_matrix.yml
CHANGED
@@ -10,8 +10,8 @@ semaphore: # Default `.semaphore/semaphore.yml` contents
|
|
10
10
|
# Cancel all running and queued workflows before this one
|
11
11
|
auto_cancel:
|
12
12
|
running:
|
13
|
-
# Ignore
|
14
|
-
when: "branch != '
|
13
|
+
# Ignore main AND develop branch as we want it to build all workflows
|
14
|
+
when: "branch != 'main' AND branch != 'develop'"
|
15
15
|
|
16
16
|
global_job_config:
|
17
17
|
env_vars:
|
data/ext/agent.yml
CHANGED
@@ -1,70 +1,70 @@
|
|
1
1
|
---
|
2
|
-
version:
|
2
|
+
version: 4548c88
|
3
3
|
mirrors:
|
4
4
|
- https://appsignal-agent-releases.global.ssl.fastly.net
|
5
5
|
- https://d135dj0rjqvssy.cloudfront.net
|
6
6
|
triples:
|
7
7
|
x86_64-darwin:
|
8
8
|
static:
|
9
|
-
checksum:
|
9
|
+
checksum: 322340b402d7750c107bc2c83be46598b3ec0baab27ab7083c6b49dde236cd45
|
10
10
|
filename: appsignal-x86_64-darwin-all-static.tar.gz
|
11
11
|
dynamic:
|
12
|
-
checksum:
|
12
|
+
checksum: e92cfc0eda7101a1f08b080233ee6f4385fe32a555b31fd62ab13e904686fbc8
|
13
13
|
filename: appsignal-x86_64-darwin-all-dynamic.tar.gz
|
14
14
|
universal-darwin:
|
15
15
|
static:
|
16
|
-
checksum:
|
16
|
+
checksum: 322340b402d7750c107bc2c83be46598b3ec0baab27ab7083c6b49dde236cd45
|
17
17
|
filename: appsignal-x86_64-darwin-all-static.tar.gz
|
18
18
|
dynamic:
|
19
|
-
checksum:
|
19
|
+
checksum: e92cfc0eda7101a1f08b080233ee6f4385fe32a555b31fd62ab13e904686fbc8
|
20
20
|
filename: appsignal-x86_64-darwin-all-dynamic.tar.gz
|
21
21
|
i686-linux:
|
22
22
|
static:
|
23
|
-
checksum:
|
23
|
+
checksum: '08addb14f53856cc1befcc4428bef7541e04ea733deb4bf600904cc780de95f5'
|
24
24
|
filename: appsignal-i686-linux-all-static.tar.gz
|
25
25
|
dynamic:
|
26
|
-
checksum:
|
26
|
+
checksum: c0c2b3a8ea9e32e686e089101c2f2b4533686eb183f4f30b9ab90cc452222bf0
|
27
27
|
filename: appsignal-i686-linux-all-dynamic.tar.gz
|
28
28
|
x86-linux:
|
29
29
|
static:
|
30
|
-
checksum:
|
30
|
+
checksum: '08addb14f53856cc1befcc4428bef7541e04ea733deb4bf600904cc780de95f5'
|
31
31
|
filename: appsignal-i686-linux-all-static.tar.gz
|
32
32
|
dynamic:
|
33
|
-
checksum:
|
33
|
+
checksum: c0c2b3a8ea9e32e686e089101c2f2b4533686eb183f4f30b9ab90cc452222bf0
|
34
34
|
filename: appsignal-i686-linux-all-dynamic.tar.gz
|
35
35
|
i686-linux-musl:
|
36
36
|
static:
|
37
|
-
checksum:
|
37
|
+
checksum: b9d3419bcca5a2fe07179af29b8e0fd26df73be46b18e9edaf1049d162eefed4
|
38
38
|
filename: appsignal-i686-linux-musl-all-static.tar.gz
|
39
39
|
x86-linux-musl:
|
40
40
|
static:
|
41
|
-
checksum:
|
41
|
+
checksum: b9d3419bcca5a2fe07179af29b8e0fd26df73be46b18e9edaf1049d162eefed4
|
42
42
|
filename: appsignal-i686-linux-musl-all-static.tar.gz
|
43
43
|
x86_64-linux:
|
44
44
|
static:
|
45
|
-
checksum:
|
45
|
+
checksum: 4befb33b621cb1d273b5dec9f3395271d4ecfe1d637d5f311c80bac105a06b4b
|
46
46
|
filename: appsignal-x86_64-linux-all-static.tar.gz
|
47
47
|
dynamic:
|
48
|
-
checksum:
|
48
|
+
checksum: c3696467fcb00aee14041b30f827524634babe3fd2f16bd20320d3f28fb11582
|
49
49
|
filename: appsignal-x86_64-linux-all-dynamic.tar.gz
|
50
50
|
x86_64-linux-musl:
|
51
51
|
static:
|
52
|
-
checksum:
|
52
|
+
checksum: 49b95f4c3d025b633e22632ca7b401b56d8acd448a545be3976466676d5aed54
|
53
53
|
filename: appsignal-x86_64-linux-musl-all-static.tar.gz
|
54
54
|
dynamic:
|
55
|
-
checksum:
|
55
|
+
checksum: db789b22a4ed788db73cbfca5c82cdee29d4d40bedd85a22176b95987ce2c07d
|
56
56
|
filename: appsignal-x86_64-linux-musl-all-dynamic.tar.gz
|
57
57
|
x86_64-freebsd:
|
58
58
|
static:
|
59
|
-
checksum:
|
59
|
+
checksum: b8734f66d077e9acd9fc990c812877b92e4fc783ee30f430d829da058d3a709f
|
60
60
|
filename: appsignal-x86_64-freebsd-all-static.tar.gz
|
61
61
|
dynamic:
|
62
|
-
checksum:
|
62
|
+
checksum: e8bce24495933d8fad137c1075abbf4173161d0ee3e830f83eb6bfecf309ada5
|
63
63
|
filename: appsignal-x86_64-freebsd-all-dynamic.tar.gz
|
64
64
|
amd64-freebsd:
|
65
65
|
static:
|
66
|
-
checksum:
|
66
|
+
checksum: b8734f66d077e9acd9fc990c812877b92e4fc783ee30f430d829da058d3a709f
|
67
67
|
filename: appsignal-x86_64-freebsd-all-static.tar.gz
|
68
68
|
dynamic:
|
69
|
-
checksum:
|
69
|
+
checksum: e8bce24495933d8fad137c1075abbf4173161d0ee3e830f83eb6bfecf309ada5
|
70
70
|
filename: appsignal-x86_64-freebsd-all-dynamic.tar.gz
|
data/ext/base.rb
CHANGED
@@ -32,7 +32,8 @@ def report
|
|
32
32
|
"version" => "#{rbconfig["ruby_version"]}-p#{rbconfig["PATCHLEVEL"]}"
|
33
33
|
},
|
34
34
|
"download" => {
|
35
|
-
"checksum" => "unverified"
|
35
|
+
"checksum" => "unverified",
|
36
|
+
"http_proxy" => http_proxy
|
36
37
|
},
|
37
38
|
"build" => {
|
38
39
|
"time" => Time.now.utc,
|
@@ -126,7 +127,11 @@ def download_archive(type)
|
|
126
127
|
report["download"]["download_url"] = download_url
|
127
128
|
|
128
129
|
begin
|
129
|
-
return open(
|
130
|
+
return open(
|
131
|
+
download_url,
|
132
|
+
:ssl_ca_cert => CA_CERT_PATH,
|
133
|
+
:proxy => http_proxy
|
134
|
+
)
|
130
135
|
rescue
|
131
136
|
next
|
132
137
|
end
|
@@ -174,3 +179,7 @@ def store_download_version_on_report
|
|
174
179
|
path = File.expand_path(File.join(File.dirname(__FILE__), "appsignal.version"))
|
175
180
|
report["build"]["agent_version"] = File.read(path).strip
|
176
181
|
end
|
182
|
+
|
183
|
+
def http_proxy
|
184
|
+
Gem.configuration[:http_proxy] || ENV["http_proxy"] || ENV["HTTP_PROXY"]
|
185
|
+
end
|
@@ -371,7 +371,7 @@ module Appsignal
|
|
371
371
|
end
|
372
372
|
|
373
373
|
def print_installation_result_report(report)
|
374
|
-
report = report.fetch("
|
374
|
+
report = report.fetch("result", {})
|
375
375
|
puts " Installation result"
|
376
376
|
puts " Status: #{report["status"]}"
|
377
377
|
puts " Message: #{report["message"]}" if report["message"]
|
data/lib/appsignal/config.rb
CHANGED
@@ -119,8 +119,41 @@ module Appsignal
|
|
119
119
|
:initial_config, :file_config, :env_config
|
120
120
|
attr_accessor :logger
|
121
121
|
|
122
|
-
|
122
|
+
# Initialize a new configuration object for AppSignal.
|
123
|
+
#
|
124
|
+
# If this is manually initialized, and not by {Appsignal.start}, it needs
|
125
|
+
# to be assigned to the {Appsignal.config} attribute.
|
126
|
+
#
|
127
|
+
# @example
|
128
|
+
# require "appsignal"
|
129
|
+
# Appsignal.config = Appsignal::Config.new(
|
130
|
+
# app_path,
|
131
|
+
# "production"
|
132
|
+
# )
|
133
|
+
# Appsignal.start
|
134
|
+
#
|
135
|
+
# @param root_path [String] Root path of the app.
|
136
|
+
# @param env [String] The environment to load when AppSignal is started. It
|
137
|
+
# will look for an environment with this name in the `config/appsignal.yml`
|
138
|
+
# config file.
|
139
|
+
# @param initial_config [Hash<String, Object>] The initial configuration to
|
140
|
+
# use. This will be overwritten by the file config and environment
|
141
|
+
# variables config.
|
142
|
+
# @param logger [Logger] The logger to use for the AppSignal gem. This is
|
143
|
+
# used by the configuration class only. Default: {Appsignal.logger}. See
|
144
|
+
# also {Appsignal.start_logger}.
|
145
|
+
# @param config_file [String] Custom config file location. Default
|
146
|
+
# `config/appsignal.yml`.
|
147
|
+
#
|
148
|
+
# @see https://docs.appsignal.com/ruby/configuration/
|
149
|
+
# Configuration documentation
|
150
|
+
# @see https://docs.appsignal.com/ruby/configuration/load-order.html
|
151
|
+
# Configuration load order
|
152
|
+
# @see https://docs.appsignal.com/ruby/instrumentation/integrating-appsignal.html
|
153
|
+
# How to integrate AppSignal manually
|
154
|
+
def initialize(root_path, env, initial_config = {}, logger = Appsignal.logger, config_file = nil)
|
123
155
|
@root_path = root_path
|
156
|
+
@config_file = config_file
|
124
157
|
@logger = logger
|
125
158
|
@valid = false
|
126
159
|
@config_hash = Hash[DEFAULT_CONFIG]
|
@@ -325,7 +358,8 @@ module Appsignal
|
|
325
358
|
%w[APPSIGNAL_PUSH_API_KEY APPSIGNAL_APP_NAME APPSIGNAL_PUSH_API_ENDPOINT
|
326
359
|
APPSIGNAL_FRONTEND_ERROR_CATCHING_PATH APPSIGNAL_HTTP_PROXY
|
327
360
|
APPSIGNAL_LOG APPSIGNAL_LOG_PATH APPSIGNAL_WORKING_DIR_PATH
|
328
|
-
APPSIGNAL_HOSTNAME
|
361
|
+
APPSIGNAL_WORKING_DIRECTORY_PATH APPSIGNAL_HOSTNAME
|
362
|
+
APPSIGNAL_CA_FILE_PATH APP_REVISION].each do |var|
|
329
363
|
env_var = ENV[var]
|
330
364
|
next unless env_var
|
331
365
|
config[ENV_TO_KEY_MAPPING[var]] = env_var
|
@@ -14,12 +14,18 @@ module Appsignal
|
|
14
14
|
Appsignal.config[:filter_parameters]
|
15
15
|
)
|
16
16
|
|
17
|
+
queue_start =
|
18
|
+
if job.respond_to?(:enqueued_at) && job.enqueued_at
|
19
|
+
Time.parse(job.enqueued_at).utc
|
20
|
+
end
|
21
|
+
|
17
22
|
Appsignal.monitor_single_transaction(
|
18
23
|
"perform_job.resque",
|
19
|
-
:class
|
20
|
-
:method
|
21
|
-
:params
|
22
|
-
:
|
24
|
+
:class => job.class.to_s,
|
25
|
+
:method => "perform",
|
26
|
+
:params => params,
|
27
|
+
:queue_start => queue_start,
|
28
|
+
:metadata => {
|
23
29
|
:id => job.job_id,
|
24
30
|
:queue => job.queue_name
|
25
31
|
}
|
@@ -29,8 +29,11 @@ module Appsignal
|
|
29
29
|
Appsignal.logger.debug \
|
30
30
|
"Initializing Appsignal::Rack::JSExceptionCatcher"
|
31
31
|
deprecation_message "The Appsignal::Rack::JSExceptionCatcher is " \
|
32
|
-
"deprecated
|
33
|
-
"integration
|
32
|
+
"deprecated and will be removed in a future version. Please use " \
|
33
|
+
"the official AppSignal JavaScript integration by disabling " \
|
34
|
+
"`enable_frontend_error_catching` in your configuration and " \
|
35
|
+
"installing AppSignal for JavaScript instead. " \
|
36
|
+
"(https://docs.appsignal.com/front-end/)"
|
34
37
|
@app = app
|
35
38
|
end
|
36
39
|
|
data/lib/appsignal/version.rb
CHANGED
@@ -10,7 +10,7 @@ if DependencyHelper.capistrano2_present?
|
|
10
10
|
let(:capistrano_config) do
|
11
11
|
Capistrano::Configuration.new.tap do |c|
|
12
12
|
c.set(:rails_env, "production")
|
13
|
-
c.set(:repository, "
|
13
|
+
c.set(:repository, "main")
|
14
14
|
c.set(:deploy_to, "/home/username/app")
|
15
15
|
c.set(:current_release, "")
|
16
16
|
c.set(:current_revision, "503ce0923ed177a3ce000005")
|
@@ -15,7 +15,7 @@ if DependencyHelper.capistrano3_present?
|
|
15
15
|
c.set(:log_level, :error)
|
16
16
|
c.set(:logger, logger)
|
17
17
|
c.set(:rails_env, "production")
|
18
|
-
c.set(:repository, "
|
18
|
+
c.set(:repository, "main")
|
19
19
|
c.set(:deploy_to, "/home/username/app")
|
20
20
|
c.set(:current_release, "")
|
21
21
|
c.set(:current_revision, "503ce0923ed177a3ce000005")
|
@@ -263,7 +263,8 @@ describe Appsignal::CLI::Diagnose, :api_stub => true, :send_report => :yes_cli_i
|
|
263
263
|
},
|
264
264
|
"download" => {
|
265
265
|
"download_url" => kind_of(String),
|
266
|
-
"checksum" => "verified"
|
266
|
+
"checksum" => "verified",
|
267
|
+
"http_proxy" => nil
|
267
268
|
},
|
268
269
|
"build" => {
|
269
270
|
"time" => kind_of(String),
|
@@ -289,6 +290,8 @@ describe Appsignal::CLI::Diagnose, :api_stub => true, :send_report => :yes_cli_i
|
|
289
290
|
jruby = Appsignal::System.jruby?
|
290
291
|
expect(output).to include(
|
291
292
|
"Extension installation report",
|
293
|
+
"Installation result",
|
294
|
+
" Status: success",
|
292
295
|
"Language details",
|
293
296
|
" Implementation: #{jruby ? "jruby" : "ruby"}",
|
294
297
|
" Ruby version: #{"#{rbconfig["ruby_version"]}-p#{rbconfig["PATCHLEVEL"]}"}",
|
@@ -309,6 +312,46 @@ describe Appsignal::CLI::Diagnose, :api_stub => true, :send_report => :yes_cli_i
|
|
309
312
|
)
|
310
313
|
end
|
311
314
|
|
315
|
+
context "with error in install report" do
|
316
|
+
let(:error) { RuntimeError.new("some error") }
|
317
|
+
before do
|
318
|
+
allow(File).to receive(:read).and_call_original
|
319
|
+
expect(File).to receive(:read)
|
320
|
+
.with(File.expand_path("../../../../../ext/install.report", __FILE__))
|
321
|
+
.and_return(
|
322
|
+
YAML.dump(
|
323
|
+
"result" => {
|
324
|
+
"status" => "error",
|
325
|
+
"error" => "RuntimeError: some error",
|
326
|
+
"backtrace" => error.backtrace
|
327
|
+
}
|
328
|
+
)
|
329
|
+
)
|
330
|
+
end
|
331
|
+
|
332
|
+
it "sends an error" do
|
333
|
+
run
|
334
|
+
expect(received_report["installation"]).to match(
|
335
|
+
"result" => {
|
336
|
+
"status" => "error",
|
337
|
+
"error" => "RuntimeError: some error",
|
338
|
+
"backtrace" => error.backtrace
|
339
|
+
}
|
340
|
+
)
|
341
|
+
end
|
342
|
+
|
343
|
+
it "prints the error" do
|
344
|
+
run
|
345
|
+
|
346
|
+
expect(output).to include(
|
347
|
+
"Extension installation report",
|
348
|
+
"Installation result",
|
349
|
+
"Status: error\n Error: RuntimeError: some error"
|
350
|
+
)
|
351
|
+
expect(output).to_not include("Raw report:")
|
352
|
+
end
|
353
|
+
end
|
354
|
+
|
312
355
|
context "without install report" do
|
313
356
|
let(:error) { RuntimeError.new("foo") }
|
314
357
|
before do
|
@@ -243,6 +243,27 @@ describe Appsignal::Config do
|
|
243
243
|
end
|
244
244
|
end
|
245
245
|
|
246
|
+
context "with an overriden config file" do
|
247
|
+
let(:config) do
|
248
|
+
project_fixture_config("production", {}, Appsignal.logger, File.join(project_fixture_path, "config", "appsignal.yml"))
|
249
|
+
end
|
250
|
+
|
251
|
+
it "is valid and active" do
|
252
|
+
expect(config.valid?).to be_truthy
|
253
|
+
expect(config.active?).to be_truthy
|
254
|
+
end
|
255
|
+
|
256
|
+
context "with an invalid overriden config file" do
|
257
|
+
let(:config) do
|
258
|
+
project_fixture_config("production", {}, Appsignal.logger, File.join(project_fixture_path, "config", "missing.yml"))
|
259
|
+
end
|
260
|
+
|
261
|
+
it "is not valid" do
|
262
|
+
expect(config.valid?).to be_falsy
|
263
|
+
end
|
264
|
+
end
|
265
|
+
end
|
266
|
+
|
246
267
|
context "with the config file causing an error" do
|
247
268
|
let(:config_path) do
|
248
269
|
File.expand_path(
|
@@ -396,6 +417,7 @@ describe Appsignal::Config do
|
|
396
417
|
:debug => true
|
397
418
|
)
|
398
419
|
end
|
420
|
+
let(:working_directory_path) { File.join(tmp_dir, "test_working_directory_path") }
|
399
421
|
let(:env_config) do
|
400
422
|
{
|
401
423
|
:running_in_container => true,
|
@@ -411,7 +433,8 @@ describe Appsignal::Config do
|
|
411
433
|
:instrument_sequel => false,
|
412
434
|
:files_world_accessible => false,
|
413
435
|
:request_headers => %w[accept accept-charset],
|
414
|
-
:revision => "v2.5.1"
|
436
|
+
:revision => "v2.5.1",
|
437
|
+
:working_directory_path => working_directory_path
|
415
438
|
}
|
416
439
|
end
|
417
440
|
before do
|
@@ -428,6 +451,7 @@ describe Appsignal::Config do
|
|
428
451
|
ENV["APPSIGNAL_INSTRUMENT_SEQUEL"] = "false"
|
429
452
|
ENV["APPSIGNAL_FILES_WORLD_ACCESSIBLE"] = "false"
|
430
453
|
ENV["APPSIGNAL_REQUEST_HEADERS"] = "accept,accept-charset"
|
454
|
+
ENV["APPSIGNAL_WORKING_DIRECTORY_PATH"] = working_directory_path
|
431
455
|
ENV["APP_REVISION"] = "v2.5.1"
|
432
456
|
end
|
433
457
|
|
@@ -1,21 +1,18 @@
|
|
1
|
-
if DependencyHelper.
|
1
|
+
if DependencyHelper.active_job_present?
|
2
2
|
require "active_job"
|
3
|
+
require File.expand_path("lib/appsignal/integrations/resque_active_job.rb")
|
4
|
+
|
5
|
+
class TestActiveJob < ActiveJob::Base
|
6
|
+
include Appsignal::Integrations::ResqueActiveJobPlugin
|
7
|
+
|
8
|
+
def perform(_)
|
9
|
+
end
|
10
|
+
end
|
3
11
|
|
4
12
|
describe Appsignal::Integrations::ResqueActiveJobPlugin do
|
5
|
-
let(:file) { File.expand_path("lib/appsignal/integrations/resque_active_job.rb") }
|
6
13
|
let(:args) { "argument" }
|
7
14
|
let(:job) { TestActiveJob.new(args) }
|
8
|
-
before
|
9
|
-
load file
|
10
|
-
start_agent
|
11
|
-
|
12
|
-
class TestActiveJob < ActiveJob::Base
|
13
|
-
include Appsignal::Integrations::ResqueActiveJobPlugin
|
14
|
-
|
15
|
-
def perform(_)
|
16
|
-
end
|
17
|
-
end
|
18
|
-
end
|
15
|
+
before { start_agent }
|
19
16
|
|
20
17
|
def perform
|
21
18
|
keep_transactions do
|
@@ -141,5 +138,50 @@ if DependencyHelper.resque_present? && DependencyHelper.active_job_present?
|
|
141
138
|
end
|
142
139
|
end
|
143
140
|
end
|
141
|
+
|
142
|
+
context "without queue time" do
|
143
|
+
it "does not add queue time to transaction" do
|
144
|
+
# TODO: Not available in transaction.to_h yet.
|
145
|
+
# https://github.com/appsignal/appsignal-agent/issues/293
|
146
|
+
expect(Appsignal).to receive(:monitor_single_transaction).with(
|
147
|
+
"perform_job.resque",
|
148
|
+
a_hash_including(:queue_start => nil)
|
149
|
+
).and_call_original
|
150
|
+
|
151
|
+
perform
|
152
|
+
expect(last_transaction.to_h).to include(
|
153
|
+
"namespace" => Appsignal::Transaction::BACKGROUND_JOB,
|
154
|
+
"action" => "TestActiveJob#perform",
|
155
|
+
"events" => [
|
156
|
+
hash_including("name" => "perform_job.resque")
|
157
|
+
]
|
158
|
+
)
|
159
|
+
end
|
160
|
+
end
|
161
|
+
|
162
|
+
if DependencyHelper.rails6_present?
|
163
|
+
context "with queue time" do
|
164
|
+
it "adds queue time to transction" do
|
165
|
+
queue_start = "2017-01-01 10:01:00UTC"
|
166
|
+
queue_start_time = Time.parse(queue_start)
|
167
|
+
# TODO: Not available in transaction.to_h yet.
|
168
|
+
# https://github.com/appsignal/appsignal-agent/issues/293
|
169
|
+
expect(Appsignal).to receive(:monitor_single_transaction).with(
|
170
|
+
"perform_job.resque",
|
171
|
+
a_hash_including(:queue_start => queue_start_time)
|
172
|
+
).and_call_original
|
173
|
+
job.enqueued_at = queue_start
|
174
|
+
|
175
|
+
perform
|
176
|
+
expect(last_transaction.to_h).to include(
|
177
|
+
"namespace" => Appsignal::Transaction::BACKGROUND_JOB,
|
178
|
+
"action" => "TestActiveJob#perform",
|
179
|
+
"events" => [
|
180
|
+
hash_including("name" => "perform_job.resque")
|
181
|
+
]
|
182
|
+
)
|
183
|
+
end
|
184
|
+
end
|
185
|
+
end
|
144
186
|
end
|
145
187
|
end
|
@@ -4,9 +4,12 @@ describe Appsignal::Rack::JSExceptionCatcher do
|
|
4
4
|
let(:config_options) { { :enable_frontend_error_catching => true } }
|
5
5
|
let(:config) { project_fixture_config("production", config_options) }
|
6
6
|
let(:deprecation_message) do
|
7
|
-
"The Appsignal::Rack::JSExceptionCatcher is
|
8
|
-
"
|
9
|
-
"
|
7
|
+
"The Appsignal::Rack::JSExceptionCatcher is " \
|
8
|
+
"deprecated and will be removed in a future version. Please use " \
|
9
|
+
"the official AppSignal JavaScript integration by disabling " \
|
10
|
+
"`enable_frontend_error_catching` in your configuration and " \
|
11
|
+
"installing AppSignal for JavaScript instead. " \
|
12
|
+
"(https://docs.appsignal.com/front-end/)"
|
10
13
|
end
|
11
14
|
before { Appsignal.config = config }
|
12
15
|
|
@@ -32,7 +35,9 @@ describe Appsignal::Rack::JSExceptionCatcher do
|
|
32
35
|
|
33
36
|
describe "#call" do
|
34
37
|
let(:catcher) do
|
35
|
-
silence
|
38
|
+
silence :allowed => ["enable_frontend_error_catching"] do
|
39
|
+
Appsignal::Rack::JSExceptionCatcher.new(app, options)
|
40
|
+
end
|
36
41
|
end
|
37
42
|
after { catcher.call(env) }
|
38
43
|
|
@@ -5,12 +5,13 @@ module ConfigHelpers
|
|
5
5
|
)
|
6
6
|
end
|
7
7
|
|
8
|
-
def project_fixture_config(env = "production", initial_config = {}, logger = Appsignal.logger)
|
8
|
+
def project_fixture_config(env = "production", initial_config = {}, logger = Appsignal.logger, config_file = nil)
|
9
9
|
Appsignal::Config.new(
|
10
10
|
project_fixture_path,
|
11
11
|
env,
|
12
12
|
initial_config,
|
13
|
-
logger
|
13
|
+
logger,
|
14
|
+
config_file
|
14
15
|
)
|
15
16
|
end
|
16
17
|
|
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: 2.10.
|
4
|
+
version: 2.10.12
|
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: 2020-
|
13
|
+
date: 2020-07-28 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rack
|
@@ -375,7 +375,7 @@ licenses:
|
|
375
375
|
- MIT
|
376
376
|
metadata:
|
377
377
|
bug_tracker_uri: https://github.com/appsignal/appsignal-ruby/issues
|
378
|
-
changelog_uri: https://github.com/appsignal/appsignal-ruby/blob/
|
378
|
+
changelog_uri: https://github.com/appsignal/appsignal-ruby/blob/main/CHANGELOG.md
|
379
379
|
documentation_uri: https://docs.appsignal.com/ruby/
|
380
380
|
homepage_uri: https://docs.appsignal.com/ruby/
|
381
381
|
source_code_uri: https://github.com/appsignal/appsignal-ruby
|