newrelic_rpm 6.6.0.358 → 6.11.0.365

Sign up to get free protection for your applications and to get access to all the features.
Files changed (126) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +3 -0
  3. data/.travis.yml +81 -5
  4. data/CHANGELOG.md +262 -0
  5. data/Gemfile +6 -2
  6. data/Guardfile +18 -1
  7. data/LICENSE +1 -1
  8. data/Rakefile +2 -0
  9. data/lib/new_relic/agent.rb +89 -7
  10. data/lib/new_relic/agent/agent.rb +115 -58
  11. data/lib/new_relic/agent/agent_logger.rb +4 -0
  12. data/lib/new_relic/agent/attribute_filter.rb +7 -7
  13. data/lib/new_relic/agent/attributes.rb +150 -0
  14. data/lib/new_relic/agent/autostart.rb +19 -14
  15. data/lib/new_relic/agent/configuration/default_source.rb +154 -9
  16. data/lib/new_relic/agent/configuration/event_harvest_config.rb +11 -5
  17. data/lib/new_relic/agent/configuration/manager.rb +0 -8
  18. data/lib/new_relic/agent/configuration/server_source.rb +3 -2
  19. data/lib/new_relic/agent/configuration/yaml_source.rb +11 -6
  20. data/lib/new_relic/agent/connect/request_builder.rb +5 -13
  21. data/lib/new_relic/agent/database.rb +1 -2
  22. data/lib/new_relic/agent/database/obfuscation_helpers.rb +1 -1
  23. data/lib/new_relic/agent/datastores/mongo.rb +1 -1
  24. data/lib/new_relic/agent/datastores/mongo/event_formatter.rb +2 -2
  25. data/lib/new_relic/agent/datastores/mongo/obfuscator.rb +8 -8
  26. data/lib/new_relic/agent/distributed_tracing.rb +155 -6
  27. data/lib/new_relic/agent/{cross_app_payload.rb → distributed_tracing/cross_app_payload.rb} +2 -1
  28. data/lib/new_relic/agent/{cross_app_tracing.rb → distributed_tracing/cross_app_tracing.rb} +60 -45
  29. data/lib/new_relic/agent/distributed_tracing/distributed_trace_intrinsics.rb +80 -0
  30. data/lib/new_relic/agent/distributed_tracing/distributed_trace_metrics.rb +75 -0
  31. data/lib/new_relic/agent/{distributed_trace_payload.rb → distributed_tracing/distributed_trace_payload.rb} +24 -101
  32. data/lib/new_relic/agent/distributed_tracing/distributed_trace_transport_type.rb +39 -0
  33. data/lib/new_relic/agent/distributed_tracing/trace_context.rb +246 -0
  34. data/lib/new_relic/agent/distributed_tracing/trace_context_payload.rb +126 -0
  35. data/lib/new_relic/agent/error_collector.rb +33 -16
  36. data/lib/new_relic/agent/error_event_aggregator.rb +7 -5
  37. data/lib/new_relic/agent/external.rb +7 -7
  38. data/lib/new_relic/agent/guid_generator.rb +28 -0
  39. data/lib/new_relic/agent/hostname.rb +7 -1
  40. data/lib/new_relic/agent/http_clients/abstract.rb +82 -0
  41. data/lib/new_relic/agent/http_clients/curb_wrappers.rb +24 -19
  42. data/lib/new_relic/agent/http_clients/excon_wrappers.rb +28 -13
  43. data/lib/new_relic/agent/http_clients/http_rb_wrappers.rb +17 -21
  44. data/lib/new_relic/agent/http_clients/httpclient_wrappers.rb +10 -11
  45. data/lib/new_relic/agent/http_clients/net_http_wrappers.rb +16 -4
  46. data/lib/new_relic/agent/http_clients/typhoeus_wrappers.rb +4 -6
  47. data/lib/new_relic/agent/http_clients/uri_util.rb +3 -2
  48. data/lib/new_relic/agent/instrumentation/action_cable_subscriber.rb +5 -7
  49. data/lib/new_relic/agent/instrumentation/action_controller_subscriber.rb +4 -0
  50. data/lib/new_relic/agent/instrumentation/action_view_subscriber.rb +11 -2
  51. data/lib/new_relic/agent/instrumentation/active_record.rb +4 -2
  52. data/lib/new_relic/agent/instrumentation/active_record_subscriber.rb +7 -2
  53. data/lib/new_relic/agent/instrumentation/active_storage_subscriber.rb +8 -4
  54. data/lib/new_relic/agent/instrumentation/bunny.rb +45 -28
  55. data/lib/new_relic/agent/instrumentation/curb.rb +59 -18
  56. data/lib/new_relic/agent/instrumentation/data_mapper.rb +3 -1
  57. data/lib/new_relic/agent/instrumentation/excon.rb +1 -1
  58. data/lib/new_relic/agent/instrumentation/excon/connection.rb +6 -3
  59. data/lib/new_relic/agent/instrumentation/excon/middleware.rb +2 -1
  60. data/lib/new_relic/agent/instrumentation/grape.rb +5 -10
  61. data/lib/new_relic/agent/instrumentation/http.rb +6 -3
  62. data/lib/new_relic/agent/instrumentation/httpclient.rb +5 -3
  63. data/lib/new_relic/agent/instrumentation/memcache.rb +3 -1
  64. data/lib/new_relic/agent/instrumentation/memcache/dalli.rb +6 -2
  65. data/lib/new_relic/agent/instrumentation/mongo.rb +9 -3
  66. data/lib/new_relic/agent/instrumentation/mongodb_command_subscriber.rb +13 -0
  67. data/lib/new_relic/agent/instrumentation/net.rb +6 -3
  68. data/lib/new_relic/agent/instrumentation/notifications_subscriber.rb +25 -1
  69. data/lib/new_relic/agent/instrumentation/redis.rb +9 -3
  70. data/lib/new_relic/agent/instrumentation/resque.rb +3 -0
  71. data/lib/new_relic/agent/instrumentation/sidekiq.rb +47 -23
  72. data/lib/new_relic/agent/instrumentation/typhoeus.rb +23 -6
  73. data/lib/new_relic/agent/logging.rb +139 -0
  74. data/lib/new_relic/agent/messaging.rb +5 -73
  75. data/lib/new_relic/agent/method_tracer.rb +18 -6
  76. data/lib/new_relic/agent/method_tracer_helpers.rb +2 -2
  77. data/lib/new_relic/agent/monitors.rb +27 -0
  78. data/lib/new_relic/agent/monitors/cross_app_monitor.rb +110 -0
  79. data/lib/new_relic/agent/monitors/distributed_tracing_monitor.rb +27 -0
  80. data/lib/new_relic/agent/{inbound_request_monitor.rb → monitors/inbound_request_monitor.rb} +1 -1
  81. data/lib/new_relic/agent/{synthetics_monitor.rb → monitors/synthetics_monitor.rb} +2 -4
  82. data/lib/new_relic/agent/new_relic_service.rb +7 -6
  83. data/lib/new_relic/agent/noticible_error.rb +22 -0
  84. data/lib/new_relic/agent/span_event_aggregator.rb +1 -0
  85. data/lib/new_relic/agent/span_event_primitive.rb +86 -53
  86. data/lib/new_relic/agent/sql_sampler.rb +3 -3
  87. data/lib/new_relic/agent/supported_versions.rb +2 -2
  88. data/lib/new_relic/agent/system_info.rb +12 -3
  89. data/lib/new_relic/agent/tracer.rb +65 -18
  90. data/lib/new_relic/agent/transaction.rb +84 -79
  91. data/lib/new_relic/agent/transaction/abstract_segment.rb +28 -2
  92. data/lib/new_relic/agent/transaction/distributed_tracer.rb +171 -0
  93. data/lib/new_relic/agent/transaction/distributed_tracing.rb +57 -146
  94. data/lib/new_relic/agent/transaction/external_request_segment.rb +29 -36
  95. data/lib/new_relic/agent/transaction/message_broker_segment.rb +3 -11
  96. data/lib/new_relic/agent/transaction/segment.rb +7 -1
  97. data/lib/new_relic/agent/transaction/trace.rb +2 -4
  98. data/lib/new_relic/agent/transaction/trace_context.rb +168 -0
  99. data/lib/new_relic/agent/transaction/trace_node.rb +10 -8
  100. data/lib/new_relic/agent/transaction_error_primitive.rb +10 -15
  101. data/lib/new_relic/agent/transaction_event_primitive.rb +28 -39
  102. data/lib/new_relic/cli/commands/deployments.rb +1 -1
  103. data/lib/new_relic/cli/commands/install.rb +3 -2
  104. data/lib/new_relic/coerce.rb +31 -6
  105. data/lib/new_relic/constants.rb +38 -0
  106. data/lib/new_relic/control/instance_methods.rb +10 -1
  107. data/lib/new_relic/dependency_detection.rb +4 -4
  108. data/lib/new_relic/environment_report.rb +5 -1
  109. data/lib/new_relic/noticed_error.rb +38 -17
  110. data/lib/new_relic/rack/browser_monitoring.rb +5 -0
  111. data/lib/new_relic/supportability_helper.rb +14 -0
  112. data/lib/new_relic/version.rb +1 -1
  113. data/lib/tasks/multiverse.rb +25 -0
  114. data/lib/tasks/tests.rake +6 -1
  115. data/newrelic_rpm.gemspec +19 -8
  116. data/test/agent_helper.rb +323 -71
  117. metadata +100 -33
  118. data/lib/new_relic/agent/cross_app_monitor.rb +0 -110
  119. data/lib/new_relic/agent/distributed_trace_monitor.rb +0 -40
  120. data/lib/new_relic/agent/http_clients/abstract_request.rb +0 -31
  121. data/lib/new_relic/agent/transaction/attributes.rb +0 -154
  122. data/lib/tasks/versions.html.erb +0 -28
  123. data/lib/tasks/versions.postface.html +0 -8
  124. data/lib/tasks/versions.preface.html +0 -9
  125. data/lib/tasks/versions.rake +0 -65
  126. data/lib/tasks/versions.txt.erb +0 -14
metadata CHANGED
@@ -1,17 +1,17 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: newrelic_rpm
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.6.0.358
4
+ version: 6.11.0.365
5
5
  platform: ruby
6
6
  authors:
7
- - Matthew Wear
8
7
  - Chris Pine
9
8
  - Rachel Klein
10
- - Justin Foote
9
+ - Tanna McClure
10
+ - Michael Lang
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2019-08-29 00:00:00.000000000 Z
14
+ date: 2020-05-28 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: rake
@@ -19,26 +19,54 @@ dependencies:
19
19
  requirements:
20
20
  - - '='
21
21
  - !ruby/object:Gem::Version
22
- version: 10.1.0
22
+ version: 12.3.3
23
23
  type: :development
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
26
26
  requirements:
27
27
  - - '='
28
28
  - !ruby/object:Gem::Version
29
- version: 10.1.0
29
+ version: 12.3.3
30
+ - !ruby/object:Gem::Dependency
31
+ name: rb-inotify
32
+ requirement: !ruby/object:Gem::Requirement
33
+ requirements:
34
+ - - '='
35
+ - !ruby/object:Gem::Version
36
+ version: 0.9.10
37
+ type: :development
38
+ prerelease: false
39
+ version_requirements: !ruby/object:Gem::Requirement
40
+ requirements:
41
+ - - '='
42
+ - !ruby/object:Gem::Version
43
+ version: 0.9.10
44
+ - !ruby/object:Gem::Dependency
45
+ name: listen
46
+ requirement: !ruby/object:Gem::Requirement
47
+ requirements:
48
+ - - '='
49
+ - !ruby/object:Gem::Version
50
+ version: 3.0.8
51
+ type: :development
52
+ prerelease: false
53
+ version_requirements: !ruby/object:Gem::Requirement
54
+ requirements:
55
+ - - '='
56
+ - !ruby/object:Gem::Version
57
+ version: 3.0.8
30
58
  - !ruby/object:Gem::Dependency
31
59
  name: minitest
32
60
  requirement: !ruby/object:Gem::Requirement
33
61
  requirements:
34
- - - "~>"
62
+ - - '='
35
63
  - !ruby/object:Gem::Version
36
64
  version: 4.7.5
37
65
  type: :development
38
66
  prerelease: false
39
67
  version_requirements: !ruby/object:Gem::Requirement
40
68
  requirements:
41
- - - "~>"
69
+ - - '='
42
70
  - !ruby/object:Gem::Version
43
71
  version: 4.7.5
44
72
  - !ruby/object:Gem::Dependency
@@ -47,14 +75,14 @@ dependencies:
47
75
  requirements:
48
76
  - - "~>"
49
77
  - !ruby/object:Gem::Version
50
- version: 0.13.0
78
+ version: 1.9.0
51
79
  type: :development
52
80
  prerelease: false
53
81
  version_requirements: !ruby/object:Gem::Requirement
54
82
  requirements:
55
83
  - - "~>"
56
84
  - !ruby/object:Gem::Version
57
- version: 0.13.0
85
+ version: 1.9.0
58
86
  - !ruby/object:Gem::Dependency
59
87
  name: yard
60
88
  requirement: !ruby/object:Gem::Requirement
@@ -75,14 +103,14 @@ dependencies:
75
103
  requirements:
76
104
  - - "~>"
77
105
  - !ruby/object:Gem::Version
78
- version: 0.2.4
106
+ version: 0.3.0
79
107
  type: :development
80
108
  prerelease: false
81
109
  version_requirements: !ruby/object:Gem::Requirement
82
110
  requirements:
83
111
  - - "~>"
84
112
  - !ruby/object:Gem::Version
85
- version: 0.2.4
113
+ version: 0.3.0
86
114
  - !ruby/object:Gem::Dependency
87
115
  name: pry-stack_explorer
88
116
  requirement: !ruby/object:Gem::Requirement
@@ -97,6 +125,34 @@ dependencies:
97
125
  - - "~>"
98
126
  - !ruby/object:Gem::Version
99
127
  version: 0.4.9
128
+ - !ruby/object:Gem::Dependency
129
+ name: guard
130
+ requirement: !ruby/object:Gem::Requirement
131
+ requirements:
132
+ - - "~>"
133
+ - !ruby/object:Gem::Version
134
+ version: 2.16.0
135
+ type: :development
136
+ prerelease: false
137
+ version_requirements: !ruby/object:Gem::Requirement
138
+ requirements:
139
+ - - "~>"
140
+ - !ruby/object:Gem::Version
141
+ version: 2.16.0
142
+ - !ruby/object:Gem::Dependency
143
+ name: guard-minitest
144
+ requirement: !ruby/object:Gem::Requirement
145
+ requirements:
146
+ - - "~>"
147
+ - !ruby/object:Gem::Version
148
+ version: 2.4.0
149
+ type: :development
150
+ prerelease: false
151
+ version_requirements: !ruby/object:Gem::Requirement
152
+ requirements:
153
+ - - "~>"
154
+ - !ruby/object:Gem::Version
155
+ version: 2.4.0
100
156
  - !ruby/object:Gem::Dependency
101
157
  name: hometown
102
158
  requirement: !ruby/object:Gem::Requirement
@@ -115,21 +171,21 @@ dependencies:
115
171
  name: bundler
116
172
  requirement: !ruby/object:Gem::Requirement
117
173
  requirements:
118
- - - "<"
174
+ - - ">="
119
175
  - !ruby/object:Gem::Version
120
- version: '2.0'
176
+ version: '0'
121
177
  type: :development
122
178
  prerelease: false
123
179
  version_requirements: !ruby/object:Gem::Requirement
124
180
  requirements:
125
- - - "<"
181
+ - - ">="
126
182
  - !ruby/object:Gem::Version
127
- version: '2.0'
183
+ version: '0'
128
184
  description: |
129
185
  New Relic is a performance management system, developed by New Relic,
130
186
  Inc (http://www.newrelic.com). New Relic provides you with deep
131
187
  information about the performance of your web application as it runs
132
- in production. The New Relic Ruby Agent is dual-purposed as a either a
188
+ in production. The New Relic Ruby agent is dual-purposed as a either a
133
189
  Gem or plugin, hosted on
134
190
  https://github.com/newrelic/rpm/
135
191
  email: support@newrelic.com
@@ -172,6 +228,7 @@ files:
172
228
  - lib/new_relic/agent/agent_logger.rb
173
229
  - lib/new_relic/agent/attribute_filter.rb
174
230
  - lib/new_relic/agent/attribute_processing.rb
231
+ - lib/new_relic/agent/attributes.rb
175
232
  - lib/new_relic/agent/audit_logger.rb
176
233
  - lib/new_relic/agent/autostart.rb
177
234
  - lib/new_relic/agent/chained_call.rb
@@ -192,9 +249,6 @@ files:
192
249
  - lib/new_relic/agent/configuration/yaml_source.rb
193
250
  - lib/new_relic/agent/connect/request_builder.rb
194
251
  - lib/new_relic/agent/connect/response_handler.rb
195
- - lib/new_relic/agent/cross_app_monitor.rb
196
- - lib/new_relic/agent/cross_app_payload.rb
197
- - lib/new_relic/agent/cross_app_tracing.rb
198
252
  - lib/new_relic/agent/custom_event_aggregator.rb
199
253
  - lib/new_relic/agent/database.rb
200
254
  - lib/new_relic/agent/database/explain_plan_helpers.rb
@@ -210,9 +264,15 @@ files:
210
264
  - lib/new_relic/agent/datastores/mongo/statement_formatter.rb
211
265
  - lib/new_relic/agent/datastores/redis.rb
212
266
  - lib/new_relic/agent/deprecator.rb
213
- - lib/new_relic/agent/distributed_trace_monitor.rb
214
- - lib/new_relic/agent/distributed_trace_payload.rb
215
267
  - lib/new_relic/agent/distributed_tracing.rb
268
+ - lib/new_relic/agent/distributed_tracing/cross_app_payload.rb
269
+ - lib/new_relic/agent/distributed_tracing/cross_app_tracing.rb
270
+ - lib/new_relic/agent/distributed_tracing/distributed_trace_intrinsics.rb
271
+ - lib/new_relic/agent/distributed_tracing/distributed_trace_metrics.rb
272
+ - lib/new_relic/agent/distributed_tracing/distributed_trace_payload.rb
273
+ - lib/new_relic/agent/distributed_tracing/distributed_trace_transport_type.rb
274
+ - lib/new_relic/agent/distributed_tracing/trace_context.rb
275
+ - lib/new_relic/agent/distributed_tracing/trace_context_payload.rb
216
276
  - lib/new_relic/agent/encoding_normalizer.rb
217
277
  - lib/new_relic/agent/error_collector.rb
218
278
  - lib/new_relic/agent/error_event_aggregator.rb
@@ -222,10 +282,11 @@ files:
222
282
  - lib/new_relic/agent/event_listener.rb
223
283
  - lib/new_relic/agent/event_loop.rb
224
284
  - lib/new_relic/agent/external.rb
285
+ - lib/new_relic/agent/guid_generator.rb
225
286
  - lib/new_relic/agent/harvester.rb
226
287
  - lib/new_relic/agent/heap.rb
227
288
  - lib/new_relic/agent/hostname.rb
228
- - lib/new_relic/agent/http_clients/abstract_request.rb
289
+ - lib/new_relic/agent/http_clients/abstract.rb
229
290
  - lib/new_relic/agent/http_clients/curb_wrappers.rb
230
291
  - lib/new_relic/agent/http_clients/excon_wrappers.rb
231
292
  - lib/new_relic/agent/http_clients/http_rb_wrappers.rb
@@ -233,7 +294,6 @@ files:
233
294
  - lib/new_relic/agent/http_clients/net_http_wrappers.rb
234
295
  - lib/new_relic/agent/http_clients/typhoeus_wrappers.rb
235
296
  - lib/new_relic/agent/http_clients/uri_util.rb
236
- - lib/new_relic/agent/inbound_request_monitor.rb
237
297
  - lib/new_relic/agent/instrumentation.rb
238
298
  - lib/new_relic/agent/instrumentation/action_cable_subscriber.rb
239
299
  - lib/new_relic/agent/instrumentation/action_controller_subscriber.rb
@@ -297,15 +357,22 @@ files:
297
357
  - lib/new_relic/agent/internal_agent_error.rb
298
358
  - lib/new_relic/agent/javascript_instrumentor.rb
299
359
  - lib/new_relic/agent/log_once.rb
360
+ - lib/new_relic/agent/logging.rb
300
361
  - lib/new_relic/agent/memory_logger.rb
301
362
  - lib/new_relic/agent/messaging.rb
302
363
  - lib/new_relic/agent/method_tracer.rb
303
364
  - lib/new_relic/agent/method_tracer_helpers.rb
365
+ - lib/new_relic/agent/monitors.rb
366
+ - lib/new_relic/agent/monitors/cross_app_monitor.rb
367
+ - lib/new_relic/agent/monitors/distributed_tracing_monitor.rb
368
+ - lib/new_relic/agent/monitors/inbound_request_monitor.rb
369
+ - lib/new_relic/agent/monitors/synthetics_monitor.rb
304
370
  - lib/new_relic/agent/new_relic_service.rb
305
371
  - lib/new_relic/agent/new_relic_service/encoders.rb
306
372
  - lib/new_relic/agent/new_relic_service/json_marshaller.rb
307
373
  - lib/new_relic/agent/new_relic_service/marshaller.rb
308
374
  - lib/new_relic/agent/new_relic_service/security_policy_settings.rb
375
+ - lib/new_relic/agent/noticible_error.rb
309
376
  - lib/new_relic/agent/null_logger.rb
310
377
  - lib/new_relic/agent/obfuscator.rb
311
378
  - lib/new_relic/agent/parameter_filtering.rb
@@ -334,7 +401,6 @@ files:
334
401
  - lib/new_relic/agent/stats_engine/stats_hash.rb
335
402
  - lib/new_relic/agent/supported_versions.rb
336
403
  - lib/new_relic/agent/synthetics_event_aggregator.rb
337
- - lib/new_relic/agent/synthetics_monitor.rb
338
404
  - lib/new_relic/agent/system_info.rb
339
405
  - lib/new_relic/agent/threading/agent_thread.rb
340
406
  - lib/new_relic/agent/threading/backtrace_node.rb
@@ -344,8 +410,8 @@ files:
344
410
  - lib/new_relic/agent/tracer.rb
345
411
  - lib/new_relic/agent/transaction.rb
346
412
  - lib/new_relic/agent/transaction/abstract_segment.rb
347
- - lib/new_relic/agent/transaction/attributes.rb
348
413
  - lib/new_relic/agent/transaction/datastore_segment.rb
414
+ - lib/new_relic/agent/transaction/distributed_tracer.rb
349
415
  - lib/new_relic/agent/transaction/distributed_tracing.rb
350
416
  - lib/new_relic/agent/transaction/external_request_segment.rb
351
417
  - lib/new_relic/agent/transaction/message_broker_segment.rb
@@ -355,6 +421,7 @@ files:
355
421
  - lib/new_relic/agent/transaction/synthetics_sample_buffer.rb
356
422
  - lib/new_relic/agent/transaction/trace.rb
357
423
  - lib/new_relic/agent/transaction/trace_builder.rb
424
+ - lib/new_relic/agent/transaction/trace_context.rb
358
425
  - lib/new_relic/agent/transaction/trace_node.rb
359
426
  - lib/new_relic/agent/transaction/tracing.rb
360
427
  - lib/new_relic/agent/transaction/transaction_sample_buffer.rb
@@ -383,6 +450,7 @@ files:
383
450
  - lib/new_relic/cli/commands/install.rb
384
451
  - lib/new_relic/coerce.rb
385
452
  - lib/new_relic/collection_helper.rb
453
+ - lib/new_relic/constants.rb
386
454
  - lib/new_relic/control.rb
387
455
  - lib/new_relic/control/class_methods.rb
388
456
  - lib/new_relic/control/frameworks.rb
@@ -429,11 +497,6 @@ files:
429
497
  - lib/tasks/multiverse.rb
430
498
  - lib/tasks/newrelic.rb
431
499
  - lib/tasks/tests.rake
432
- - lib/tasks/versions.html.erb
433
- - lib/tasks/versions.postface.html
434
- - lib/tasks/versions.preface.html
435
- - lib/tasks/versions.rake
436
- - lib/tasks/versions.txt.erb
437
500
  - newrelic.yml
438
501
  - newrelic_rpm.gemspec
439
502
  - recipes/newrelic.rb
@@ -441,7 +504,11 @@ files:
441
504
  homepage: https://github.com/newrelic/rpm
442
505
  licenses:
443
506
  - New Relic
444
- metadata: {}
507
+ metadata:
508
+ bug_tracker_uri: https://support.newrelic.com/
509
+ changelog_uri: https://github.com/newrelic/rpm/blob/master/CHANGELOG.md
510
+ documentation_uri: https://docs.newrelic.com/docs/agents/ruby-agent
511
+ source_code_uri: https://github.com/newrelic/rpm
445
512
  post_install_message:
446
513
  rdoc_options: []
447
514
  require_paths:
@@ -457,7 +524,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
457
524
  - !ruby/object:Gem::Version
458
525
  version: 1.3.1
459
526
  requirements: []
460
- rubygems_version: 3.0.3
527
+ rubygems_version: 3.0.6
461
528
  signing_key:
462
529
  specification_version: 4
463
530
  summary: New Relic Ruby Agent
@@ -1,110 +0,0 @@
1
- # encoding: utf-8
2
- # This file is distributed under New Relic's license terms.
3
- # See https://github.com/newrelic/rpm/blob/master/LICENSE for complete details.
4
-
5
- require 'digest'
6
- require 'json'
7
-
8
- require 'new_relic/agent/inbound_request_monitor'
9
- require 'new_relic/agent/tracer'
10
- require 'new_relic/agent/threading/agent_thread'
11
- require 'new_relic/agent/cross_app_payload'
12
-
13
- module NewRelic
14
- module Agent
15
- class CrossAppMonitor < InboundRequestMonitor
16
-
17
- NEWRELIC_ID_HEADER = 'X-NewRelic-ID'.freeze
18
- NEWRELIC_TXN_HEADER = 'X-NewRelic-Transaction'.freeze
19
- NEWRELIC_APPDATA_HEADER = 'X-NewRelic-App-Data'.freeze
20
-
21
- NEWRELIC_ID_HEADER_KEY = 'HTTP_X_NEWRELIC_ID'.freeze
22
- NEWRELIC_TXN_HEADER_KEY = 'HTTP_X_NEWRELIC_TRANSACTION'.freeze
23
- CONTENT_LENGTH_HEADER_KEY = 'HTTP_CONTENT_LENGTH'.freeze
24
-
25
- def on_finished_configuring(events)
26
- register_event_listeners(events)
27
- end
28
-
29
- def path_hash(txn_name, seed)
30
- rotated = ((seed << 1) | (seed >> 31)) & 0xffffffff
31
- app_name = NewRelic::Agent.config.app_names.first
32
- identifier = "#{app_name};#{txn_name}"
33
- sprintf("%08x", rotated ^ hash_transaction_name(identifier))
34
- end
35
-
36
- private
37
-
38
- # Expected sequence of events:
39
- # :before_call will save our cross application request id to the thread
40
- # :after_call will write our response headers/metrics and clean up the thread
41
- def register_event_listeners(events)
42
- NewRelic::Agent.logger.
43
- debug("Wiring up Cross Application Tracing to events after finished configuring")
44
-
45
- events.subscribe(:before_call) do |env| #THREAD_LOCAL_ACCESS
46
- if id = decoded_id(env) and should_process_request?(id)
47
- state = NewRelic::Agent::Tracer.state
48
-
49
- if (transaction = state.current_transaction)
50
- transaction_info = referring_transaction_info(state, env)
51
-
52
- payload = CrossAppPayload.new(id, transaction, transaction_info)
53
- transaction.cross_app_payload = payload
54
- end
55
-
56
- CrossAppTracing.assign_intrinsic_transaction_attributes state
57
- end
58
- end
59
-
60
- events.subscribe(:after_call) do |env, (_status_code, headers, _body)| #THREAD_LOCAL_ACCESS
61
- state = NewRelic::Agent::Tracer.state
62
-
63
- insert_response_header(state, env, headers)
64
- end
65
- end
66
-
67
- def referring_transaction_info(state, request_headers)
68
- txn_header = request_headers[NEWRELIC_TXN_HEADER_KEY] or return
69
- deserialize_header(txn_header, NEWRELIC_TXN_HEADER)
70
- end
71
-
72
- def insert_response_header(state, request_headers, response_headers)
73
- txn = state.current_transaction
74
- unless txn.nil? || txn.cross_app_payload.nil?
75
- txn.freeze_name_and_execute_if_not_ignored do
76
- content_length = content_length_from_request(request_headers)
77
- set_response_headers(txn, response_headers, content_length)
78
- end
79
- end
80
- end
81
-
82
- def should_process_request? id
83
- CrossAppTracing.cross_app_enabled? && CrossAppTracing.trusts?(id)
84
- end
85
-
86
- def set_response_headers(transaction, response_headers, content_length)
87
- payload = obfuscator.obfuscate(
88
- ::JSON.dump(
89
- transaction.cross_app_payload.as_json_array(content_length)))
90
-
91
- response_headers[NEWRELIC_APPDATA_HEADER] = payload
92
- end
93
-
94
- def decoded_id(request)
95
- encoded_id = request[NEWRELIC_ID_HEADER_KEY]
96
- return "" if encoded_id.nil? || encoded_id.empty?
97
-
98
- obfuscator.deobfuscate(encoded_id)
99
- end
100
-
101
- def content_length_from_request(request)
102
- request[CONTENT_LENGTH_HEADER_KEY] || -1
103
- end
104
-
105
- def hash_transaction_name(identifier)
106
- Digest::MD5.digest(identifier).unpack("@12N").first & 0xffffffff
107
- end
108
- end
109
- end
110
- end
@@ -1,40 +0,0 @@
1
- # encoding: utf-8
2
- # This file is distributed under New Relic's license terms.
3
- # See https://github.com/newrelic/rpm/blob/master/LICENSE for complete details.
4
-
5
- require 'new_relic/agent/inbound_request_monitor'
6
- require 'new_relic/agent/cross_app_tracing'
7
-
8
- module NewRelic
9
- module Agent
10
- class DistributedTraceMonitor < InboundRequestMonitor
11
- def on_finished_configuring(events)
12
- return unless NewRelic::Agent.config[:'distributed_tracing.enabled']
13
- events.subscribe(:before_call, &method(:on_before_call))
14
- end
15
-
16
- NEWRELIC_TRACE_KEY = 'HTTP_NEWRELIC'
17
-
18
- def on_before_call(request)
19
- return unless NewRelic::Agent.config[:'distributed_tracing.enabled']
20
- return unless payload = request[NEWRELIC_TRACE_KEY]
21
- return unless txn = Tracer.current_transaction
22
-
23
- if txn.accept_distributed_trace_payload payload
24
- txn.distributed_trace_payload.caller_transport_type = transport_type(request)
25
- end
26
- end
27
-
28
- URL_SCHEMES = {
29
- 'http' => 'HTTP'.freeze,
30
- 'https' => 'HTTPS'.freeze
31
- }
32
-
33
- RACK_URL_SCHEME = 'rack.url_scheme'.freeze
34
-
35
- def transport_type(request)
36
- URL_SCHEMES[request[RACK_URL_SCHEME]]
37
- end
38
- end
39
- end
40
- end