newrelic-manticore 0.1.2-java → 1.1.0.rc1-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: 384a5c873ddc6183ca9179c5b2060f408a3141666bef46a35f996bfc0349daff
4
- data.tar.gz: c9a3a04cb32931f85253933438f0740a3c499717cdbd50b587127945041283e9
3
+ metadata.gz: 992e45039a34ef8e4e8168c83e951345e5a559d920ed680c7c6c0374089b8670
4
+ data.tar.gz: 5cc926e4df4c6722bc7aef5dcd599aab455e369921421630280e6b68e48b934a
5
5
  SHA512:
6
- metadata.gz: de7ccebfc9d7c74c6074f3f661c3586cdadc419a0ca3901b4fe5ae5e896d5cc48759f8ec2ee46ace4833beb9be351aab18952d401e2a69940a3999f877a9c5fb
7
- data.tar.gz: fdc1a23c186692fbabc731902f4e84444022d62d7a4da55f30b7183798c8613f72c1607185f12e5ba5720756ea33f23e21e9cc0bda26a0a014c5e6b5249cbc11
6
+ metadata.gz: 88325bcca1f71ad112af0be285426abc95298bcd1972155569b15e3f824a66be120e9725c8fffc2d1a22265808121ff4d1e8d2de92f71dfaed5234e362776bc3
7
+ data.tar.gz: fe8ce0b4badf517d3127a28cdbc3d305da41b1cd13e45d95967b0b97a16f24bf77ca2349b5a3287ae0e720ea68d542bc60a9a067e24169b16cdafa91c8c8774f
@@ -1,7 +1,7 @@
1
1
  require: rt_rubocop_defaults
2
2
 
3
3
  AllCops:
4
- TargetRubyVersion: 2.2
4
+ TargetRubyVersion: 2.4
5
5
 
6
6
  Metrics/BlockLength:
7
7
  Exclude:
@@ -10,3 +10,6 @@ Metrics/BlockLength:
10
10
  Metrics/ClassLength:
11
11
  Exclude:
12
12
  - test/**/*
13
+
14
+ Gemspec/RequiredRubyVersion:
15
+ Enabled: false
@@ -1,6 +1,5 @@
1
1
  language: ruby
2
2
  rvm:
3
- - jruby-9.1.17.0 # ruby 2.3
4
3
  - jruby-9.2.0.0 # ruby 2.5
5
4
  jobs:
6
5
  include:
@@ -0,0 +1,69 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ In the interest of fostering an open and welcoming environment, we as
6
+ contributors and maintainers pledge to making participation in our project and
7
+ our community a harassment-free experience for everyone, regardless of age, body
8
+ size, disability, ethnicity, sex characteristics, gender identity and expression,
9
+ level of experience, education, socio-economic status, nationality, personal
10
+ appearance, race, religion, or sexual identity and orientation.
11
+
12
+ ## Our Standards
13
+
14
+ Examples of behavior that contributes to creating a positive environment
15
+ include:
16
+
17
+ * Using welcoming and inclusive language
18
+ * Being respectful of differing viewpoints and experiences
19
+ * Gracefully accepting constructive criticism
20
+ * Focusing on what is best for the community
21
+ * Showing empathy towards other community members
22
+
23
+ Examples of unacceptable behavior by participants include:
24
+
25
+ * The use of sexualized language or imagery and unwelcome sexual attention or
26
+ advances
27
+ * Trolling, insulting/derogatory comments, and personal or political attacks
28
+ * Public or private harassment
29
+ * Publishing others' private information, such as a physical or electronic
30
+ address, without explicit permission
31
+ * Other conduct which could reasonably be considered inappropriate in a
32
+ professional setting
33
+
34
+ ## Our Responsibilities
35
+
36
+ Project maintainers are responsible for clarifying the standards of acceptable
37
+ behavior and are expected to take appropriate and fair corrective action in
38
+ response to any instances of unacceptable behavior.
39
+
40
+ Project maintainers have the right and responsibility to remove, edit, or
41
+ reject comments, commits, code, wiki edits, issues, and other contributions
42
+ that are not aligned to this Code of Conduct, or to ban temporarily or
43
+ permanently any contributor for other behaviors that they deem inappropriate,
44
+ threatening, offensive, or harmful.
45
+
46
+ ## Scope
47
+
48
+ This Code of Conduct applies both within project spaces and in public spaces
49
+ when an individual is representing the project or its community. Examples of
50
+ representing a project or community include using an official project e-mail
51
+ address, posting via an official social media account, or acting as an appointed
52
+ representative at an online or offline event. Representation of a project may be
53
+ further defined and clarified by project maintainers.
54
+
55
+ ## Enforcement
56
+
57
+ Project maintainers who do not follow or enforce the Code of Conduct in good
58
+ faith may face temporary or permanent repercussions as determined by other
59
+ members of the project's leadership.
60
+
61
+ ## Attribution
62
+
63
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
64
+ available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
65
+
66
+ [homepage]: https://www.contributor-covenant.org
67
+
68
+ For answers to common questions about this code of conduct, see
69
+ https://www.contributor-covenant.org/faq
@@ -4,6 +4,25 @@ All notable changes to this project will be documented in this file.
4
4
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
5
5
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
6
 
7
+ ## Unreleased
8
+ ### Added
9
+ - Record response status on external request span
10
+
11
+ ### Changed
12
+ - Require ruby > 2.0.0
13
+
14
+ ### Fixed
15
+ - Added manticore as dependency
16
+
17
+ ## [1.0.1] - 2020-04-30
18
+ ### Added
19
+ - Compatibility with agent versions ~> 6.10
20
+
21
+ ## [1.0.0] - 2019-03-12
22
+ ### Changed
23
+ - Update newrelic agent dependency to major version 6.
24
+ - Replace deprecated calls to internal agent API.
25
+
7
26
  ## [0.1.2] - 2018-10-11
8
27
  ### Fixed
9
28
  Detection whether manticore is used inside a database segment was not reliable and is now more robust
data/README.md CHANGED
@@ -1,33 +1,54 @@
1
- [travis]: https://travis-ci.org/runtastic/newrelic-manticore
2
- [rubygems]: https://rubygems.org/gems/newrelic-manticore
3
- [manticore]: https://gitlab.com/cheald/manticore
4
- [mit]: http://opensource.org/licenses/MIT
5
- [cc]: http://contributor-covenant.org
6
-
7
- # NewrelicManticore
1
+ # Newrelic-Manticore
8
2
 
9
- [![Build Status](https://travis-ci.org/runtastic/newrelic-manticore.svg?branch=master)][travis] [![Gem Version](https://badge.fury.io/rb/newrelic-manticore.svg)][rubygems]
3
+ [![Build Status](https://travis-ci.org/runtastic/newrelic-manticore.svg?branch=master)][travis]
4
+ [![Gem Version](https://badge.fury.io/rb/newrelic-manticore.svg)][rubygems]
10
5
 
11
6
  Adds NewRelic instrumentation for the [Manticore JRuby HTTP client][manticore].
12
7
 
13
8
  ## Installation
14
9
  Add this line to your application's Gemfile:
15
10
 
16
- `$ gem 'newrelic-manticore'`
11
+ ```ruby
12
+ gem 'newrelic-manticore'
13
+ ```
17
14
 
18
15
  And then execute:
19
16
 
20
- `$ bundle`
17
+ $ bundle
18
+
19
+ Or install it yourself as:
20
+
21
+ $ gem install newrelic-manticore
22
+
23
+ ## Usage
21
24
 
22
- ## How it works
23
25
  When `newrelic/manticore` is required (e.g. automatically by Bundler), the gem becomes active.
24
- It hooks itself into `Manticore::Client#request` and traces your HTTP calls as external requests,
26
+ It wraps `Manticore::Response#call` and traces your HTTP calls as external requests,
25
27
  adding also the necessary headers for cross application tracing.
26
28
 
29
+ ### What about parallel requests?
30
+ The NewRelic agent is currently not set up to support multithreaded requests. As [any of the other client integrations](https://docs.newrelic.com/docs/agents/ruby-agent/features/http-client-tracing-ruby#typhoeus),
31
+ _newrelic-manticore_ will trace all parallel requests as [one external service call](https://github.com/runtastic/newrelic-manticore/blob/master/test/new_relic/manticore/instrumentation_test.rb#L50).
32
+
33
+ ### What about async "background" requests?
34
+ Those are traced normally as any other request would be.
35
+
36
+ ## Development
37
+
38
+ After checking out the repo, run `bin/setup` to install dependencies. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
39
+
40
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
41
+
27
42
  ## Contributing
28
43
  Bug reports and pull requests are welcome on GitHub at https://github.com/runtastic/newrelic-manticore.
29
- This project is intended to be a safe, welcoming space for collaboration, and contributors are expected
30
- to adhere to the [Contributor Covenant code of conduct][cc].
44
+ This project is intended to be a safe, welcoming space for collaboration, and
45
+ contributors are expected to adhere to the [code of conduct][cc].
31
46
 
32
47
  ## License
33
48
  The gem is available as open source under [the terms of the MIT License][mit].
49
+
50
+ [travis]: https://travis-ci.org/runtastic/newrelic-manticore
51
+ [rubygems]: https://rubygems.org/gems/newrelic-manticore
52
+ [manticore]: https://gitlab.com/cheald/manticore
53
+ [mit]: http://opensource.org/licenses/MIT
54
+ [cc]: ../CODE_OF_CONDUCT.md
@@ -3,7 +3,6 @@
3
3
  require "ostruct"
4
4
 
5
5
  require "new_relic/agent/method_tracer"
6
- require "new_relic/agent/http_clients/abstract_request"
7
6
 
8
7
  require "new_relic/manticore/wrapped_request"
9
8
  require "new_relic/manticore/wrapped_response"
@@ -19,8 +18,7 @@ module NewRelic
19
18
  # operation
20
19
  def self.create_segment?
21
20
  state = NewRelic::Agent::TransactionState.tl_get
22
- return false unless state &&
23
- state.current_transaction
21
+ return false unless state&.current_transaction
24
22
 
25
23
  return true unless state.current_transaction.current_segment
26
24
 
@@ -57,8 +55,8 @@ module NewRelic
57
55
  def execute_with_newrelic_trace!
58
56
  if NewRelic::Manticore.create_segment?
59
57
  segment = NewRelic::Agent::External.start_segment(
60
- library: "Manticore",
61
- uri: @async_requests.first.request.uri.to_s,
58
+ library: "Manticore",
59
+ uri: @async_requests.first.request.uri.to_s,
62
60
  procedure: "Parallel batch"
63
61
  )
64
62
  segment.add_request_headers(PARALLEL_REQUEST_DUMMY)
@@ -84,7 +82,7 @@ module NewRelic
84
82
  segment.add_request_headers(WrappedRequest.new(@request))
85
83
  on_complete do |response|
86
84
  begin
87
- segment.read_response_headers(WrappedResponse.new(response))
85
+ segment.process_response_headers(WrappedResponse.new(response))
88
86
  ensure
89
87
  segment.finish
90
88
  end
@@ -101,9 +99,9 @@ module NewRelic
101
99
  alias_method :call, :call_with_newrelic_trace
102
100
 
103
101
  def create_newrelic_segment
104
- NewRelic::Agent::External.start_segment(
105
- library: "Manticore",
106
- uri: @request.uri.to_s,
102
+ NewRelic::Agent::Tracer.start_external_request_segment(
103
+ library: "Manticore",
104
+ uri: @request.uri.to_s,
107
105
  procedure: @request.method
108
106
  ).tap do |segment|
109
107
  segment.record_metrics = false if segment.parent.is_a?(::NewRelic::Agent::Transaction::DatastoreSegment)
@@ -1,3 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Check version to account for a breaking path change
4
+ # introduced in 6.10
5
+ #
6
+ if NewRelic::VERSION::MAJOR == 6 && NewRelic::VERSION::MINOR < 10
7
+ require "new_relic/agent/http_clients/abstract_request"
8
+ else
9
+ require "new_relic/agent/http_clients/abstract"
10
+ end
11
+
1
12
  module NewRelic
2
13
  module Manticore
3
14
  class WrappedRequest < Agent::HTTPClients::AbstractRequest
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module NewRelic
2
4
  module Manticore
3
5
  class WrappedResponse
@@ -1,2 +1,4 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # Necessary for bundler auto require (as gem name does not match namespace)
2
4
  require "new_relic/manticore"
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Newrelic
4
4
  module Manticore
5
- VERSION = "0.1.2".freeze
5
+ VERSION = "1.1.0.rc1"
6
6
  end
7
7
  end
@@ -27,14 +27,16 @@ Gem::Specification.new do |gem|
27
27
  gem.executables = gem.files.grep(%r{^exe/}) { |f| File.basename(f) }
28
28
  gem.require_paths = ["lib"]
29
29
 
30
- gem.add_runtime_dependency "newrelic_rpm", "~> 5"
30
+ gem.required_ruby_version = ">= 2.0.0"
31
31
 
32
- gem.add_development_dependency "bundler", "~> 1.13"
32
+ gem.add_runtime_dependency "manticore", "~> 0.6", ">= 0.6.4"
33
+ gem.add_runtime_dependency "newrelic_rpm", "~> 6"
34
+
35
+ gem.add_development_dependency "bundler"
33
36
  gem.add_development_dependency "faraday", "~> 0"
34
- gem.add_development_dependency "manticore", "~> 0"
35
37
  gem.add_development_dependency "minitest"
36
38
  gem.add_development_dependency "pry"
37
- gem.add_development_dependency "rake", "~> 10.0"
39
+ gem.add_development_dependency "rake", "~> 12.3", ">= 12.3.3"
38
40
  gem.add_development_dependency "rspec", "~> 3.0"
39
41
  gem.add_development_dependency "rt_rubocop_defaults", "~> 1"
40
42
  gem.add_development_dependency "rubocop_runner", "~> 2"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: newrelic-manticore
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 1.1.0.rc1
5
5
  platform: java
6
6
  authors:
7
7
  - Dominik Goltermann
@@ -9,48 +9,54 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2018-10-12 00:00:00.000000000 Z
12
+ date: 2020-08-27 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '5'
20
- name: newrelic_rpm
21
- prerelease: false
19
+ version: '0.6'
20
+ - - ">="
21
+ - !ruby/object:Gem::Version
22
+ version: 0.6.4
23
+ name: manticore
22
24
  type: :runtime
25
+ prerelease: false
23
26
  version_requirements: !ruby/object:Gem::Requirement
24
27
  requirements:
25
28
  - - "~>"
26
29
  - !ruby/object:Gem::Version
27
- version: '5'
30
+ version: '0.6'
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: 0.6.4
28
34
  - !ruby/object:Gem::Dependency
29
35
  requirement: !ruby/object:Gem::Requirement
30
36
  requirements:
31
37
  - - "~>"
32
38
  - !ruby/object:Gem::Version
33
- version: '1.13'
34
- name: bundler
39
+ version: '6'
40
+ name: newrelic_rpm
41
+ type: :runtime
35
42
  prerelease: false
36
- type: :development
37
43
  version_requirements: !ruby/object:Gem::Requirement
38
44
  requirements:
39
45
  - - "~>"
40
46
  - !ruby/object:Gem::Version
41
- version: '1.13'
47
+ version: '6'
42
48
  - !ruby/object:Gem::Dependency
43
49
  requirement: !ruby/object:Gem::Requirement
44
50
  requirements:
45
- - - "~>"
51
+ - - ">="
46
52
  - !ruby/object:Gem::Version
47
53
  version: '0'
48
- name: faraday
49
- prerelease: false
54
+ name: bundler
50
55
  type: :development
56
+ prerelease: false
51
57
  version_requirements: !ruby/object:Gem::Requirement
52
58
  requirements:
53
- - - "~>"
59
+ - - ">="
54
60
  - !ruby/object:Gem::Version
55
61
  version: '0'
56
62
  - !ruby/object:Gem::Dependency
@@ -59,9 +65,9 @@ dependencies:
59
65
  - - "~>"
60
66
  - !ruby/object:Gem::Version
61
67
  version: '0'
62
- name: manticore
63
- prerelease: false
68
+ name: faraday
64
69
  type: :development
70
+ prerelease: false
65
71
  version_requirements: !ruby/object:Gem::Requirement
66
72
  requirements:
67
73
  - - "~>"
@@ -74,8 +80,8 @@ dependencies:
74
80
  - !ruby/object:Gem::Version
75
81
  version: '0'
76
82
  name: minitest
77
- prerelease: false
78
83
  type: :development
84
+ prerelease: false
79
85
  version_requirements: !ruby/object:Gem::Requirement
80
86
  requirements:
81
87
  - - ">="
@@ -88,8 +94,8 @@ dependencies:
88
94
  - !ruby/object:Gem::Version
89
95
  version: '0'
90
96
  name: pry
91
- prerelease: false
92
97
  type: :development
98
+ prerelease: false
93
99
  version_requirements: !ruby/object:Gem::Requirement
94
100
  requirements:
95
101
  - - ">="
@@ -100,15 +106,21 @@ dependencies:
100
106
  requirements:
101
107
  - - "~>"
102
108
  - !ruby/object:Gem::Version
103
- version: '10.0'
109
+ version: '12.3'
110
+ - - ">="
111
+ - !ruby/object:Gem::Version
112
+ version: 12.3.3
104
113
  name: rake
105
- prerelease: false
106
114
  type: :development
115
+ prerelease: false
107
116
  version_requirements: !ruby/object:Gem::Requirement
108
117
  requirements:
109
118
  - - "~>"
110
119
  - !ruby/object:Gem::Version
111
- version: '10.0'
120
+ version: '12.3'
121
+ - - ">="
122
+ - !ruby/object:Gem::Version
123
+ version: 12.3.3
112
124
  - !ruby/object:Gem::Dependency
113
125
  requirement: !ruby/object:Gem::Requirement
114
126
  requirements:
@@ -116,8 +128,8 @@ dependencies:
116
128
  - !ruby/object:Gem::Version
117
129
  version: '3.0'
118
130
  name: rspec
119
- prerelease: false
120
131
  type: :development
132
+ prerelease: false
121
133
  version_requirements: !ruby/object:Gem::Requirement
122
134
  requirements:
123
135
  - - "~>"
@@ -130,8 +142,8 @@ dependencies:
130
142
  - !ruby/object:Gem::Version
131
143
  version: '1'
132
144
  name: rt_rubocop_defaults
133
- prerelease: false
134
145
  type: :development
146
+ prerelease: false
135
147
  version_requirements: !ruby/object:Gem::Requirement
136
148
  requirements:
137
149
  - - "~>"
@@ -144,8 +156,8 @@ dependencies:
144
156
  - !ruby/object:Gem::Version
145
157
  version: '2'
146
158
  name: rubocop_runner
147
- prerelease: false
148
159
  type: :development
160
+ prerelease: false
149
161
  version_requirements: !ruby/object:Gem::Requirement
150
162
  requirements:
151
163
  - - "~>"
@@ -163,6 +175,7 @@ files:
163
175
  - ".rspec"
164
176
  - ".rubocop.yml"
165
177
  - ".travis.yml"
178
+ - CODE_OF_CONDUCT.md
166
179
  - Changelog.md
167
180
  - Gemfile
168
181
  - LICENSE
@@ -189,15 +202,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
189
202
  requirements:
190
203
  - - ">="
191
204
  - !ruby/object:Gem::Version
192
- version: '0'
205
+ version: 2.0.0
193
206
  required_rubygems_version: !ruby/object:Gem::Requirement
194
207
  requirements:
195
- - - ">="
208
+ - - ">"
196
209
  - !ruby/object:Gem::Version
197
- version: '0'
210
+ version: 1.3.1
198
211
  requirements: []
199
- rubyforge_project:
200
- rubygems_version: 2.7.6
212
+ rubygems_version: 3.0.6
201
213
  signing_key:
202
214
  specification_version: 4
203
215
  summary: Newrelic support for manticore