elastic-apm 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of elastic-apm might be problematic. Click here for more details.

Files changed (60) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +13 -0
  3. data/.rspec +2 -0
  4. data/.rubocop.yml +47 -0
  5. data/.travis.yml +5 -0
  6. data/CODE_OF_CONDUCT.md +47 -0
  7. data/Gemfile +38 -0
  8. data/LICENSE +201 -0
  9. data/README.md +55 -0
  10. data/Rakefile +12 -0
  11. data/bin/console +15 -0
  12. data/bin/setup +8 -0
  13. data/bin/with_framework +7 -0
  14. data/elastic-apm.gemspec +22 -0
  15. data/lib/elastic-apm.rb +4 -0
  16. data/lib/elastic_apm.rb +92 -0
  17. data/lib/elastic_apm/agent.rb +164 -0
  18. data/lib/elastic_apm/config.rb +124 -0
  19. data/lib/elastic_apm/error.rb +21 -0
  20. data/lib/elastic_apm/error/context.rb +119 -0
  21. data/lib/elastic_apm/error/exception.rb +37 -0
  22. data/lib/elastic_apm/error/log.rb +24 -0
  23. data/lib/elastic_apm/error_builder.rb +40 -0
  24. data/lib/elastic_apm/http.rb +103 -0
  25. data/lib/elastic_apm/injectors.rb +71 -0
  26. data/lib/elastic_apm/injectors/action_dispatch.rb +26 -0
  27. data/lib/elastic_apm/injectors/json.rb +22 -0
  28. data/lib/elastic_apm/injectors/net_http.rb +50 -0
  29. data/lib/elastic_apm/injectors/redis.rb +33 -0
  30. data/lib/elastic_apm/injectors/sequel.rb +45 -0
  31. data/lib/elastic_apm/injectors/sinatra.rb +41 -0
  32. data/lib/elastic_apm/injectors/tilt.rb +27 -0
  33. data/lib/elastic_apm/instrumenter.rb +112 -0
  34. data/lib/elastic_apm/internal_error.rb +5 -0
  35. data/lib/elastic_apm/log.rb +47 -0
  36. data/lib/elastic_apm/middleware.rb +30 -0
  37. data/lib/elastic_apm/normalizers.rb +63 -0
  38. data/lib/elastic_apm/normalizers/action_controller.rb +24 -0
  39. data/lib/elastic_apm/normalizers/action_view.rb +72 -0
  40. data/lib/elastic_apm/normalizers/active_record.rb +41 -0
  41. data/lib/elastic_apm/railtie.rb +43 -0
  42. data/lib/elastic_apm/serializers.rb +26 -0
  43. data/lib/elastic_apm/serializers/errors.rb +40 -0
  44. data/lib/elastic_apm/serializers/transactions.rb +36 -0
  45. data/lib/elastic_apm/service_info.rb +66 -0
  46. data/lib/elastic_apm/span.rb +51 -0
  47. data/lib/elastic_apm/span/context.rb +20 -0
  48. data/lib/elastic_apm/span_helpers.rb +37 -0
  49. data/lib/elastic_apm/sql_summarizer.rb +26 -0
  50. data/lib/elastic_apm/stacktrace.rb +84 -0
  51. data/lib/elastic_apm/stacktrace/frame.rb +62 -0
  52. data/lib/elastic_apm/subscriber.rb +72 -0
  53. data/lib/elastic_apm/system_info.rb +30 -0
  54. data/lib/elastic_apm/transaction.rb +92 -0
  55. data/lib/elastic_apm/util.rb +20 -0
  56. data/lib/elastic_apm/util/inspector.rb +61 -0
  57. data/lib/elastic_apm/version.rb +5 -0
  58. data/lib/elastic_apm/worker.rb +48 -0
  59. data/vendor/.gitkeep +0 -0
  60. metadata +116 -0
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ module ElasticAPM
4
+ VERSION = '0.1.0'.freeze
5
+ end
@@ -0,0 +1,48 @@
1
+ # frozen_string_literal: true
2
+
3
+ module ElasticAPM
4
+ # @api private
5
+ class Worker
6
+ include Log
7
+
8
+ # @api private
9
+ class StopMessage; end
10
+
11
+ # @api private
12
+ Request = Struct.new(:path, :payload) do
13
+ # require all params
14
+ def initialize(path, payload)
15
+ super
16
+ end
17
+ end
18
+
19
+ def initialize(config, queue, http: Http)
20
+ @config = config
21
+ @adapter = http.new(config)
22
+ @queue = queue
23
+ end
24
+
25
+ attr_reader :config
26
+
27
+ def run_forever
28
+ loop do
29
+ while (item = @queue.pop)
30
+ case item
31
+ when Request
32
+ process item
33
+ when StopMessage
34
+ Thread.exit
35
+ end
36
+ end
37
+ end
38
+ end
39
+
40
+ def process(item)
41
+ @adapter.post(item.path, item.payload)
42
+ rescue ::Exception => e
43
+ fatal 'Failed posting: %s', e.inspect
44
+ debug e.backtrace.join("\n")
45
+ nil
46
+ end
47
+ end
48
+ end
data/vendor/.gitkeep ADDED
File without changes
metadata ADDED
@@ -0,0 +1,116 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: elastic-apm
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Mikkel Malmberg
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2017-12-27 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: activesupport
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: 3.0.0
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: 3.0.0
27
+ description:
28
+ email:
29
+ - mikkel@elastic.co
30
+ executables: []
31
+ extensions: []
32
+ extra_rdoc_files: []
33
+ files:
34
+ - ".gitignore"
35
+ - ".rspec"
36
+ - ".rubocop.yml"
37
+ - ".travis.yml"
38
+ - CODE_OF_CONDUCT.md
39
+ - Gemfile
40
+ - LICENSE
41
+ - README.md
42
+ - Rakefile
43
+ - bin/console
44
+ - bin/setup
45
+ - bin/with_framework
46
+ - elastic-apm.gemspec
47
+ - lib/elastic-apm.rb
48
+ - lib/elastic_apm.rb
49
+ - lib/elastic_apm/agent.rb
50
+ - lib/elastic_apm/config.rb
51
+ - lib/elastic_apm/error.rb
52
+ - lib/elastic_apm/error/context.rb
53
+ - lib/elastic_apm/error/exception.rb
54
+ - lib/elastic_apm/error/log.rb
55
+ - lib/elastic_apm/error_builder.rb
56
+ - lib/elastic_apm/http.rb
57
+ - lib/elastic_apm/injectors.rb
58
+ - lib/elastic_apm/injectors/action_dispatch.rb
59
+ - lib/elastic_apm/injectors/json.rb
60
+ - lib/elastic_apm/injectors/net_http.rb
61
+ - lib/elastic_apm/injectors/redis.rb
62
+ - lib/elastic_apm/injectors/sequel.rb
63
+ - lib/elastic_apm/injectors/sinatra.rb
64
+ - lib/elastic_apm/injectors/tilt.rb
65
+ - lib/elastic_apm/instrumenter.rb
66
+ - lib/elastic_apm/internal_error.rb
67
+ - lib/elastic_apm/log.rb
68
+ - lib/elastic_apm/middleware.rb
69
+ - lib/elastic_apm/normalizers.rb
70
+ - lib/elastic_apm/normalizers/action_controller.rb
71
+ - lib/elastic_apm/normalizers/action_view.rb
72
+ - lib/elastic_apm/normalizers/active_record.rb
73
+ - lib/elastic_apm/railtie.rb
74
+ - lib/elastic_apm/serializers.rb
75
+ - lib/elastic_apm/serializers/errors.rb
76
+ - lib/elastic_apm/serializers/transactions.rb
77
+ - lib/elastic_apm/service_info.rb
78
+ - lib/elastic_apm/span.rb
79
+ - lib/elastic_apm/span/context.rb
80
+ - lib/elastic_apm/span_helpers.rb
81
+ - lib/elastic_apm/sql_summarizer.rb
82
+ - lib/elastic_apm/stacktrace.rb
83
+ - lib/elastic_apm/stacktrace/frame.rb
84
+ - lib/elastic_apm/subscriber.rb
85
+ - lib/elastic_apm/system_info.rb
86
+ - lib/elastic_apm/transaction.rb
87
+ - lib/elastic_apm/util.rb
88
+ - lib/elastic_apm/util/inspector.rb
89
+ - lib/elastic_apm/version.rb
90
+ - lib/elastic_apm/worker.rb
91
+ - vendor/.gitkeep
92
+ homepage: https://github.com/elastic/apm-agent-ruby
93
+ licenses:
94
+ - Apache-2.0
95
+ metadata: {}
96
+ post_install_message:
97
+ rdoc_options: []
98
+ require_paths:
99
+ - lib
100
+ required_ruby_version: !ruby/object:Gem::Requirement
101
+ requirements:
102
+ - - ">="
103
+ - !ruby/object:Gem::Version
104
+ version: 2.0.0
105
+ required_rubygems_version: !ruby/object:Gem::Requirement
106
+ requirements:
107
+ - - ">="
108
+ - !ruby/object:Gem::Version
109
+ version: '0'
110
+ requirements: []
111
+ rubyforge_project:
112
+ rubygems_version: 2.7.3
113
+ signing_key:
114
+ specification_version: 4
115
+ summary: The official Elastic APM agent for Ruby
116
+ test_files: []