newrelic-manticore 0.1.1.rc2-java → 1.0.2.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: a90206bab165ef353e02a1584fce0aff9c3194737eb25e4add978320da5cbe65
4
- data.tar.gz: 2d8fde246e4b9269e310910e4a2a25ba68b8a3f66b2039bb5ba000a4efd0743c
3
+ metadata.gz: d77184dc9fb0c21ddad6ff2cb8613ebf3efb3bf93d046310baa4c00c0a42d622
4
+ data.tar.gz: 24f5e9f7db817215d3a0351e024b911cf36aac842c5f24ac58f463477e87aef1
5
5
  SHA512:
6
- metadata.gz: a61432c09b74eb8828ce728d3e21c83f2b79b965a9c468f9ad29836235f65e517900e217ad46fdc1f62c57821b2805f5a8a6c17ec60fac690e2f7c985bfac1a8
7
- data.tar.gz: 8df4a94cccf09d2129c6646f9c856a98dba70288a7cbeada550be95f5681e52793577ad627c31747b6cda7a2e78535ca199a1f6426f8acbbb87c42783ff40af5
6
+ metadata.gz: 97e9ed46cadce46c053a7fee2a8c1c07520f1d8bec1bc77ee7a8e5849649d79052e4170321aa590398c9cd3de7a96c6d7987ec3635c3e9f4c850a3fa4a805c6c
7
+ data.tar.gz: b1b585e82f45d0f19e6ef15fcddd7469c6c2a9c601717622a7c67456ecef92e39936b04cbc7aee0d2f5e3d3d30d5a11c5e18c8bf462c3cdf70c1c37038cbd774
@@ -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,10 +4,31 @@ 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
+ ### Changed
9
+ - Require ruby > 2.0.0
10
+
11
+ ### Fixed
12
+ - Added manticore as dependency
13
+
14
+ ## [1.0.1] - 2020-04-30
15
+ ### Added
16
+ - Compatibility with agent versions ~> 6.10
17
+
18
+ ## [1.0.0] - 2019-03-12
19
+ ### Changed
20
+ - Update newrelic agent dependency to major version 6.
21
+ - Replace deprecated calls to internal agent API.
22
+
23
+ ## [0.1.2] - 2018-10-11
24
+ ### Fixed
25
+ Detection whether manticore is used inside a database segment was not reliable and is now more robust
26
+
7
27
  ## [0.1.1] - 2018-10-09
8
28
  ### Fixed
9
- Time spent inside Manticore requests inside database calls where not included in the exclusive time stats of the database request
29
+ - Time spent inside Manticore requests inside database calls where not included in the exclusive time stats of the database request.
30
+ - Fixed instrumentation when using manticore with faraday adapter.
10
31
 
11
32
  ## [0.1.0] - 2018-10-09
12
33
  ### Added
13
- Basic manticore instrumentation
34
+ - Basic manticore instrumentation.
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,14 +18,13 @@ module NewRelic
19
18
  # operation
20
19
  def self.create_segment?
21
20
  state = NewRelic::Agent::TransactionState.tl_get
22
- return false unless state && state.current_transaction
21
+ return false unless state&.current_transaction
23
22
 
24
- existing_segments = state.current_transaction.segments
23
+ return true unless state.current_transaction.current_segment
25
24
 
26
- existing_segments.empty? ||
27
- !existing_segments.last.is_a?(
28
- ::NewRelic::Agent::Transaction::DatastoreSegment
29
- )
25
+ !state.current_transaction.current_segment.is_a?(
26
+ ::NewRelic::Agent::Transaction::DatastoreSegment
27
+ )
30
28
  end
31
29
 
32
30
  # rubocop:disable Metrics/BlockLength
@@ -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)
@@ -81,7 +79,6 @@ module NewRelic
81
79
  def call_with_newrelic_trace
82
80
  if NewRelic::Manticore.create_segment?
83
81
  segment = create_newrelic_segment
84
-
85
82
  segment.add_request_headers(WrappedRequest.new(@request))
86
83
  on_complete do |response|
87
84
  begin
@@ -102,9 +99,9 @@ module NewRelic
102
99
  alias_method :call, :call_with_newrelic_trace
103
100
 
104
101
  def create_newrelic_segment
105
- NewRelic::Agent::External.start_segment(
106
- library: "Manticore",
107
- uri: @request.uri.to_s,
102
+ NewRelic::Agent::Tracer.start_external_request_segment(
103
+ library: "Manticore",
104
+ uri: @request.uri.to_s,
108
105
  procedure: @request.method
109
106
  ).tap do |segment|
110
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.1.rc2".freeze
5
+ VERSION = "1.0.2.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.1.rc2
4
+ version: 1.0.2.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-11 00:00:00.000000000 Z
12
+ date: 2020-08-26 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
19
+ version: '0.6'
20
+ - - ">="
21
+ - !ruby/object:Gem::Version
22
+ version: 0.6.4
23
+ name: manticore
21
24
  prerelease: false
22
25
  type: :runtime
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
35
41
  prerelease: false
36
- type: :development
42
+ type: :runtime
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
54
+ name: bundler
49
55
  prerelease: false
50
56
  type: :development
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,7 +65,7 @@ dependencies:
59
65
  - - "~>"
60
66
  - !ruby/object:Gem::Version
61
67
  version: '0'
62
- name: manticore
68
+ name: faraday
63
69
  prerelease: false
64
70
  type: :development
65
71
  version_requirements: !ruby/object:Gem::Requirement
@@ -100,7 +106,10 @@ 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
114
  prerelease: false
106
115
  type: :development
@@ -108,7 +117,10 @@ dependencies:
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:
@@ -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
210
  version: 1.3.1
198
211
  requirements: []
199
- rubyforge_project:
200
- rubygems_version: 2.7.6
212
+ rubygems_version: 3.1.2
201
213
  signing_key:
202
214
  specification_version: 4
203
215
  summary: Newrelic support for manticore