appsignal 3.0.11-java → 3.0.15-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: 53a4ad427c2ed45201cb3e4aa7c7e7481b85feead0dd6e85d0d471893b332610
4
- data.tar.gz: 6bad44fe3878cc7e2bbdaaf34bafb8a4fd6d0039f9f7ec86ba60ce5bc67eeb35
3
+ metadata.gz: 17405da02c2ea9322d8d6687841d717a4cd968349a60c9ff9d11c8d7734bdf84
4
+ data.tar.gz: a752315ee55123a5f1eb8ff018947462183b06229ae353316bc7d0f6d4b30999
5
5
  SHA512:
6
- metadata.gz: b57cad1ea08a5f2b8fcb37893440ec2269d743c1cd807ae41d488e2adaa9bfd7f71795e2bb72e911d6e250800eed061634d00c73871476c57251a3e2f3a998bc
7
- data.tar.gz: 1e4a3db1cc96d7856b684b63ebc401ebd50d003b263a9e43cda368036fdaf6e09479128f07f4df8d27950386b011800a5ece523ce068724e967e821688edec00
6
+ metadata.gz: 56b4c11e66949d2a4e6037f4520a523d104105c62f483a5e6b966ec358e44bd3a094747fd2548969304e50e8dffd2494d65da17c6897eda432c5ab4b7a127bb5
7
+ data.tar.gz: 6f0547e932253c53e0fb05d81ca0e8dae41d1e7789c849daf8a475c74df8b230ceba4a952869578902383be9d3620f66f14ee4b31e5449e2ec9340551dc9f53d
data/.rubocop.yml CHANGED
@@ -13,8 +13,7 @@ AllCops:
13
13
  - "gemfiles/vendor/**/*"
14
14
  - "vendor/**/*"
15
15
  - "benchmark.rake"
16
- - "lib/appsignal/integrations/object_ruby_modern.rb"
17
- - "spec/lib/appsignal/integrations/object_spec.rb"
16
+ - "spec/integration/diagnose/**/*"
18
17
  DisplayCopNames: true
19
18
  UseCache: true
20
19
  CacheRootDirectory: ./tmp
@@ -11,7 +11,7 @@ agent:
11
11
  os_image: ubuntu1804
12
12
  auto_cancel:
13
13
  running:
14
- when: branch != 'main' AND branch != 'develop' AND branch != 'diagnose-testing'
14
+ when: branch != 'main' AND branch != 'develop'
15
15
  global_job_config:
16
16
  env_vars:
17
17
  - name: RUNNING_IN_CI
@@ -95,12 +95,8 @@ blocks:
95
95
  task:
96
96
  jobs:
97
97
  - name: Git Lint (Lintje)
98
- env_vars:
99
- - name: LINTJE_VERSION
100
- value: 0.3.0
101
98
  commands:
102
- - script/install_lintje
103
- - "$HOME/bin/lintje $SEMAPHORE_GIT_COMMIT_RANGE"
99
+ - script/lint_git
104
100
  - name: Integration tests
105
101
  dependencies:
106
102
  - Validation
data/CHANGELOG.md CHANGED
@@ -1,5 +1,40 @@
1
1
  # AppSignal for Ruby gem Changelog
2
2
 
3
+ ## 3.0.15
4
+
5
+ - [b40b3b4f](https://github.com/appsignal/appsignal-ruby/commit/b40b3b4f5264c6b69f9515b53806435258c73086) patch - Print String values in the diagnose report surrounded by quotes. Makes it more clear that it's a String value and not a label we print.
6
+ - [fd6faf16](https://github.com/appsignal/appsignal-ruby/commit/fd6faf16d9feb73c3076c2e1283f6101dc4abf97) patch - Bump agent to 09308fb
7
+
8
+ - Update sql_lexer dependency with support for reversed operators in queries.
9
+ - Add debug level logging to custom metrics in transaction_debug_mode.
10
+ - Add hostname config option to standalone agent.
11
+
12
+ ## 3.0.14
13
+
14
+ - [c40f6d75](https://github.com/appsignal/appsignal-ruby/commit/c40f6d759e8d516cc47bd55cc83bfcb680fbd1ea) patch - Add minutely probe that collects metrics for :class_serial and :global_constant_state from RubyVM.
15
+ - [7c18fb6d](https://github.com/appsignal/appsignal-ruby/commit/7c18fb6db0c72f32adb6803ccde957963977008a) patch - Bump agent to 7376537
16
+
17
+ - Support JSON PostgreSQL operator in sql_lexer.
18
+ - Do not strip comments from SQL queries.
19
+ - [8d7b80ea](https://github.com/appsignal/appsignal-ruby/commit/8d7b80eafc203c295db037f2547f74a2f217f93f) patch - Add configuration option for the AppSignal agent StatsD server. This is on by default, but you can disable it with `enable_statsd: false`.
20
+
21
+ ## 3.0.13
22
+
23
+ - [5c202185](https://github.com/appsignal/appsignal-ruby/commit/5c20218526e026ab436854508ccfe26ca55e8f15) patch - Bump agent to v-0318770.
24
+
25
+ - Improve Dokku platform detection. Do not disable host metrics on
26
+ Dokku.
27
+ - Report CPU steal metric.
28
+
29
+ ## 3.0.12
30
+
31
+ - [7f3af841](https://github.com/appsignal/appsignal-ruby/commit/7f3af8418f830a7384c10b309e1aeb8ee32c5742) patch - Bump agent to 0f40689
32
+
33
+ - Add Apple Darwin ARM alias.
34
+ - Improve appsignal.h documentation.
35
+ - Improve transaction debug log for errors.
36
+ - Fix agent zombie/defunct issue on containers without process reaping.
37
+
3
38
  ## 3.0.11
4
39
 
5
40
  - [8e3ec789](https://github.com/appsignal/appsignal-ruby/commit/8e3ec78943acf7c533c3703c3961e19c49dcd5aa) patch - Bump agent to v-891c6b0. Add experimental Apple Silicon M1 ARM64 build.
data/build_matrix.yml CHANGED
@@ -11,7 +11,7 @@ semaphore: # Default `.semaphore/semaphore.yml` contents
11
11
  auto_cancel:
12
12
  running:
13
13
  # Ignore main AND develop branch as we want it to build all workflows
14
- when: "branch != 'main' AND branch != 'develop' AND branch != 'diagnose-testing'"
14
+ when: "branch != 'main' AND branch != 'develop'"
15
15
 
16
16
  global_job_config:
17
17
  env_vars:
@@ -93,12 +93,8 @@ semaphore: # Default `.semaphore/semaphore.yml` contents
93
93
  task:
94
94
  jobs:
95
95
  - name: Git Lint (Lintje)
96
- env_vars:
97
- - name: LINTJE_VERSION
98
- value: 0.3.0
99
96
  commands:
100
- - script/install_lintje
101
- - $HOME/bin/lintje $SEMAPHORE_GIT_COMMIT_RANGE
97
+ - script/lint_git
102
98
  - name: Integration tests
103
99
  dependencies:
104
100
  - Validation
data/ext/agent.yml CHANGED
@@ -1,83 +1,94 @@
1
+ # DO NOT EDIT
2
+ # This is a generated file by the `rake ship` family of tasks in the
3
+ # appsignal-agent repository.
4
+ # Modifications to this file will be overwritten with the next agent release.
1
5
  ---
2
- version: 891c6b0
6
+ version: '09308fb'
3
7
  mirrors:
4
8
  - https://appsignal-agent-releases.global.ssl.fastly.net
5
9
  - https://d135dj0rjqvssy.cloudfront.net
6
10
  triples:
7
11
  x86_64-darwin:
8
12
  static:
9
- checksum: 17203c5edae2463684f271216d32c9d5c57923c9730254b4a050392fea4e74a8
13
+ checksum: 72e3e84ce59f4b84287f0d72ec567447a28e42fb758eb27dd7676cd7613eb2e9
10
14
  filename: appsignal-x86_64-darwin-all-static.tar.gz
11
15
  dynamic:
12
- checksum: e9cbd39d6620792540453ced34cf348ca6560d292952d2b152da24fc22fc38d5
16
+ checksum: 6ad516e25fe140cc8f13ca2e14494d7d8a696ce1344faf71952f6c6f8b972fa5
13
17
  filename: appsignal-x86_64-darwin-all-dynamic.tar.gz
14
18
  universal-darwin:
15
19
  static:
16
- checksum: 17203c5edae2463684f271216d32c9d5c57923c9730254b4a050392fea4e74a8
20
+ checksum: 72e3e84ce59f4b84287f0d72ec567447a28e42fb758eb27dd7676cd7613eb2e9
17
21
  filename: appsignal-x86_64-darwin-all-static.tar.gz
18
22
  dynamic:
19
- checksum: e9cbd39d6620792540453ced34cf348ca6560d292952d2b152da24fc22fc38d5
23
+ checksum: 6ad516e25fe140cc8f13ca2e14494d7d8a696ce1344faf71952f6c6f8b972fa5
20
24
  filename: appsignal-x86_64-darwin-all-dynamic.tar.gz
21
25
  aarch64-darwin:
22
26
  static:
23
- checksum: 70db73144a1ee9475636512e6f55b0c7189ee6d2d390341d33fcaaece10b5a13
27
+ checksum: 446da8ea04b9a23de970332fb30fa7aa44b5aa3da371a8bacc240b3c8dfef3df
24
28
  filename: appsignal-aarch64-darwin-all-static.tar.gz
25
29
  dynamic:
26
- checksum: 13c646d2a98719f0ef9bb15f4e06b5b58bd8b938f1efb6e6cdfd999fe2872a38
30
+ checksum: 86d3bffeaa1329628c3dc540c6dcde735e58e2593c769a29f373e38c20657c70
27
31
  filename: appsignal-aarch64-darwin-all-dynamic.tar.gz
28
32
  arm64-darwin:
29
33
  static:
30
- checksum: 70db73144a1ee9475636512e6f55b0c7189ee6d2d390341d33fcaaece10b5a13
34
+ checksum: 446da8ea04b9a23de970332fb30fa7aa44b5aa3da371a8bacc240b3c8dfef3df
31
35
  filename: appsignal-aarch64-darwin-all-static.tar.gz
32
36
  dynamic:
33
- checksum: 13c646d2a98719f0ef9bb15f4e06b5b58bd8b938f1efb6e6cdfd999fe2872a38
37
+ checksum: 86d3bffeaa1329628c3dc540c6dcde735e58e2593c769a29f373e38c20657c70
38
+ filename: appsignal-aarch64-darwin-all-dynamic.tar.gz
39
+ arm-darwin:
40
+ static:
41
+ checksum: 446da8ea04b9a23de970332fb30fa7aa44b5aa3da371a8bacc240b3c8dfef3df
42
+ filename: appsignal-aarch64-darwin-all-static.tar.gz
43
+ dynamic:
44
+ checksum: 86d3bffeaa1329628c3dc540c6dcde735e58e2593c769a29f373e38c20657c70
34
45
  filename: appsignal-aarch64-darwin-all-dynamic.tar.gz
35
46
  aarch64-linux:
36
47
  static:
37
- checksum: 0ff967bd1d2d117cdc5a988adfd6083352f0ff3e3a18d8e85360b998ed08997e
48
+ checksum: d14ed2b2ba05b7a0a229eaba8ee710c35ff0c8681084ec5d0650fb53dae7b3d3
38
49
  filename: appsignal-aarch64-linux-all-static.tar.gz
39
50
  dynamic:
40
- checksum: 0b22089409e3c59e77edfcc8a9c4e87250fc2021aade730475db60c5d88b1362
51
+ checksum: 359e45e9d00d1795e6f1d1d2452350effd24a9baefc72cd3bca3631b09d4abc6
41
52
  filename: appsignal-aarch64-linux-all-dynamic.tar.gz
42
53
  i686-linux:
43
54
  static:
44
- checksum: 5653c81adebbf7533a714556efae82bd6ed538e3fa44e880aa5630b72d266668
55
+ checksum: 18cd5ef04e547dcc522faa0a462a00bac27e9bd221bd4dd8e6e2e934d4afd5b7
45
56
  filename: appsignal-i686-linux-all-static.tar.gz
46
57
  dynamic:
47
- checksum: b621f0a7d717ba3aa079df699d75eeca19500008d3906e7d1ff78d4ad01628b2
58
+ checksum: e5edeee4c66cb7e1ff372c3d9eddf5832741bc41b237bbddb2dd2e14c07e076d
48
59
  filename: appsignal-i686-linux-all-dynamic.tar.gz
49
60
  x86-linux:
50
61
  static:
51
- checksum: 5653c81adebbf7533a714556efae82bd6ed538e3fa44e880aa5630b72d266668
62
+ checksum: 18cd5ef04e547dcc522faa0a462a00bac27e9bd221bd4dd8e6e2e934d4afd5b7
52
63
  filename: appsignal-i686-linux-all-static.tar.gz
53
64
  dynamic:
54
- checksum: b621f0a7d717ba3aa079df699d75eeca19500008d3906e7d1ff78d4ad01628b2
65
+ checksum: e5edeee4c66cb7e1ff372c3d9eddf5832741bc41b237bbddb2dd2e14c07e076d
55
66
  filename: appsignal-i686-linux-all-dynamic.tar.gz
56
67
  x86_64-linux:
57
68
  static:
58
- checksum: b07919c0a18c8ed1b658dbf2717268d61ab88d1cc4665438e68d73a54334e1f8
69
+ checksum: 98aaa72590d45b8a6aec3d8222468d1875f8fc798f1d891b6424749102d0b0f0
59
70
  filename: appsignal-x86_64-linux-all-static.tar.gz
60
71
  dynamic:
61
- checksum: 409e5d3536f7f97cbe7eaca124fcadab9ac0e86f73299b1890e4833724a842e1
72
+ checksum: 0ac7ffcb92c56fbc392d82e8242c32d071b62790414ab7b2b4d1ba967acf4520
62
73
  filename: appsignal-x86_64-linux-all-dynamic.tar.gz
63
74
  x86_64-linux-musl:
64
75
  static:
65
- checksum: 23dc0715fed704ef65365cbc385aa8135c317d53844e3102e989dd8144b37039
76
+ checksum: 1e2685775d45299e6f6b7439f44586c87fcb6ae14e3eb4f2ed0034b5ffed4d42
66
77
  filename: appsignal-x86_64-linux-musl-all-static.tar.gz
67
78
  dynamic:
68
- checksum: e6bd1a149042d8ab8c316575beb37ef3c9b46f553aa04aa151a6966d7e048c77
79
+ checksum: be0619c4b49dd201f4e4d3e4445c4d627c1d1f1453a0e1de03cc9933a4f5a26b
69
80
  filename: appsignal-x86_64-linux-musl-all-dynamic.tar.gz
70
81
  x86_64-freebsd:
71
82
  static:
72
- checksum: c9758318ea45461f3cede1d232f730914eb115ea2c34199cf9031a45af8d2776
83
+ checksum: 7ffd025a7dccca6f6730df2146faeb541fb0a4659fb802e88587471cd625ca94
73
84
  filename: appsignal-x86_64-freebsd-all-static.tar.gz
74
85
  dynamic:
75
- checksum: 03ab564b9613a17d3b972f98eb359588b9e69120fc4191222e769aa266613029
86
+ checksum: bfa4ca6c793efd081ac6991fae30c470c7edf9a0808726907b607120ba0eb505
76
87
  filename: appsignal-x86_64-freebsd-all-dynamic.tar.gz
77
88
  amd64-freebsd:
78
89
  static:
79
- checksum: c9758318ea45461f3cede1d232f730914eb115ea2c34199cf9031a45af8d2776
90
+ checksum: 7ffd025a7dccca6f6730df2146faeb541fb0a4659fb802e88587471cd625ca94
80
91
  filename: appsignal-x86_64-freebsd-all-static.tar.gz
81
92
  dynamic:
82
- checksum: 03ab564b9613a17d3b972f98eb359588b9e69120fc4191222e769aa266613029
93
+ checksum: bfa4ca6c793efd081ac6991fae30c470c7edf9a0808726907b607120ba0eb505
83
94
  filename: appsignal-x86_64-freebsd-all-dynamic.tar.gz
@@ -143,7 +143,7 @@ module Appsignal
143
143
  def transmit_report_to_appsignal
144
144
  puts " Transmitting diagnostics report"
145
145
  transmitter = Transmitter.new(
146
- DIAGNOSE_ENDPOINT,
146
+ ENV.fetch("APPSIGNAL_DIAGNOSE_ENDPOINT", DIAGNOSE_ENDPOINT),
147
147
  Appsignal.config
148
148
  )
149
149
  response = transmitter.transmit(:diagnose => data)
@@ -171,11 +171,18 @@ module Appsignal
171
171
  puts_value label, value
172
172
  end
173
173
 
174
+ # Prints values as given. Does no formatting on the value
174
175
  def puts_value(label, value, options = {})
175
176
  options[:level] ||= 1
176
177
  puts "#{" " * options[:level]}#{label}: #{value}"
177
178
  end
178
179
 
180
+ # Print values as inspected.
181
+ # Surrounds Strings in quotes.
182
+ def puts_format(label, value, options = {})
183
+ puts_value label, value.inspect, options
184
+ end
185
+
179
186
  def configure_appsignal(options)
180
187
  current_path = Dir.pwd
181
188
  initial_config = {}
@@ -327,9 +334,18 @@ module Appsignal
327
334
  data_section :library do
328
335
  save :language, "ruby"
329
336
  puts_value "Language", "Ruby"
330
- puts_and_save :package_version, "Gem version", Appsignal::VERSION
331
- puts_and_save :agent_version, "Agent version", Appsignal::Extension.agent_version
332
- puts_and_save :extension_loaded, "Extension loaded", Appsignal.extension_loaded
337
+
338
+ package_version = Appsignal::VERSION
339
+ save :package_version, package_version
340
+ puts_format "Gem version", package_version
341
+
342
+ agent_version = Appsignal::Extension.agent_version
343
+ save :agent_version, agent_version
344
+ puts_format "Agent version", agent_version
345
+
346
+ extension_loaded = Appsignal.extension_loaded
347
+ save :extension_loaded, extension_loaded
348
+ puts_format "Extension loaded", extension_loaded
333
349
  end
334
350
  end
335
351
 
@@ -381,29 +397,29 @@ module Appsignal
381
397
  def print_installation_language_report(report)
382
398
  report = report.fetch("language", {})
383
399
  puts " Language details"
384
- puts " Implementation: #{report["implementation"]}"
385
- puts " Ruby version: #{report["version"]}"
400
+ puts_format "Implementation", report["implementation"], :level => 2
401
+ puts_format "Ruby version", report["version"], :level => 2
386
402
  end
387
403
 
388
404
  def print_installation_download_report(report)
389
405
  report = report.fetch("download", {})
390
406
  puts " Download details"
391
- puts " Download URL: #{report["download_url"]}"
392
- puts " Checksum: #{report["checksum"]}"
407
+ puts_format "Download URL", report["download_url"], :level => 2
408
+ puts_format "Checksum", report["checksum"], :level => 2
393
409
  end
394
410
 
395
411
  def print_installation_build_report(report)
396
412
  report = report.fetch("build", {})
397
413
  puts " Build details"
398
- puts " Install time: #{report["time"]}"
399
- puts " Architecture: #{report["architecture"]}"
400
- puts " Target: #{report["target"]}"
401
- puts " Musl override: #{report["musl_override"]}"
402
- puts " Linux ARM override: #{report["linux_arm_override"]}"
403
- puts " Library type: #{report["library_type"]}"
404
- puts " Source: #{report["source"]}" if report["source"] != "remote"
405
- puts " Dependencies: #{report["dependencies"]}"
406
- puts " Flags: #{report["flags"]}"
414
+ puts_format "Install time", report["time"].to_s, :level => 2
415
+ puts_format "Architecture", report["architecture"], :level => 2
416
+ puts_format "Target", report["target"], :level => 2
417
+ puts_format "Musl override", report["musl_override"], :level => 2
418
+ puts_format "Linux ARM override", report["linux_arm_override"], :level => 2
419
+ puts_format "Library type", report["library_type"], :level => 2
420
+ puts_format "Source", report["source"], :level => 2 if report["source"] != "remote"
421
+ puts_format "Dependencies", report["dependencies"], :level => 2
422
+ puts_format "Flags", report["flags"], :level => 2
407
423
  end
408
424
 
409
425
  def print_installation_host_report(report)
@@ -417,24 +433,31 @@ module Appsignal
417
433
  rbconfig = RbConfig::CONFIG
418
434
  puts "Host information"
419
435
  data_section :host do
420
- puts_and_save :architecture, "Architecture", Appsignal::System.agent_architecture
436
+ agent_architecture = Appsignal::System.agent_architecture
437
+ save :architecture, agent_architecture
438
+ puts_format "Architecture", agent_architecture
421
439
 
422
- os_label = os = rbconfig["host_os"]
423
- os_label = "#{os} (Microsoft Windows is not supported.)" if Gem.win_platform?
440
+ os = rbconfig["host_os"]
441
+ os_label = os.inspect
442
+ os_label = "#{os_label} (Microsoft Windows is not supported.)" if Gem.win_platform?
424
443
  save :os, os
425
444
  puts_value "Operating System", os_label
426
445
 
427
- puts_and_save :language_version, "Ruby version",
428
- "#{rbconfig["ruby_version"]}-p#{rbconfig["PATCHLEVEL"]}"
446
+ language_version = "#{rbconfig["ruby_version"]}-p#{rbconfig["PATCHLEVEL"]}"
447
+ save :language_version, language_version
448
+ puts_format "Ruby version", language_version
429
449
 
430
- puts_value "Heroku", "true" if Appsignal::System.heroku?
431
- save :heroku, Appsignal::System.heroku?
450
+ heroku = Appsignal::System.heroku?
451
+ save :heroku, heroku
452
+ puts_format "Heroku", true if Appsignal::System.heroku?
432
453
 
433
- save :root, Process.uid.zero?
434
- puts_value "Root user",
435
- Process.uid.zero? ? "true (not recommended)" : "false"
436
- puts_and_save :running_in_container, "Running in container",
437
- Appsignal::Extension.running_in_container?
454
+ root = Process.uid.zero?
455
+ save :root, root
456
+ puts_value "Root user", root ? "true (not recommended)" : "false"
457
+
458
+ running_in_container = Appsignal::Extension.running_in_container?
459
+ save :running_in_container, running_in_container
460
+ puts_format "Running in container", running_in_container
438
461
  end
439
462
  end
440
463
 
@@ -563,6 +586,7 @@ module Appsignal
563
586
 
564
587
  unless path[:exists]
565
588
  puts_value "Exists?", path[:exists], :level => 2
589
+ print_empty_line
566
590
  return
567
591
  end
568
592
 
@@ -36,6 +36,7 @@ module Appsignal
36
36
  :enable_gc_instrumentation => false,
37
37
  :enable_host_metrics => true,
38
38
  :enable_minutely_probes => true,
39
+ :enable_statsd => true,
39
40
  :ca_file_path => File.expand_path(File.join("../../../resources/cacert.pem"), __FILE__),
40
41
  :dns_servers => [],
41
42
  :files_world_accessible => true,
@@ -69,6 +70,7 @@ module Appsignal
69
70
  "APPSIGNAL_WORKING_DIRECTORY_PATH" => :working_directory_path,
70
71
  "APPSIGNAL_ENABLE_HOST_METRICS" => :enable_host_metrics,
71
72
  "APPSIGNAL_ENABLE_MINUTELY_PROBES" => :enable_minutely_probes,
73
+ "APPSIGNAL_ENABLE_STATSD" => :enable_statsd,
72
74
  "APPSIGNAL_HOSTNAME" => :hostname,
73
75
  "APPSIGNAL_CA_FILE_PATH" => :ca_file_path,
74
76
  "APPSIGNAL_DNS_SERVERS" => :dns_servers,
@@ -99,6 +101,7 @@ module Appsignal
99
101
  APPSIGNAL_ENABLE_GC_INSTRUMENTATION
100
102
  APPSIGNAL_ENABLE_HOST_METRICS
101
103
  APPSIGNAL_ENABLE_MINUTELY_PROBES
104
+ APPSIGNAL_ENABLE_STATSD
102
105
  APPSIGNAL_FILES_WORLD_ACCESSIBLE
103
106
  APPSIGNAL_INSTRUMENT_NET_HTTP
104
107
  APPSIGNAL_INSTRUMENT_REDIS
@@ -290,7 +293,7 @@ module Appsignal
290
293
  ENV["_APPSIGNAL_FILES_WORLD_ACCESSIBLE"] = config_hash[:files_world_accessible].to_s
291
294
  ENV["_APPSIGNAL_TRANSACTION_DEBUG_MODE"] = config_hash[:transaction_debug_mode].to_s
292
295
  ENV["_APPSIGNAL_SEND_ENVIRONMENT_METADATA"] = config_hash[:send_environment_metadata].to_s
293
- ENV["_APPSIGNAL_ENABLE_STATSD"] = "true"
296
+ ENV["_APPSIGNAL_ENABLE_STATSD"] = config_hash[:enable_statsd].to_s
294
297
  ENV["_APP_REVISION"] = config_hash[:revision].to_s
295
298
  end
296
299
 
@@ -0,0 +1,16 @@
1
+ module Appsignal
2
+ class Hooks
3
+ # @api private
4
+ class MriHook < Appsignal::Hooks::Hook
5
+ register :mri
6
+
7
+ def dependencies_present?
8
+ defined?(::RubyVM)
9
+ end
10
+
11
+ def install
12
+ Appsignal::Minutely.probes.register :mri, Appsignal::Probes::MriProbe
13
+ end
14
+ end
15
+ end
16
+ end
@@ -94,6 +94,7 @@ require "appsignal/hooks/active_job"
94
94
  require "appsignal/hooks/active_support_notifications"
95
95
  require "appsignal/hooks/celluloid"
96
96
  require "appsignal/hooks/delayed_job"
97
+ require "appsignal/hooks/mri"
97
98
  require "appsignal/hooks/net_http"
98
99
  require "appsignal/hooks/passenger"
99
100
  require "appsignal/hooks/puma"
@@ -0,0 +1,26 @@
1
+ module Appsignal
2
+ module Probes
3
+ class MriProbe
4
+ # @api private
5
+ def self.dependencies_present?
6
+ defined?(::RubyVM) && ::RubyVM.respond_to?(:stat)
7
+ end
8
+
9
+ def initialize
10
+ Appsignal.logger.debug("Initializing VM probe")
11
+ end
12
+
13
+ # @api private
14
+ def call
15
+ stat = RubyVM.stat
16
+ [:class_serial, :global_constant_state].each do |metric|
17
+ Appsignal.add_distribution_value(
18
+ "ruby_vm",
19
+ stat[metric],
20
+ :metric => metric
21
+ )
22
+ end
23
+ end
24
+ end
25
+ end
26
+ end
@@ -3,4 +3,5 @@ module Appsignal
3
3
  end
4
4
  end
5
5
 
6
+ require "appsignal/probes/mri"
6
7
  require "appsignal/probes/sidekiq"
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Appsignal
4
- VERSION = "3.0.11".freeze
4
+ VERSION = "3.0.15".freeze
5
5
  end
@@ -2,6 +2,8 @@
2
2
 
3
3
  set -eu
4
4
 
5
+ LINTJE_VERSION="0.5.0"
6
+
5
7
  mkdir -p $HOME/bin
6
8
  cache_key=v1-lintje-$LINTJE_VERSION
7
9
  cache restore $cache_key
@@ -16,3 +18,5 @@ else
16
18
  tar -xz --directory $HOME/bin
17
19
  cache store $cache_key $HOME/bin/lintje
18
20
  fi
21
+
22
+ $HOME/bin/lintje $SEMAPHORE_GIT_COMMIT_RANGE
@@ -115,7 +115,6 @@ describe Appsignal::CLI::Diagnose, :api_stub => true, :send_report => :yes_cli_i
115
115
  it "logs to the log file" do
116
116
  run
117
117
  log_contents = File.read(config.log_file_path)
118
- p log_contents
119
118
  expect(log_contents).to contains_log :info, "Starting AppSignal diagnose"
120
119
  end
121
120
 
@@ -192,8 +191,8 @@ describe Appsignal::CLI::Diagnose, :api_stub => true, :send_report => :yes_cli_i
192
191
 
193
192
  it "outputs version numbers" do
194
193
  expect(output).to include \
195
- "Gem version: #{Appsignal::VERSION}",
196
- "Agent version: #{Appsignal::Extension.agent_version}"
194
+ "Gem version: \"#{Appsignal::VERSION}\"",
195
+ "Agent version: \"#{Appsignal::Extension.agent_version}\""
197
196
  end
198
197
 
199
198
  it "transmits version numbers in report" do
@@ -295,18 +294,18 @@ describe Appsignal::CLI::Diagnose, :api_stub => true, :send_report => :yes_cli_i
295
294
  "Installation result",
296
295
  " Status: success",
297
296
  "Language details",
298
- " Implementation: #{jruby ? "jruby" : "ruby"}",
299
- " Ruby version: #{"#{rbconfig["ruby_version"]}-p#{rbconfig["PATCHLEVEL"]}"}",
297
+ " Implementation: \"#{jruby ? "jruby" : "ruby"}\"",
298
+ " Ruby version: \"#{"#{rbconfig["ruby_version"]}-p#{rbconfig["PATCHLEVEL"]}"}\"",
300
299
  "Download details",
301
- " Download URL: https://",
302
- " Checksum: verified",
300
+ " Download URL: \"https://",
301
+ " Checksum: \"verified\"",
303
302
  "Build details",
304
- " Install time: 20",
305
- " Architecture: #{Appsignal::System.agent_architecture}",
306
- " Target: #{Appsignal::System.agent_platform}",
303
+ " Install time: \"20",
304
+ " Architecture: \"#{Appsignal::System.agent_architecture}\"",
305
+ " Target: \"#{Appsignal::System.agent_platform}\"",
307
306
  " Musl override: false",
308
307
  " Linux ARM override: false",
309
- " Library type: #{jruby ? "dynamic" : "static"}",
308
+ " Library type: \"#{jruby ? "dynamic" : "static"}\"",
310
309
  " Dependencies: {",
311
310
  " Flags: {",
312
311
  "Host details",
@@ -611,9 +610,9 @@ describe Appsignal::CLI::Diagnose, :api_stub => true, :send_report => :yes_cli_i
611
610
  run
612
611
  expect(output).to include \
613
612
  "Host information",
614
- "Architecture: #{rbconfig["host_cpu"]}",
615
- "Operating System: #{rbconfig["host_os"]}",
616
- "Ruby version: #{language_version}"
613
+ "Architecture: \"#{rbconfig["host_cpu"]}\"",
614
+ "Operating System: \"#{rbconfig["host_os"]}\"",
615
+ "Ruby version: \"#{language_version}\""
617
616
  end
618
617
 
619
618
  context "when on Microsoft Windows" do
@@ -172,6 +172,7 @@ describe Appsignal::Config do
172
172
  :enable_gc_instrumentation => false,
173
173
  :enable_host_metrics => true,
174
174
  :enable_minutely_probes => true,
175
+ :enable_statsd => true,
175
176
  :ca_file_path => File.join(resources_dir, "cacert.pem"),
176
177
  :dns_servers => [],
177
178
  :files_world_accessible => true,
@@ -0,0 +1,23 @@
1
+ describe Appsignal::Hooks::MriHook do
2
+ describe "#dependencies_present?" do
3
+ subject { described_class.new.dependencies_present? }
4
+
5
+ if DependencyHelper.running_jruby?
6
+ it { is_expected.to be_falsy }
7
+ else
8
+ it { is_expected.to be_truthy }
9
+ end
10
+ end
11
+
12
+ unless DependencyHelper.running_jruby?
13
+ context "install" do
14
+ before do
15
+ Appsignal::Hooks.load_hooks
16
+ end
17
+
18
+ it "should be added to minutely probes" do
19
+ expect(Appsignal::Minutely.probes[:mri]).to be Appsignal::Probes::MriProbe
20
+ end
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,33 @@
1
+ describe Appsignal::Probes::MriProbe do
2
+ let(:probe) { described_class.new }
3
+
4
+ describe ".dependencies_present?" do
5
+ if DependencyHelper.running_jruby? || DependencyHelper.running_ruby_2_0?
6
+ it "should not be present" do
7
+ expect(described_class.dependencies_present?).to be_falsy
8
+ end
9
+ else
10
+ it "should be present" do
11
+ expect(described_class.dependencies_present?).to be_truthy
12
+ end
13
+ end
14
+ end
15
+
16
+ unless DependencyHelper.running_jruby? || DependencyHelper.running_ruby_2_0?
17
+ describe "#call" do
18
+ it "should track vm metrics" do
19
+ expect_distribution_value(:class_serial)
20
+ expect_distribution_value(:global_constant_state)
21
+
22
+ probe.call
23
+ end
24
+ end
25
+
26
+ def expect_distribution_value(metric)
27
+ expect(Appsignal).to receive(:add_distribution_value)
28
+ .with("ruby_vm", kind_of(Numeric), :metric => metric)
29
+ .and_call_original
30
+ .once
31
+ end
32
+ end
33
+ end
@@ -5,6 +5,10 @@ module DependencyHelper
5
5
  Gem::Version.new(RUBY_VERSION)
6
6
  end
7
7
 
8
+ def running_ruby_2_0?
9
+ ruby_version.segments.take(2) == [2, 0]
10
+ end
11
+
8
12
  def running_jruby?
9
13
  defined?(RUBY_ENGINE) && RUBY_ENGINE == "jruby"
10
14
  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.0.11
4
+ version: 3.0.15
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: 2021-07-26 00:00:00.000000000 Z
13
+ date: 2021-11-03 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rack
@@ -227,6 +227,7 @@ files:
227
227
  - lib/appsignal/hooks/delayed_job.rb
228
228
  - lib/appsignal/hooks/excon.rb
229
229
  - lib/appsignal/hooks/mongo_ruby_driver.rb
230
+ - lib/appsignal/hooks/mri.rb
230
231
  - lib/appsignal/hooks/net_http.rb
231
232
  - lib/appsignal/hooks/passenger.rb
232
233
  - lib/appsignal/hooks/puma.rb
@@ -264,6 +265,7 @@ files:
264
265
  - lib/appsignal/marker.rb
265
266
  - lib/appsignal/minutely.rb
266
267
  - lib/appsignal/probes.rb
268
+ - lib/appsignal/probes/mri.rb
267
269
  - lib/appsignal/probes/sidekiq.rb
268
270
  - lib/appsignal/rack/generic_instrumentation.rb
269
271
  - lib/appsignal/rack/rails_instrumentation.rb
@@ -285,7 +287,7 @@ files:
285
287
  - mono.yml
286
288
  - resources/appsignal.yml.erb
287
289
  - resources/cacert.pem
288
- - script/install_lintje
290
+ - script/lint_git
289
291
  - spec/.rubocop.yml
290
292
  - spec/lib/appsignal/auth_check_spec.rb
291
293
  - spec/lib/appsignal/capistrano2_spec.rb
@@ -324,6 +326,7 @@ files:
324
326
  - spec/lib/appsignal/hooks/delayed_job_spec.rb
325
327
  - spec/lib/appsignal/hooks/excon_spec.rb
326
328
  - spec/lib/appsignal/hooks/mongo_ruby_driver_spec.rb
329
+ - spec/lib/appsignal/hooks/mri_spec.rb
327
330
  - spec/lib/appsignal/hooks/net_http_spec.rb
328
331
  - spec/lib/appsignal/hooks/passenger_spec.rb
329
332
  - spec/lib/appsignal/hooks/puma_spec.rb
@@ -350,6 +353,7 @@ files:
350
353
  - spec/lib/appsignal/logger_spec.rb
351
354
  - spec/lib/appsignal/marker_spec.rb
352
355
  - spec/lib/appsignal/minutely_spec.rb
356
+ - spec/lib/appsignal/probes/mri_spec.rb
353
357
  - spec/lib/appsignal/probes/sidekiq_spec.rb
354
358
  - spec/lib/appsignal/rack/generic_instrumentation_spec.rb
355
359
  - spec/lib/appsignal/rack/rails_instrumentation_spec.rb
@@ -429,7 +433,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
429
433
  - !ruby/object:Gem::Version
430
434
  version: '0'
431
435
  requirements: []
432
- rubygems_version: 3.2.17
436
+ rubygems_version: 3.2.30
433
437
  signing_key:
434
438
  specification_version: 4
435
439
  summary: Logs performance and exception data from your app to appsignal.com
@@ -472,6 +476,7 @@ test_files:
472
476
  - spec/lib/appsignal/hooks/delayed_job_spec.rb
473
477
  - spec/lib/appsignal/hooks/excon_spec.rb
474
478
  - spec/lib/appsignal/hooks/mongo_ruby_driver_spec.rb
479
+ - spec/lib/appsignal/hooks/mri_spec.rb
475
480
  - spec/lib/appsignal/hooks/net_http_spec.rb
476
481
  - spec/lib/appsignal/hooks/passenger_spec.rb
477
482
  - spec/lib/appsignal/hooks/puma_spec.rb
@@ -498,6 +503,7 @@ test_files:
498
503
  - spec/lib/appsignal/logger_spec.rb
499
504
  - spec/lib/appsignal/marker_spec.rb
500
505
  - spec/lib/appsignal/minutely_spec.rb
506
+ - spec/lib/appsignal/probes/mri_spec.rb
501
507
  - spec/lib/appsignal/probes/sidekiq_spec.rb
502
508
  - spec/lib/appsignal/rack/generic_instrumentation_spec.rb
503
509
  - spec/lib/appsignal/rack/rails_instrumentation_spec.rb