appsignal 3.4.0 → 3.4.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (142) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +63 -21
  3. data/.rubocop_todo.yml +68 -54
  4. data/.semaphore/semaphore.yml +11 -11
  5. data/CHANGELOG.md +37 -0
  6. data/Rakefile +15 -99
  7. data/appsignal.gemspec +3 -4
  8. data/bin/appsignal +4 -2
  9. data/build_matrix.yml +4 -4
  10. data/ext/._appsignal-agent +0 -0
  11. data/ext/Rakefile +22 -21
  12. data/ext/agent.rb +2 -0
  13. data/ext/base.rb +14 -17
  14. data/ext/extconf.rb +4 -1
  15. data/lib/appsignal/auth_check.rb +3 -3
  16. data/lib/appsignal/capistrano.rb +1 -1
  17. data/lib/appsignal/cli/demo.rb +5 -2
  18. data/lib/appsignal/cli/diagnose/paths.rb +4 -1
  19. data/lib/appsignal/cli/diagnose/utils.rb +7 -3
  20. data/lib/appsignal/cli/diagnose.rb +7 -5
  21. data/lib/appsignal/cli/helpers.rb +1 -4
  22. data/lib/appsignal/cli/install.rb +4 -10
  23. data/lib/appsignal/cli.rb +3 -2
  24. data/lib/appsignal/config.rb +105 -102
  25. data/lib/appsignal/demo.rb +2 -1
  26. data/lib/appsignal/environment.rb +2 -0
  27. data/lib/appsignal/event_formatter/action_view/render_formatter.rb +2 -1
  28. data/lib/appsignal/event_formatter/mongo_ruby_driver/query_formatter.rb +13 -13
  29. data/lib/appsignal/event_formatter.rb +5 -4
  30. data/lib/appsignal/extension/jruby.rb +11 -9
  31. data/lib/appsignal/extension.rb +1 -1
  32. data/lib/appsignal/helpers/instrumentation.rb +50 -35
  33. data/lib/appsignal/hooks/action_cable.rb +6 -4
  34. data/lib/appsignal/hooks/action_mailer.rb +2 -0
  35. data/lib/appsignal/hooks/active_job.rb +11 -10
  36. data/lib/appsignal/hooks/active_support_notifications.rb +3 -4
  37. data/lib/appsignal/hooks/data_mapper.rb +1 -1
  38. data/lib/appsignal/hooks/gvl.rb +3 -0
  39. data/lib/appsignal/hooks/http.rb +1 -1
  40. data/lib/appsignal/hooks/mri.rb +2 -0
  41. data/lib/appsignal/hooks/net_http.rb +1 -1
  42. data/lib/appsignal/hooks/que.rb +1 -1
  43. data/lib/appsignal/hooks/rake.rb +1 -1
  44. data/lib/appsignal/hooks/redis.rb +1 -1
  45. data/lib/appsignal/hooks/resque.rb +1 -1
  46. data/lib/appsignal/hooks/shoryuken.rb +2 -4
  47. data/lib/appsignal/hooks/sidekiq.rb +1 -1
  48. data/lib/appsignal/hooks/unicorn.rb +2 -2
  49. data/lib/appsignal/hooks/webmachine.rb +1 -1
  50. data/lib/appsignal/hooks.rb +2 -2
  51. data/lib/appsignal/integrations/active_support_notifications.rb +1 -1
  52. data/lib/appsignal/integrations/capistrano/appsignal.cap +6 -3
  53. data/lib/appsignal/integrations/capistrano/capistrano_2_tasks.rb +5 -4
  54. data/lib/appsignal/integrations/delayed_job_plugin.rb +3 -5
  55. data/lib/appsignal/integrations/grape.rb +1 -1
  56. data/lib/appsignal/integrations/hanami.rb +1 -1
  57. data/lib/appsignal/integrations/object.rb +2 -3
  58. data/lib/appsignal/integrations/padrino.rb +2 -4
  59. data/lib/appsignal/integrations/que.rb +6 -6
  60. data/lib/appsignal/integrations/railtie.rb +72 -0
  61. data/lib/appsignal/integrations/sidekiq.rb +9 -11
  62. data/lib/appsignal/integrations/sinatra.rb +1 -3
  63. data/lib/appsignal/integrations/webmachine.rb +4 -6
  64. data/lib/appsignal/logger.rb +31 -6
  65. data/lib/appsignal/marker.rb +4 -5
  66. data/lib/appsignal/minutely.rb +7 -7
  67. data/lib/appsignal/probes/gvl.rb +9 -4
  68. data/lib/appsignal/probes/helpers.rb +4 -6
  69. data/lib/appsignal/probes/mri.rb +7 -5
  70. data/lib/appsignal/probes/sidekiq.rb +3 -0
  71. data/lib/appsignal/probes.rb +2 -0
  72. data/lib/appsignal/rack/generic_instrumentation.rb +1 -5
  73. data/lib/appsignal/rack/sinatra_instrumentation.rb +3 -5
  74. data/lib/appsignal/rack/streaming_listener.rb +11 -13
  75. data/lib/appsignal/span.rb +5 -5
  76. data/lib/appsignal/system.rb +10 -11
  77. data/lib/appsignal/transaction.rb +49 -25
  78. data/lib/appsignal/transmitter.rb +4 -2
  79. data/lib/appsignal/utils/deprecation_message.rb +2 -0
  80. data/lib/appsignal/utils/hash_sanitizer.rb +1 -1
  81. data/lib/appsignal/utils/integration_logger.rb +5 -3
  82. data/lib/appsignal/utils/json.rb +1 -1
  83. data/lib/appsignal/utils/query_params_sanitizer.rb +1 -1
  84. data/lib/appsignal/version.rb +1 -1
  85. data/lib/appsignal.rb +5 -4
  86. data/lib/puma/plugin/appsignal.rb +16 -18
  87. data/script/lint_git +1 -1
  88. data/spec/lib/appsignal/capistrano2_spec.rb +6 -3
  89. data/spec/lib/appsignal/capistrano3_spec.rb +6 -3
  90. data/spec/lib/appsignal/cli/diagnose/utils_spec.rb +1 -3
  91. data/spec/lib/appsignal/cli/diagnose_spec.rb +33 -30
  92. data/spec/lib/appsignal/cli/install_spec.rb +5 -6
  93. data/spec/lib/appsignal/cli_spec.rb +1 -1
  94. data/spec/lib/appsignal/config_spec.rb +43 -37
  95. data/spec/lib/appsignal/event_formatter/action_view/render_formatter_spec.rb +11 -5
  96. data/spec/lib/appsignal/event_formatter/elastic_search/search_formatter_spec.rb +4 -4
  97. data/spec/lib/appsignal/event_formatter/mongo_ruby_driver/query_formatter_spec.rb +1 -4
  98. data/spec/lib/appsignal/event_formatter_spec.rb +11 -9
  99. data/spec/lib/appsignal/hooks/action_cable_spec.rb +5 -2
  100. data/spec/lib/appsignal/hooks/action_mailer_spec.rb +2 -1
  101. data/spec/lib/appsignal/hooks/active_support_notifications/instrument_shared_examples.rb +1 -1
  102. data/spec/lib/appsignal/hooks/active_support_notifications/start_finish_shared_examples.rb +1 -1
  103. data/spec/lib/appsignal/hooks/activejob_spec.rb +21 -12
  104. data/spec/lib/appsignal/hooks/data_mapper_spec.rb +1 -0
  105. data/spec/lib/appsignal/hooks/delayed_job_spec.rb +12 -12
  106. data/spec/lib/appsignal/hooks/excon_spec.rb +2 -2
  107. data/spec/lib/appsignal/hooks/mongo_ruby_driver_spec.rb +3 -1
  108. data/spec/lib/appsignal/hooks/shoryuken_spec.rb +4 -2
  109. data/spec/lib/appsignal/hooks/sidekiq_spec.rb +2 -1
  110. data/spec/lib/appsignal/hooks_spec.rb +5 -4
  111. data/spec/lib/appsignal/integrations/grape_spec.rb +8 -4
  112. data/spec/lib/appsignal/integrations/hanami_spec.rb +16 -8
  113. data/spec/lib/appsignal/integrations/mongo_ruby_driver_spec.rb +2 -4
  114. data/spec/lib/appsignal/integrations/object_spec.rb +6 -1
  115. data/spec/lib/appsignal/integrations/padrino_spec.rb +4 -2
  116. data/spec/lib/appsignal/integrations/railtie_spec.rb +213 -6
  117. data/spec/lib/appsignal/integrations/sidekiq_spec.rb +54 -41
  118. data/spec/lib/appsignal/logger_spec.rb +20 -4
  119. data/spec/lib/appsignal/marker_spec.rb +2 -2
  120. data/spec/lib/appsignal/minutely_spec.rb +3 -3
  121. data/spec/lib/appsignal/probes/gvl_spec.rb +60 -12
  122. data/spec/lib/appsignal/probes/mri_spec.rb +7 -4
  123. data/spec/lib/appsignal/rack/generic_instrumentation_spec.rb +2 -1
  124. data/spec/lib/appsignal/rack/rails_instrumentation_spec.rb +2 -1
  125. data/spec/lib/appsignal/rack/sinatra_instrumentation_spec.rb +10 -5
  126. data/spec/lib/appsignal/rack/streaming_listener_spec.rb +7 -5
  127. data/spec/lib/appsignal/transaction_spec.rb +20 -13
  128. data/spec/lib/appsignal/utils/data_spec.rb +10 -1
  129. data/spec/lib/appsignal/utils/hash_sanitizer_spec.rb +11 -11
  130. data/spec/lib/appsignal/utils/json_spec.rb +4 -2
  131. data/spec/lib/appsignal_spec.rb +49 -35
  132. data/spec/lib/puma/appsignal_spec.rb +9 -11
  133. data/spec/spec_helper.rb +14 -2
  134. data/spec/support/fixtures/projects/valid/config/appsignal.yml +1 -1
  135. data/spec/support/helpers/config_helpers.rb +2 -1
  136. data/spec/support/helpers/dependency_helper.rb +1 -9
  137. data/spec/support/helpers/std_streams_helper.rb +1 -3
  138. data/spec/support/helpers/wait_for_helper.rb +2 -3
  139. data/spec/support/mocks/appsignal_mock.rb +1 -1
  140. data/spec/support/mocks/fake_gvl_tools.rb +2 -10
  141. data/spec/support/testing.rb +4 -3
  142. metadata +9 -135
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: db997a51b6946a8de93bab5d0e95a1d2fe5169fac887907aab53596625641330
4
- data.tar.gz: 43d1fd0732b267b8bd8d4879a1231fc49e91b54ec2ecb7834f76a07dc0b6db6c
3
+ metadata.gz: 665e5db5581d8ac6e76d6ac3e77114609dcb8c9e2c5e9dce8d8746699ab74972
4
+ data.tar.gz: b397af1635bc09126afb56adfca4ade75673022b4936cc3eb04b991091c9d842
5
5
  SHA512:
6
- metadata.gz: c23f1677fbcea1433c2332e9d9eecab5958f79a2dba750f3732e068f36c381eb4e3b91e5f3f7f24517d8847914eca5693dd5e868e4be50c9b68558865ea7c319
7
- data.tar.gz: 1a457a512d4b702c5659118904313178c5d1ef961bc8efa42e1a66d6ae7f9a54b819883336a288d657f57db724dcd38b1bf408207515bef22bfe0d4503d23a9c
6
+ metadata.gz: 0c092aee34ade269d6387ba522db9bf995298e70310e2080b718a154810d8378a4251d18e2d8e4659c266fa4b1da83f93c55127b6553f9b7db4a05ba0e9f1f3a
7
+ data.tar.gz: baf78dd3e737d4c8c1e546bb5c7d4b93ab9cf729d0c20b7a0865a7b83db012addaf400720e898d645e32ac12cd7536f0551d8a6f06c3b350b936598fc720e885
data/.rubocop.yml CHANGED
@@ -1,8 +1,10 @@
1
1
  inherit_from: .rubocop_todo.yml
2
2
 
3
3
  AllCops:
4
- TargetRubyVersion: 2.0
4
+ TargetRubyVersion: 3.0
5
+ NewCops: enable
5
6
  Include:
7
+ - "**/*.rb"
6
8
  - "**/*.cap"
7
9
  - "**/Gemfile"
8
10
  - "**/Rakefile"
@@ -10,7 +12,6 @@ AllCops:
10
12
  Exclude:
11
13
  - "pkg/**/*"
12
14
  - "tmp/**/*"
13
- - "gemfiles/vendor/**/*"
14
15
  - "vendor/**/*"
15
16
  - "benchmark.rake"
16
17
  - "spec/integration/diagnose/**/*"
@@ -18,7 +19,7 @@ AllCops:
18
19
  UseCache: true
19
20
  CacheRootDirectory: ./tmp
20
21
 
21
- Lint/RescueWithoutErrorClass:
22
+ Style/RescueStandardError:
22
23
  Enabled: false
23
24
 
24
25
  Style/Documentation:
@@ -30,28 +31,13 @@ Style/StringLiterals:
30
31
  Style/StringLiteralsInInterpolation:
31
32
  EnforcedStyle: double_quotes
32
33
 
33
- Layout/AlignParameters:
34
- EnforcedStyle: with_fixed_indentation
35
-
36
- Layout/MultilineMethodCallIndentation:
37
- EnforcedStyle: indented
38
-
39
- Layout/MultilineOperationIndentation:
40
- EnforcedStyle: indented
41
-
42
34
  Style/HashSyntax:
43
35
  EnforcedStyle: hash_rockets
44
36
 
45
- Layout/AlignHash:
46
- EnforcedLastArgumentHashStyle: ignore_implicit
47
-
48
- Layout/IndentArray:
49
- EnforcedStyle: consistent
50
-
51
37
  Style/EmptyMethod:
52
38
  EnforcedStyle: expanded
53
39
 
54
- Style/MethodMissing:
40
+ Style/MissingRespondToMissing:
55
41
  Exclude:
56
42
  - "lib/appsignal/extension.rb"
57
43
  - "lib/appsignal/transaction.rb"
@@ -65,19 +51,75 @@ Style/Lambda:
65
51
  Style/WordArray:
66
52
  Enabled: false
67
53
 
54
+ Lint/ConstantDefinitionInBlock:
55
+ Exclude:
56
+ - "spec/**/*.rb"
57
+
58
+ Lint/EmptyClass:
59
+ Exclude:
60
+ - "spec/**/*.rb"
61
+
62
+ Layout/HashAlignment:
63
+ EnforcedLastArgumentHashStyle: ignore_implicit
64
+
65
+ Layout/ArgumentAlignment:
66
+ EnforcedStyle: with_fixed_indentation
67
+
68
+ Layout/LineContinuationLeadingSpace:
69
+ Enabled: false
70
+
71
+ Layout/FirstArrayElementIndentation:
72
+ EnforcedStyle: consistent
73
+
74
+ Layout/LineEndStringConcatenationIndentation:
75
+ EnforcedStyle: indented
76
+
77
+ Layout/ParameterAlignment:
78
+ EnforcedStyle: with_fixed_indentation
79
+
80
+ Layout/MultilineMethodCallIndentation:
81
+ EnforcedStyle: indented
82
+
83
+ Layout/MultilineOperationIndentation:
84
+ EnforcedStyle: indented
85
+
86
+ Lint/EmptyFile:
87
+ Exclude:
88
+ - "spec/**/*.rb"
89
+
68
90
  Naming/FileName:
69
91
  Exclude:
70
92
  - "ext/Rakefile"
71
93
 
94
+ Naming/RescuedExceptionsVariableName:
95
+ Enabled: false
96
+
97
+ Naming/VariableNumber:
98
+ Enabled: false
99
+
100
+ Metrics/ClassLength:
101
+ Enabled: false
102
+
72
103
  Metrics/BlockLength:
73
104
  Exclude:
74
105
  - "Rakefile"
75
106
 
76
107
  Style/FrozenStringLiteralComment:
77
108
  Enabled: true
109
+ Exclude:
110
+ - "spec/**/*.rb"
111
+
112
+ Style/NumericPredicate:
113
+ Enabled: false
78
114
 
79
115
  Style/SymbolArray:
80
116
  EnforcedStyle: brackets
81
117
 
82
- # Metrics/LineLength:
83
- # Max: 80
118
+ Style/RedundantConstantBase:
119
+ Enabled: false
120
+
121
+ Gemspec/DevelopmentDependencies:
122
+ Enabled: false
123
+
124
+ Layout/LineLength:
125
+ Max: 100
data/.rubocop_todo.yml CHANGED
@@ -1,96 +1,110 @@
1
1
  # This configuration was generated by
2
2
  # `rubocop --auto-gen-config`
3
- # on 2019-03-12 21:08:54 +0100 using RuboCop version 0.50.0.
3
+ # on 2023-04-12 14:23:03 UTC using RuboCop version 1.50.0.
4
4
  # The point is for the user to remove these configuration records
5
5
  # one by one as the offenses are removed from the code base.
6
6
  # Note that changes in the inspected code, or installation of new
7
7
  # versions of RuboCop, may require this file to be generated again.
8
8
 
9
- # Offense count: 50
9
+ # Offense count: 3
10
+ # This cop supports safe autocorrection (--autocorrect).
11
+ # Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, AllowedPatterns.
12
+ # URISchemes: http, https
13
+ Layout/LineLength:
14
+ Max: 112
15
+
16
+ # Offense count: 2
17
+ Lint/MissingSuper:
18
+ Exclude:
19
+ - 'lib/appsignal/extension.rb'
20
+ - 'lib/appsignal/logger.rb'
21
+
22
+ # Offense count: 1
23
+ Lint/NoReturnInBeginEndBlocks:
24
+ Exclude:
25
+ - 'lib/appsignal/environment.rb'
26
+
27
+ # Offense count: 1
28
+ Lint/StructNewOverride:
29
+ Exclude:
30
+ - 'spec/lib/appsignal/probes/sidekiq_spec.rb'
31
+
32
+ # Offense count: 53
33
+ # Configuration parameters: AllowedMethods, AllowedPatterns, CountRepeatedAttributes.
10
34
  Metrics/AbcSize:
11
- Max: 56
35
+ Max: 44
12
36
 
13
- # Offense count: 7
14
- # Configuration parameters: CountComments, ExcludedMethods.
37
+ # Offense count: 5
38
+ # Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns.
39
+ # AllowedMethods: refine
15
40
  Metrics/BlockLength:
16
41
  Max: 31
17
42
 
18
- # Offense count: 4
19
- # Configuration parameters: CountComments.
20
- Metrics/ClassLength:
21
- Exclude:
22
- - "lib/appsignal/cli/diagnose.rb"
23
- - "lib/appsignal/cli/install.rb"
24
- - "lib/appsignal/config.rb"
25
- - "lib/appsignal/transaction.rb"
26
-
27
- # Offense count: 16
43
+ # Offense count: 17
44
+ # Configuration parameters: AllowedMethods, AllowedPatterns.
28
45
  Metrics/CyclomaticComplexity:
29
46
  Max: 11
30
47
 
31
- # Offense count: 532
32
- # Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
33
- # URISchemes: http, https
34
- Layout/LineLength:
35
- Max: 152
36
-
37
- # Offense count: 109
38
- # Configuration parameters: CountComments.
48
+ # Offense count: 127
49
+ # Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns.
39
50
  Metrics/MethodLength:
40
- Max: 60
41
-
42
- # Offense count: 1
43
- # Configuration parameters: CountComments.
44
- Metrics/ModuleLength:
45
- Exclude:
46
- - "lib/appsignal.rb"
51
+ Max: 56
47
52
 
48
- # Offense count: 8
53
+ # Offense count: 12
54
+ # Configuration parameters: AllowedMethods, AllowedPatterns.
49
55
  Metrics/PerceivedComplexity:
50
- Max: 14
56
+ Max: 13
51
57
 
52
- # Offense count: 9
58
+ # Offense count: 7
53
59
  Naming/AccessorMethodName:
54
60
  Exclude:
55
61
  - 'lib/appsignal/helpers/instrumentation.rb'
56
62
  - 'lib/appsignal/transaction.rb'
57
63
 
58
- # Offense count: 4
59
- # Cop supports --auto-correct.
60
- Security/YAMLLoad:
64
+ # Offense count: 2
65
+ Security/Open:
61
66
  Exclude:
62
67
  - 'ext/base.rb'
68
+
69
+ # Offense count: 2
70
+ # This cop supports unsafe autocorrection (--autocorrect-all).
71
+ Security/YAMLLoad:
72
+ Exclude:
63
73
  - 'lib/appsignal/config.rb'
64
- - 'lib/appsignal/extension.rb'
65
74
  - 'lib/appsignal/integrations/sidekiq.rb'
66
75
 
67
- # Offense count: 20
68
- # Cop supports --auto-correct.
69
- # Configuration parameters: EnforcedStyle, SupportedStyles.
76
+ # Offense count: 7
77
+ # This cop supports safe autocorrection (--autocorrect).
78
+ # Configuration parameters: EnforcedStyle.
70
79
  # SupportedStyles: prefer_alias, prefer_alias_method
71
80
  Style/Alias:
72
81
  Exclude:
73
- - 'lib/appsignal.rb'
74
82
  - 'lib/appsignal/helpers/instrumentation.rb'
75
- - 'lib/appsignal/hooks/active_support_notifications.rb'
76
- - 'lib/appsignal/hooks/celluloid.rb'
77
- - 'lib/appsignal/hooks/net_http.rb'
78
- - 'lib/appsignal/hooks/puma.rb'
79
- - 'lib/appsignal/hooks/rake.rb'
80
- - 'lib/appsignal/hooks/redis.rb'
81
- - 'lib/appsignal/hooks/unicorn.rb'
82
- - 'lib/appsignal/hooks/webmachine.rb'
83
83
  - 'lib/appsignal/transaction.rb'
84
84
 
85
- # Offense count: 1
86
- # Configuration parameters: EnforcedStyle, SupportedStyles.
85
+ # Offense count: 2
86
+ # This cop supports unsafe autocorrection (--autocorrect-all).
87
+ # Configuration parameters: EnforcedStyle.
87
88
  # SupportedStyles: nested, compact
88
89
  Style/ClassAndModuleChildren:
89
90
  Exclude:
90
- - 'lib/appsignal/integrations/padrino.rb'
91
91
  - 'lib/appsignal/integrations/hanami.rb'
92
+ - 'lib/appsignal/integrations/padrino.rb'
92
93
 
93
94
  # Offense count: 1
94
- Style/DoubleNegation:
95
+ Style/ClassVars:
96
+ Exclude:
97
+ - 'spec/lib/appsignal/event_formatter_spec.rb'
98
+
99
+ # Offense count: 1
100
+ Style/OpenStructUse:
101
+ Exclude:
102
+ - 'lib/appsignal/cli/install.rb'
103
+
104
+ # Offense count: 2
105
+ # Configuration parameters: AllowedMethods.
106
+ # AllowedMethods: respond_to_missing?
107
+ Style/OptionalBooleanParameter:
95
108
  Exclude:
96
- - 'lib/appsignal.rb'
109
+ - 'lib/appsignal/integrations/delayed_job_plugin.rb'
110
+ - 'lib/appsignal/utils/query_params_sanitizer.rb'
@@ -1192,7 +1192,7 @@ blocks:
1192
1192
  value: latest
1193
1193
  commands:
1194
1194
  - "./support/bundler_wrapper exec rake test"
1195
- - name: Ruby jruby-9.4.0.0
1195
+ - name: Ruby jruby-9.4.1.0
1196
1196
  dependencies:
1197
1197
  - Validation
1198
1198
  task:
@@ -1208,14 +1208,14 @@ blocks:
1208
1208
  - "./support/bundler_wrapper exec rake extension:install"
1209
1209
  epilogue: *1
1210
1210
  jobs:
1211
- - name: Ruby jruby-9.4.0.0 for no_dependencies
1211
+ - name: Ruby jruby-9.4.1.0 for no_dependencies
1212
1212
  env_vars:
1213
1213
  - *2
1214
1214
  - *3
1215
1215
  - *4
1216
1216
  - *5
1217
1217
  - name: RUBY_VERSION
1218
- value: jruby-9.4.0.0
1218
+ value: jruby-9.4.1.0
1219
1219
  - name: GEMSET
1220
1220
  value: no_dependencies
1221
1221
  - name: BUNDLE_GEMFILE
@@ -1227,9 +1227,9 @@ blocks:
1227
1227
  commands:
1228
1228
  - "./support/bundler_wrapper exec rake test"
1229
1229
  - "./support/bundler_wrapper exec rake test:failure"
1230
- - name: Ruby jruby-9.4.0.0 - Gems
1230
+ - name: Ruby jruby-9.4.1.0 - Gems
1231
1231
  dependencies:
1232
- - Ruby jruby-9.4.0.0
1232
+ - Ruby jruby-9.4.1.0
1233
1233
  task:
1234
1234
  prologue:
1235
1235
  commands:
@@ -1243,14 +1243,14 @@ blocks:
1243
1243
  - "./support/bundler_wrapper exec rake extension:install"
1244
1244
  epilogue: *1
1245
1245
  jobs:
1246
- - name: Ruby jruby-9.4.0.0 for rails-6.0
1246
+ - name: Ruby jruby-9.4.1.0 for rails-6.0
1247
1247
  env_vars:
1248
1248
  - *2
1249
1249
  - *3
1250
1250
  - *4
1251
1251
  - *5
1252
1252
  - name: RUBY_VERSION
1253
- value: jruby-9.4.0.0
1253
+ value: jruby-9.4.1.0
1254
1254
  - name: GEMSET
1255
1255
  value: rails-6.0
1256
1256
  - name: BUNDLE_GEMFILE
@@ -1261,14 +1261,14 @@ blocks:
1261
1261
  value: latest
1262
1262
  commands:
1263
1263
  - "./support/bundler_wrapper exec rake test"
1264
- - name: Ruby jruby-9.4.0.0 for rails-6.1
1264
+ - name: Ruby jruby-9.4.1.0 for rails-6.1
1265
1265
  env_vars:
1266
1266
  - *2
1267
1267
  - *3
1268
1268
  - *4
1269
1269
  - *5
1270
1270
  - name: RUBY_VERSION
1271
- value: jruby-9.4.0.0
1271
+ value: jruby-9.4.1.0
1272
1272
  - name: GEMSET
1273
1273
  value: rails-6.1
1274
1274
  - name: BUNDLE_GEMFILE
@@ -1279,14 +1279,14 @@ blocks:
1279
1279
  value: latest
1280
1280
  commands:
1281
1281
  - "./support/bundler_wrapper exec rake test"
1282
- - name: Ruby jruby-9.4.0.0 for rails-7.0
1282
+ - name: Ruby jruby-9.4.1.0 for rails-7.0
1283
1283
  env_vars:
1284
1284
  - *2
1285
1285
  - *3
1286
1286
  - *4
1287
1287
  - *5
1288
1288
  - name: RUBY_VERSION
1289
- value: jruby-9.4.0.0
1289
+ value: jruby-9.4.1.0
1290
1290
  - name: GEMSET
1291
1291
  value: rails-7.0
1292
1292
  - name: BUNDLE_GEMFILE
data/CHANGELOG.md CHANGED
@@ -1,5 +1,42 @@
1
1
  # AppSignal for Ruby gem Changelog
2
2
 
3
+ ## 3.4.1
4
+
5
+ ### Added
6
+
7
+ - [77ce4e39](https://github.com/appsignal/appsignal-ruby/commit/77ce4e3997fc7525d71f705cb332c05765568dc6) patch - Add Rails [error reporter](https://guides.rubyonrails.org/error_reporting.html) support. Errors reported using `Rails.error.handle` are tracked as separate errors in AppSignal. We rely on our other Rails instrumentation to report the errors reported with `Rails.error.record`.
8
+
9
+ The error is reported under the same controller/job name, on a best effort basis. It may not be 100% accurate. If `Rails.error.handle` is called within a Rails controller or Active Job job, it will copy the AppSignal transaction namespace, action name and tags from the current transaction to the transaction for the `Rails.error.handle` reported error. If you call `Appsignal.set_namespace`, `Appsignal.set_action` or `Appsignal.tag_request` after `Rails.error.handle`, those changes will not be reflected up in the already reported error.
10
+
11
+ It is also possible to customize the AppSignal namespace and action name for the reported error using the `appsignal` context:
12
+
13
+ ```ruby
14
+ Rails.error.handle(:context => { :appsignal => { :namespace => "context", :action => "ContextAction" } }) do
15
+ raise "Test"
16
+ end
17
+ ```
18
+
19
+ All other key-values are reported as tags:
20
+
21
+ ```ruby
22
+ Rails.error.handle(:context => { :tag_key => "tag value" }) do
23
+ raise "Test"
24
+ end
25
+ ```
26
+
27
+ Integration with the Rails error reporter is enabled by default. Disable this feature by setting the `enable_rails_error_reporter` config option to `false`.
28
+ - [b4f58afd](https://github.com/appsignal/appsignal-ruby/commit/b4f58afdeb80cd1eb336ec5bd7b5daf46a4ef0a8) patch - Support Sidekiq in Rails error reporter. Track errors reported using `Rails.error.handle` in Sidekiq jobs, in the correct action. Previously it would report no action name for the incident, now it will use the worker name by default.
29
+
30
+ ### Changed
31
+
32
+ - [e0332791](https://github.com/appsignal/appsignal-ruby/commit/e03327913fdc19db68fc953308eb1e4f2441ba05) patch - Set the AppSignal transaction namespace, action name and some tags, before Active Job jobs are performed. This allows us to check what the namespace, action name and some tags are during the instrumentation itself.
33
+ - [4a40699a](https://github.com/appsignal/appsignal-ruby/commit/4a40699a1655bc10b3fa6eb90135374a6b31b195) patch - The AppSignal gem requires Ruby 3 or higher to run. Remove unnecessary Ruby version checks that query Ruby 2.7 or lower.
34
+ - [da7d1c76](https://github.com/appsignal/appsignal-ruby/commit/da7d1c762fa097080b884bccf7c083aa692803bc) patch - Internal refactor of Ruby code due to RuboCop upgrade. Use the public `prepend` method to prepend AppSignal instrumentation modules.
35
+
36
+ ### Fixed
37
+
38
+ - [009d533f](https://github.com/appsignal/appsignal-ruby/commit/009d533f92b08663eca1460b990524d56322fb65) patch - Fix a bug when using ActiveSupport::TaggedLogging calling the `silence` method.
39
+
3
40
  ## 3.4.0
4
41
 
5
42
  ### Deprecated
data/Rakefile CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "bundler"
2
4
  require "rubygems/package_task"
3
5
  require "fileutils"
@@ -89,9 +91,7 @@ namespace :build_matrix do
89
91
  end
90
92
  end
91
93
  builds << ruby_primary_block
92
- if ruby_secondary_block["task"]["jobs"].count.nonzero?
93
- builds << ruby_secondary_block
94
- end
94
+ builds << ruby_secondary_block if ruby_secondary_block["task"]["jobs"].count.nonzero?
95
95
  end
96
96
  semaphore["blocks"] += builds
97
97
 
@@ -130,6 +130,7 @@ namespace :build_matrix do
130
130
  matrix["ruby"].each do |ruby|
131
131
  ruby_version = ruby["ruby"]
132
132
  out << "echo 'Switching to #{ruby_version}'"
133
+ # rubocop:disable Layout/LineLength
133
134
  out << "#{config[:switch_command].call(ruby_version)} || { echo 'Switching Ruby failed'; exit 1; }"
134
135
  out << "ruby -v"
135
136
  out << "echo 'Compiling extension'"
@@ -150,6 +151,7 @@ namespace :build_matrix do
150
151
  out << "echo 'Running #{gemfile} in #{ruby_version}'"
151
152
  out << "#{bundler_version} #{gemfile_env} ./support/bundler_wrapper exec rspec || { echo 'Running specs failed'; exit 1; }"
152
153
  end
154
+ # rubocop:enable Layout/LineLength
153
155
  out << ""
154
156
  end
155
157
  out << "rm -f .ruby-version"
@@ -157,9 +159,7 @@ namespace :build_matrix do
157
159
 
158
160
  script = "bundle_and_spec_all_#{version_manager}"
159
161
  FileUtils.rm_f(script)
160
- File.open(script, "w") do |file|
161
- file.write out.join("\n")
162
- end
162
+ File.write(script, out.join("\n"))
163
163
  File.chmod(0o775, script)
164
164
  puts "Generated #{script}"
165
165
  end
@@ -209,20 +209,18 @@ namespace :build do
209
209
  eval(File.read("appsignal.gemspec")) # rubocop:disable Security/Eval
210
210
  end
211
211
 
212
- def modify_base_gemspec
213
- base_gemspec.tap do |s|
214
- yield s
215
- end
212
+ def modify_base_gemspec(&block)
213
+ base_gemspec.tap(&block)
216
214
  end
217
215
 
218
216
  def define_build_task(task_name, base_gemspec, &block)
219
217
  Gem::PackageTask.new(base_gemspec, &block)
220
- rescue StandardError => error
218
+ rescue StandardError => e
221
219
  puts "Warning: An error occurred defining `build:#{task_name}:gem` Rake task."
222
220
  puts "This task will not be availble."
223
221
  if ENV["DEBUG"]
224
- puts "#{error}: #{error.message}"
225
- puts error.backtrace
222
+ puts "#{e}: #{e.message}"
223
+ puts e.backtrace
226
224
  else
227
225
  puts "For more information, run the same command with `DEBUG=true`."
228
226
  end
@@ -231,7 +229,7 @@ namespace :build do
231
229
 
232
230
  namespace :ruby do
233
231
  # Extension default set in `appsignal.gemspec`
234
- define_build_task(:ruby, base_gemspec) { |_pkg| }
232
+ define_build_task(:ruby, base_gemspec) { |_pkg| } # rubocop:disable Lint/EmptyBlock
235
233
  end
236
234
 
237
235
  namespace :jruby do
@@ -243,7 +241,7 @@ namespace :build do
243
241
  s.add_dependency "ffi"
244
242
  end
245
243
 
246
- define_build_task(:jruby, spec) { |_pkg| }
244
+ define_build_task(:jruby, spec) { |_pkg| } # rubocop:disable Lint/EmptyBlock
247
245
  end
248
246
 
249
247
  desc "Build all gem versions"
@@ -251,91 +249,9 @@ namespace :build do
251
249
 
252
250
  desc "Clean up all gem build artifacts"
253
251
  task :clean do
254
- FileUtils.rm_rf File.expand_path("../pkg", __FILE__)
255
- end
256
- end
257
-
258
- namespace :publish do
259
- VERSION_FILE = "lib/appsignal/version.rb".freeze
260
- CHANGELOG_FILE = "CHANGELOG.md".freeze
261
-
262
- def changes
263
- git_status_to_array(`git status -s -u`)
264
- end
265
-
266
- def git_status_to_array(changes)
267
- changes.split("\n").each { |change| change.gsub!(/^.. /, "") }
268
- end
269
-
270
- def current_branch
271
- `git rev-parse --abbrev-ref HEAD`.chomp
272
- end
273
-
274
- task :check_requirements do
275
- unless changes.empty?
276
- puts "ERROR: There should be no uncommitted file changes."
277
- exit 1
278
- end
279
- unless ENV["EDITOR"]
280
- puts "ERROR: $EDITOR environment variable should be set."
281
- exit 1
282
- end
283
- end
284
-
285
- task :configure_version do
286
- puts "\n# Configuring new gem version"
287
-
288
- system "$EDITOR #{VERSION_FILE}"
289
- unless changes.member?(VERSION_FILE)
290
- puts "ERROR: Please actually change the gem version in: #{VERSION_FILE}"
291
- exit 1
292
- end
293
-
294
- puts "\n# Updating the changelog"
295
- system "$EDITOR #{CHANGELOG_FILE}"
296
- end
297
-
298
- task :push_gem_packages do
299
- puts "\n# Pushing gem packages"
300
- Dir.chdir("#{File.dirname(__FILE__)}/pkg") do
301
- Dir["*.gem"].each do |gem_package|
302
- puts "## Publishing gem package: #{gem_package}"
303
- result = system "gem push #{gem_package}"
304
- raise "Failed to Push gem" unless result
305
- end
306
- end
307
- end
308
-
309
- task :tag_and_push_version do
310
- # Make sure to load the new version number
311
- Appsignal.send(:remove_const, :VERSION)
312
- load File.expand_path(VERSION_FILE)
313
- version = "v#{Appsignal::VERSION}"
314
-
315
- begin
316
- puts `git commit -am 'Bump to #{version} [ci skip]'`
317
- puts "# Creating tag #{version}"
318
- puts `git tag #{version}`
319
- puts `git push origin #{version}`
320
- puts `git push origin #{current_branch}`
321
- rescue
322
- puts "ERROR: Tag '#{version}' already exists"
323
- exit 1
324
- end
325
- end
326
-
327
- task :build => "build:clean" do
328
- # Shell out to build so the new version is loaded in the gemspec.
329
- `rake build:all`
252
+ FileUtils.rm_rf File.expand_path("pkg", __dir__)
330
253
  end
331
254
  end
332
- task :publish => [
333
- "publish:check_requirements",
334
- "publish:configure_version",
335
- "publish:build",
336
- "publish:push_gem_packages",
337
- "publish:tag_and_push_version"
338
- ]
339
255
 
340
256
  desc "Install the AppSignal gem, extension and all possible dependencies."
341
257
  task :install => "extension:install" do
@@ -425,7 +341,7 @@ begin
425
341
  desc "Run the Appsignal gem test in an extension failure scenario"
426
342
  task :failure => [:prepare_failure, :rspec_failure]
427
343
  end
428
- rescue LoadError # rubocop:disable Lint/HandleExceptions
344
+ rescue LoadError
429
345
  # When running rake install, there is no RSpec yet.
430
346
  end
431
347
 
data/appsignal.gemspec CHANGED
@@ -10,14 +10,13 @@ Gem::Specification.new do |gem| # rubocop:disable Metrics/BlockLength
10
10
  ]
11
11
  gem.email = ["support@appsignal.com"]
12
12
  gem.description = "The official appsignal.com gem"
13
- gem.summary = "Logs performance and exception data from your app to "\
14
- "appsignal.com"
13
+ gem.summary = "Logs performance and exception data from your app to " \
14
+ "appsignal.com"
15
15
  gem.homepage = "https://github.com/appsignal/appsignal-ruby"
16
16
  gem.license = "MIT"
17
17
 
18
18
  gem.files = `git ls-files`.split($\).reject { |f| f.start_with?(".changesets/") } # rubocop:disable Style/SpecialGlobalVars
19
19
  gem.executables = gem.files.grep(%r{^bin/}).map { |f| File.basename(f) }
20
- gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
21
20
  gem.name = "appsignal"
22
21
  gem.require_paths = %w[lib ext]
23
22
  gem.version = Appsignal::VERSION
@@ -41,7 +40,7 @@ Gem::Specification.new do |gem| # rubocop:disable Metrics/BlockLength
41
40
  gem.add_development_dependency "pry"
42
41
  gem.add_development_dependency "rake", ">= 12"
43
42
  gem.add_development_dependency "rspec", "~> 3.8"
44
- gem.add_development_dependency "rubocop"
43
+ gem.add_development_dependency "rubocop", "1.50.0"
45
44
  gem.add_development_dependency "timecop"
46
45
  gem.add_development_dependency "webmock"
47
46
  gem.add_development_dependency "yard", ">= 0.9.20"
data/bin/appsignal CHANGED
@@ -1,4 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
2
3
 
3
4
  $LOAD_PATH << File.expand_path(File.join(File.dirname(__FILE__), "..", "lib"))
4
5
  require "appsignal/cli"
@@ -7,7 +8,8 @@ begin
7
8
  Appsignal::CLI.run
8
9
  rescue => e
9
10
  raise e if $DEBUG
10
- STDERR.puts e.message
11
- STDERR.puts e.backtrace.join("\n")
11
+
12
+ warn e.message
13
+ warn e.backtrace.join("\n")
12
14
  exit 1
13
15
  end