elastic-apm 4.5.0 → 4.6.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (65) hide show
  1. checksums.yaml +4 -4
  2. data/.ci/.jenkins_exclude.yml +94 -37
  3. data/.ci/.jenkins_framework.yml +4 -3
  4. data/.ci/.jenkins_main_framework.yml +4 -0
  5. data/.ci/.jenkins_ruby.yml +1 -1
  6. data/.ci/.jenkins_ruby_benchmarks.yml +6 -0
  7. data/.ci/Jenkinsfile +46 -36
  8. data/.ci/docker/jruby/11-jdk/Dockerfile +8 -3
  9. data/.ci/docker/jruby/12-jdk/Dockerfile +5 -2
  10. data/.ci/docker/jruby/13-jdk/Dockerfile +5 -2
  11. data/.ci/docker/jruby/7-jdk/Dockerfile +6 -3
  12. data/.ci/docker/jruby/8-jdk/Dockerfile +8 -3
  13. data/.ci/docker/jruby/README.md +1 -1
  14. data/.ci/docker/jruby/run.sh +33 -9
  15. data/.ci/docker/jruby/test.sh +17 -2
  16. data/.ci/jobs/apm-agent-ruby-mbp.yml +1 -1
  17. data/.ci/snapshoty.yml +34 -0
  18. data/.ci/update-specs.yml +108 -0
  19. data/.github/PULL_REQUEST_TEMPLATE.md +5 -5
  20. data/.github/workflows/update-specs.yml +30 -0
  21. data/.pre-commit-config.yaml +2 -2
  22. data/CHANGELOG.asciidoc +55 -1
  23. data/CONTRIBUTING.md +3 -3
  24. data/Gemfile +15 -4
  25. data/README.md +1 -1
  26. data/Rakefile +4 -4
  27. data/bench/report.rb +1 -1
  28. data/docker-compose.yml +6 -0
  29. data/docs/api.asciidoc +2 -2
  30. data/docs/configuration.asciidoc +7 -5
  31. data/docs/introduction.asciidoc +3 -3
  32. data/docs/log-correlation.asciidoc +1 -1
  33. data/docs/upgrading.asciidoc +1 -1
  34. data/elastic-apm.gemspec +3 -2
  35. data/lib/elastic_apm/central_config.rb +5 -0
  36. data/lib/elastic_apm/config/server_info.rb +50 -0
  37. data/lib/elastic_apm/config.rb +25 -4
  38. data/lib/elastic_apm/error.rb +2 -1
  39. data/lib/elastic_apm/error_builder.rb +1 -0
  40. data/lib/elastic_apm/instrumenter.rb +4 -2
  41. data/lib/elastic_apm/metadata/system_info/container_info.rb +4 -3
  42. data/lib/elastic_apm/metadata/system_info.rb +1 -1
  43. data/lib/elastic_apm/metrics.rb +1 -4
  44. data/lib/elastic_apm/span/context/links.rb +32 -0
  45. data/lib/elastic_apm/span/context/service.rb +55 -0
  46. data/lib/elastic_apm/span/context.rb +19 -3
  47. data/lib/elastic_apm/span.rb +3 -0
  48. data/lib/elastic_apm/span_helpers.rb +2 -2
  49. data/lib/elastic_apm/spies/elasticsearch.rb +11 -1
  50. data/lib/elastic_apm/spies/faraday.rb +13 -4
  51. data/lib/elastic_apm/spies/mongo.rb +5 -12
  52. data/lib/elastic_apm/spies/racecar.rb +77 -0
  53. data/lib/elastic_apm/spies/redis.rb +1 -1
  54. data/lib/elastic_apm/spies/sequel.rb +9 -0
  55. data/lib/elastic_apm/spies/sns.rb +1 -1
  56. data/lib/elastic_apm/spies/sqs.rb +1 -0
  57. data/lib/elastic_apm/trace_context/tracestate.rb +4 -2
  58. data/lib/elastic_apm/trace_context.rb +1 -1
  59. data/lib/elastic_apm/transport/base.rb +1 -3
  60. data/lib/elastic_apm/transport/connection/http.rb +9 -3
  61. data/lib/elastic_apm/transport/serializers/span_serializer.rb +25 -0
  62. data/lib/elastic_apm/version.rb +1 -1
  63. data/lib/elastic_apm.rb +1 -0
  64. metadata +32 -9
  65. data/.ci/.jenkins_master_framework.yml +0 -4
@@ -69,6 +69,14 @@ module ElasticAPM
69
69
  base[:message] = build_message(context.message)
70
70
  end
71
71
 
72
+ if context.service
73
+ base[:service] = build_service(context.service)
74
+ end
75
+
76
+ if context.links && !context.links.empty?
77
+ base[:links] = build_links(context.links)
78
+ end
79
+
72
80
  base
73
81
  end
74
82
 
@@ -121,6 +129,23 @@ module ElasticAPM
121
129
  }
122
130
  }
123
131
  end
132
+
133
+ def build_service(service)
134
+ {
135
+ target: {
136
+ name: keyword_field(service.target&.name),
137
+ type: keyword_field(service.target&.type)
138
+ }
139
+ }
140
+ end
141
+
142
+ def build_links(links)
143
+ {
144
+ links: links.map do |link|
145
+ {"trace_id" => link.trace_id, "span_id" => link.span_id}
146
+ end
147
+ }
148
+ end
124
149
  end
125
150
 
126
151
  private
@@ -18,5 +18,5 @@
18
18
  # frozen_string_literal: true
19
19
 
20
20
  module ElasticAPM
21
- VERSION = '4.5.0'
21
+ VERSION = '4.6.2'
22
22
  end
data/lib/elastic_apm.rb CHANGED
@@ -26,6 +26,7 @@ require 'logger'
26
26
  require 'concurrent'
27
27
  require 'forwardable'
28
28
  require 'securerandom'
29
+ require 'ruby2_keywords'
29
30
 
30
31
  require 'elastic_apm/version'
31
32
  require 'elastic_apm/internal_error'
metadata CHANGED
@@ -1,14 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: elastic-apm
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.5.0
4
+ version: 4.6.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mikkel Malmberg
8
- autorequire:
8
+ - Emily Stolfo
9
+ autorequire:
9
10
  bindir: bin
10
11
  cert_chain: []
11
- date: 2021-12-03 00:00:00.000000000 Z
12
+ date: 2023-03-22 00:00:00.000000000 Z
12
13
  dependencies:
13
14
  - !ruby/object:Gem::Dependency
14
15
  name: concurrent-ruby
@@ -38,9 +39,23 @@ dependencies:
38
39
  - - ">="
39
40
  - !ruby/object:Gem::Version
40
41
  version: '3.0'
41
- description:
42
+ - !ruby/object:Gem::Dependency
43
+ name: ruby2_keywords
44
+ requirement: !ruby/object:Gem::Requirement
45
+ requirements:
46
+ - - ">="
47
+ - !ruby/object:Gem::Version
48
+ version: '0'
49
+ type: :runtime
50
+ prerelease: false
51
+ version_requirements: !ruby/object:Gem::Requirement
52
+ requirements:
53
+ - - ">="
54
+ - !ruby/object:Gem::Version
55
+ version: '0'
56
+ description:
42
57
  email:
43
- - mikkel@elastic.co
58
+ - info@elastic.co
44
59
  executables: []
45
60
  extensions: []
46
61
  extra_rdoc_files: []
@@ -48,8 +63,9 @@ files:
48
63
  - ".ci/.jenkins_codecov.yml"
49
64
  - ".ci/.jenkins_exclude.yml"
50
65
  - ".ci/.jenkins_framework.yml"
51
- - ".ci/.jenkins_master_framework.yml"
66
+ - ".ci/.jenkins_main_framework.yml"
52
67
  - ".ci/.jenkins_ruby.yml"
68
+ - ".ci/.jenkins_ruby_benchmarks.yml"
53
69
  - ".ci/Jenkinsfile"
54
70
  - ".ci/docker/jruby/11-jdk/Dockerfile"
55
71
  - ".ci/docker/jruby/12-jdk/Dockerfile"
@@ -66,6 +82,8 @@ files:
66
82
  - ".ci/jobs/defaults.yml"
67
83
  - ".ci/linting.groovy"
68
84
  - ".ci/packer_cache.sh"
85
+ - ".ci/snapshoty.yml"
86
+ - ".ci/update-specs.yml"
69
87
  - ".github/ISSUE_TEMPLATE/Bug_report.md"
70
88
  - ".github/ISSUE_TEMPLATE/Feature_request.md"
71
89
  - ".github/PULL_REQUEST_TEMPLATE.md"
@@ -73,6 +91,7 @@ files:
73
91
  - ".github/labeler-config.yml"
74
92
  - ".github/workflows/addToProject.yml"
75
93
  - ".github/workflows/labeler.yml"
94
+ - ".github/workflows/update-specs.yml"
76
95
  - ".gitignore"
77
96
  - ".pre-commit-config.yaml"
78
97
  - ".rspec"
@@ -136,6 +155,7 @@ files:
136
155
  - lib/elastic_apm/config/options.rb
137
156
  - lib/elastic_apm/config/regexp_list.rb
138
157
  - lib/elastic_apm/config/round_float.rb
158
+ - lib/elastic_apm/config/server_info.rb
139
159
  - lib/elastic_apm/config/wildcard_pattern_list.rb
140
160
  - lib/elastic_apm/context.rb
141
161
  - lib/elastic_apm/context/request.rb
@@ -192,7 +212,9 @@ files:
192
212
  - lib/elastic_apm/span/context/db.rb
193
213
  - lib/elastic_apm/span/context/destination.rb
194
214
  - lib/elastic_apm/span/context/http.rb
215
+ - lib/elastic_apm/span/context/links.rb
195
216
  - lib/elastic_apm/span/context/message.rb
217
+ - lib/elastic_apm/span/context/service.rb
196
218
  - lib/elastic_apm/span_helpers.rb
197
219
  - lib/elastic_apm/spies.rb
198
220
  - lib/elastic_apm/spies/action_dispatch.rb
@@ -205,6 +227,7 @@ files:
205
227
  - lib/elastic_apm/spies/json.rb
206
228
  - lib/elastic_apm/spies/mongo.rb
207
229
  - lib/elastic_apm/spies/net_http.rb
230
+ - lib/elastic_apm/spies/racecar.rb
208
231
  - lib/elastic_apm/spies/rake.rb
209
232
  - lib/elastic_apm/spies/redis.rb
210
233
  - lib/elastic_apm/spies/resque.rb
@@ -258,7 +281,7 @@ licenses:
258
281
  - Apache-2.0
259
282
  metadata:
260
283
  source_code_uri: https://github.com/elastic/apm-agent-ruby
261
- post_install_message:
284
+ post_install_message:
262
285
  rdoc_options: []
263
286
  require_paths:
264
287
  - lib
@@ -273,8 +296,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
273
296
  - !ruby/object:Gem::Version
274
297
  version: '0'
275
298
  requirements: []
276
- rubygems_version: 3.2.22
277
- signing_key:
299
+ rubygems_version: 3.0.3.1
300
+ signing_key:
278
301
  specification_version: 4
279
302
  summary: The official Elastic APM agent for Ruby
280
303
  test_files: []
@@ -1,4 +0,0 @@
1
- FRAMEWORK:
2
- - rails-main
3
- - sinatra-master
4
- - grape-master