elastic-apm 2.10.0 → 2.10.1

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: eb99c67f61f3f3bc30f7fb7bc64accea3725295db3d7bf90c18f2ce33d183e1f
4
- data.tar.gz: 1a45da759179fa4b284a14b580f9f318fe27d4d4ba60fc87d5360acbf1e5ab94
3
+ metadata.gz: 2dbd55033ad5acde5c178afb8af7e3c49aea9e64391901ddd571e6eb4a5db139
4
+ data.tar.gz: 0c117a6853b5e54af3f1ad2b42e0ff99e4d061c95da66a89ee35f525b7d11fd0
5
5
  SHA512:
6
- metadata.gz: 731f900b1466cf7f017fbdf747c969e7748cb9fdedf4f9a2dd748d5dbf7da31a3ce96a249ecab002bf62c9961e9c9336b983f570f51775f352b8dba43f5a04cb
7
- data.tar.gz: 52518d1fe04e4def36990303cee09643580dee8313ae2809f4e7f68fbc6783ba6028459987c291f153e29a5181ec3a289409d5bcc5fb138fbfae242b4f07747d
6
+ metadata.gz: 4e5a48afa71841e62e52917e71d6201b68d4b7d36636b93e5b0076999e5a6b13a31f6dac0f39501245122d143497648dafef50fa02a15a30dc767482b4a1181d
7
+ data.tar.gz: 671f26c821de9e4090aef5f1af8855729d86f4b3b1ef824d3f5114231e9ecb34ef2e1aa81cb9b84ffcfab7a307418bf95a90df4e034075c5d9bc56798344b31c
@@ -56,6 +56,13 @@ pipeline {
56
56
  }
57
57
  stage('Sanity checks') {
58
58
  agent { label 'linux && immutable && docker' }
59
+ when {
60
+ beforeAgent true
61
+ anyOf {
62
+ not { changeRequest() }
63
+ expression { return params.Run_As_Master_Branch }
64
+ }
65
+ }
59
66
  options { skipDefaultCheckout() }
60
67
  environment {
61
68
  HOME = "${env.WORKSPACE}"
@@ -0,0 +1,38 @@
1
+ ---
2
+ - job:
3
+ name: apm-agent-ruby/apm-agent-ruby-linting-mbp
4
+ display-name: APM Agent Ruby Linting
5
+ description: APM Agent Ruby Linting
6
+ script-path: .ci/linting.groovy
7
+ scm:
8
+ - github:
9
+ branch-discovery: no-pr
10
+ discover-pr-forks-strategy: merge-current
11
+ discover-pr-forks-trust: permission
12
+ discover-pr-origin: merge-current
13
+ discover-tags: false
14
+ notification-context: 'apm-ci/linting'
15
+ head-filter-regex: '^PR-.*$'
16
+ repo: apm-agent-ruby
17
+ repo-owner: elastic
18
+ credentials-id: 2a9602aa-ab9f-4e52-baf3-b71ca88469c7-UserAndToken
19
+ ssh-checkout:
20
+ credentials: f6c7695a-671e-4f4f-a331-acdce44ff9ba
21
+ build-strategies:
22
+ - change-request:
23
+ ignore-target-only-changes: false
24
+ clean:
25
+ after: true
26
+ before: true
27
+ prune: true
28
+ shallow-clone: true
29
+ depth: 3
30
+ do-not-fetch-tags: true
31
+ submodule:
32
+ disable: false
33
+ recursive: true
34
+ parent-credentials: true
35
+ timeout: 100
36
+ timeout: '15'
37
+ use-author: true
38
+ wipe-workspace: 'True'
@@ -11,6 +11,7 @@
11
11
  discover-pr-forks-trust: permission
12
12
  discover-pr-origin: merge-current
13
13
  discover-tags: true
14
+ notification-context: 'apm-ci'
14
15
  repo: apm-agent-ruby
15
16
  repo-owner: elastic
16
17
  credentials-id: 2a9602aa-ab9f-4e52-baf3-b71ca88469c7-UserAndToken
@@ -0,0 +1,32 @@
1
+ #!/usr/bin/env groovy
2
+ @Library('apm@current') _
3
+
4
+ pipeline {
5
+ agent { label 'docker && linux && immutable' }
6
+ options {
7
+ buildDiscarder(logRotator(numToKeepStr: '20', artifactNumToKeepStr: '20', daysToKeepStr: '30'))
8
+ timestamps()
9
+ ansiColor('xterm')
10
+ disableResume()
11
+ durabilityHint('PERFORMANCE_OPTIMIZED')
12
+ rateLimitBuilds(throttle: [count: 60, durationName: 'hour', userBoost: true])
13
+ quietPeriod(10)
14
+ }
15
+ triggers {
16
+ issueCommentTrigger('(?i).*(?:jenkins\\W+)?run\\W+(?:the\\W+)?linters(?:\\W+please)?.*')
17
+ }
18
+ stages {
19
+ stage('Sanity checks') {
20
+ environment {
21
+ HOME = "${env.WORKSPACE}"
22
+ PATH = "${env.WORKSPACE}/bin:${env.PATH}"
23
+ }
24
+ steps {
25
+ script {
26
+ def sha = getGitCommitSha()
27
+ preCommit(commit: "${sha}", junit: true)
28
+ }
29
+ }
30
+ }
31
+ }
32
+ }
@@ -4,10 +4,18 @@ All notable changes to this project will be documented in this file.
4
4
 
5
5
  This project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
6
6
 
7
+ ## 2.10.1
8
+
9
+ ### Fixed
10
+
11
+ - Fixed loading options from a config file specified by `ELASTIC_APM_CONFIG_FILE` ([#518](https://github.com/elastic/apm-agent-ruby/pull/518))
12
+ - Fixed an issue with CentralConfig polling not starting ([#525](https://github.com/elastic/apm-agent-ruby/pull/525))
13
+
7
14
  ## 2.10.0
8
15
 
9
16
  ### Added
10
17
 
18
+ - Support for chained exceptions ([#488](https://github.com/elastic/apm-agent-ruby/pull/488))
11
19
  - Add Ruby specific metrics ([#437](https://github.com/elastic/apm-agent-ruby/pull/437))
12
20
  - Support for APM Agent Configuration via Kibana ([#464](https://github.com/elastic/apm-agent-ruby/pull/464))
13
21
  - Change span name format and add command to context's db.statement for `MongoSpy` ([#488](https://github.com/elastic/apm-agent-ruby/pull/490))
@@ -79,8 +79,16 @@ module ElasticAPM
79
79
  end
80
80
  # rubocop:enable Metrics/MethodLength
81
81
 
82
- attr_reader :config, :transport, :instrumenter,
83
- :stacktrace_builder, :context_builder, :error_builder, :metrics
82
+ attr_reader(
83
+ :central_config,
84
+ :config,
85
+ :context_builder,
86
+ :error_builder,
87
+ :instrumenter,
88
+ :metrics,
89
+ :stacktrace_builder,
90
+ :transport
91
+ )
84
92
 
85
93
  # rubocop:disable Metrics/AbcSize, Metrics/MethodLength
86
94
  def start
@@ -88,6 +96,7 @@ module ElasticAPM
88
96
  info '[%s] Starting agent, reporting to %s', VERSION, config.server_url
89
97
  end
90
98
 
99
+ central_config.start
91
100
  transport.start
92
101
  instrumenter.start
93
102
  metrics.start
@@ -104,6 +113,7 @@ module ElasticAPM
104
113
  def stop
105
114
  debug 'Stopping agent'
106
115
 
116
+ central_config.stop
107
117
  metrics.stop
108
118
  instrumenter.stop
109
119
  transport.stop
@@ -30,9 +30,9 @@ module ElasticAPM
30
30
  ].freeze
31
31
 
32
32
  # rubocop:disable Metrics/LineLength, Layout/ExtraSpacing
33
- option :config_file, default: 'config/elastic_apm.yml'
34
- option :server_url, default: 'http://localhost:8200'
35
- option :secret_token
33
+ option :config_file, type: :string, default: 'config/elastic_apm.yml'
34
+ option :server_url, type: :string, default: 'http://localhost:8200'
35
+ option :secret_token, type: :string
36
36
 
37
37
  option :active, type: :bool, default: true
38
38
  option :api_buffer_size, type: :int, default: 256
@@ -83,14 +83,23 @@ module ElasticAPM
83
83
  option :verify_server_cert, type: :bool, default: true
84
84
  # rubocop:enable Metrics/LineLength, Layout/ExtraSpacing
85
85
 
86
+ # rubocop:disable Metrics/MethodLength
86
87
  def initialize(options = {})
87
88
  @options = load_schema
88
89
 
89
90
  custom_logger = options.delete(:logger)
90
91
 
91
92
  assign(options)
93
+
94
+ # Pick out config_file specifically as we need it now to load it,
95
+ # but still need the other env vars to have precedence
96
+ env = load_env
97
+ if (env_config_file = env.delete(:config_file))
98
+ self.config_file = env_config_file
99
+ end
100
+
92
101
  assign(load_config_file)
93
- assign(load_env)
102
+ assign(env)
94
103
 
95
104
  yield self if block_given?
96
105
 
@@ -99,6 +108,7 @@ module ElasticAPM
99
108
  @__view_paths = []
100
109
  @__root_path = Dir.pwd
101
110
  end
111
+ # rubocop:enable Metrics/MethodLength
102
112
 
103
113
  attr_accessor :__view_paths, :__root_path
104
114
  attr_accessor :logger
@@ -205,8 +215,9 @@ module ElasticAPM
205
215
  def load_config_file
206
216
  return unless File.exist?(config_file)
207
217
 
208
- config = YAML.safe_load(ERB.new(File.read(config_file)).result)
209
- assign(config)
218
+ read = File.read(config_file)
219
+ evaled = ERB.new(read).result
220
+ YAML.safe_load(evaled)
210
221
  end
211
222
 
212
223
  def load_env
@@ -11,6 +11,7 @@ module ElasticAPM
11
11
  "#{exception.class}: #{exception.message}"
12
12
  @type = exception.class.to_s
13
13
  @module = format_module exception
14
+ @cause = exception.cause && Exception.new(exception.cause)
14
15
 
15
16
  attrs.each do |key, val|
16
17
  send(:"#{key}=", val)
@@ -24,7 +25,8 @@ module ElasticAPM
24
25
  :message,
25
26
  :module,
26
27
  :stacktrace,
27
- :type
28
+ :type,
29
+ :cause
28
30
  )
29
31
 
30
32
  private
@@ -7,6 +7,7 @@ module ElasticAPM
7
7
  include Logging
8
8
 
9
9
  def initialize(config)
10
+ @config = config
10
11
  @total_time = 0
11
12
  @disabled = false
12
13
  end
@@ -15,6 +16,7 @@ module ElasticAPM
15
16
  attr_writer :disabled
16
17
 
17
18
  # rubocop:disable Metrics/MethodLength, Metrics/AbcSize
19
+ # rubocop:disable Metrics/CyclomaticComplexity
18
20
  def collect
19
21
  return if disabled?
20
22
 
@@ -47,6 +49,7 @@ module ElasticAPM
47
49
  @disabled = true
48
50
  nil
49
51
  end
52
+ # rubocop:enable Metrics/CyclomaticComplexity
50
53
  # rubocop:enable Metrics/MethodLength, Metrics/AbcSize
51
54
 
52
55
  def disabled?
@@ -48,7 +48,8 @@ module ElasticAPM
48
48
  code: keyword_field(exception.code),
49
49
  attributes: exception.attributes,
50
50
  stacktrace: exception.stacktrace.to_a,
51
- handled: exception.handled
51
+ handled: exception.handled,
52
+ cause: exception.cause && [build_exception(exception.cause)]
52
53
  }
53
54
  end
54
55
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ElasticAPM
4
- VERSION = '2.10.0'
4
+ VERSION = '2.10.1'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: elastic-apm
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.10.0
4
+ version: 2.10.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mikkel Malmberg
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-09-03 00:00:00.000000000 Z
11
+ date: 2019-09-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: concurrent-ruby
@@ -54,9 +54,11 @@ files:
54
54
  - ".ci/bin/check_paths_for_matches.py"
55
55
  - ".ci/downstreamTests.groovy"
56
56
  - ".ci/jobs/apm-agent-ruby-downstream.yml"
57
+ - ".ci/jobs/apm-agent-ruby-linting-mbp.yml"
57
58
  - ".ci/jobs/apm-agent-ruby-mbp.yml"
58
59
  - ".ci/jobs/apm-agent-ruby.yml"
59
60
  - ".ci/jobs/defaults.yml"
61
+ - ".ci/linting.groovy"
60
62
  - ".gitignore"
61
63
  - ".hound.yml"
62
64
  - ".pre-commit-config.yaml"
@@ -204,7 +206,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
204
206
  - !ruby/object:Gem::Version
205
207
  version: '0'
206
208
  requirements: []
207
- rubygems_version: 3.0.3
209
+ rubygems_version: 3.0.6
208
210
  signing_key:
209
211
  specification_version: 4
210
212
  summary: The official Elastic APM agent for Ruby