oneapm_rpm 1.3.6 → 1.3.7.rc1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/lib/one_apm/agent/agent/start_worker_thread.rb +8 -8
- data/lib/one_apm/agent/cross_app/cross_app_monitor.rb +2 -2
- data/lib/one_apm/agent/cross_app/cross_app_tracing.rb +2 -2
- data/lib/one_apm/agent/database.rb +17 -17
- data/lib/one_apm/agent/database/obfuscation_helpers.rb +13 -13
- data/lib/one_apm/agent/database/obfuscator.rb +5 -5
- data/lib/one_apm/agent/database/postgres_explain_obfuscator.rb +4 -4
- data/lib/one_apm/agent/datastore/metric_helper.rb +12 -12
- data/lib/one_apm/agent/datastore/mongo/command_formatter.rb +6 -6
- data/lib/one_apm/agent/datastore/mongo/metric_translator.rb +6 -6
- data/lib/one_apm/agent/datastore/mongo/obfuscator.rb +2 -2
- data/lib/one_apm/agent/datastore/mongo/statement_formatter.rb +4 -4
- data/lib/one_apm/agent/javascript_instrumentor.rb +22 -22
- data/lib/one_apm/agent/synthetics_monitor.rb +7 -7
- data/lib/one_apm/agent/threading/thread_profile.rb +2 -2
- data/lib/one_apm/collector/collector/http_connection.rb +4 -4
- data/lib/one_apm/collector/collector_service.rb +1 -1
- data/lib/one_apm/collector/commands/thread_profiler_session.rb +4 -4
- data/lib/one_apm/collector/containers/agent_command_router.rb +4 -4
- data/lib/one_apm/collector/containers/custom_event_aggregator.rb +10 -10
- data/lib/one_apm/collector/containers/error_collector.rb +4 -4
- data/lib/one_apm/collector/containers/sql_sampler.rb +2 -2
- data/lib/one_apm/collector/containers/transaction_event_aggregator.rb +36 -36
- data/lib/one_apm/collector/containers/transaction_sampler.rb +4 -4
- data/lib/one_apm/collector/containers/utilization_data.rb +1 -1
- data/lib/one_apm/collector/samplers/delayed_job_sampler.rb +7 -7
- data/lib/one_apm/collector/samplers/vm_sampler.rb +18 -18
- data/lib/one_apm/collector/stats_engine/gc_profiler.rb +6 -6
- data/lib/one_apm/collector/stats_engine/metric_stats.rb +1 -1
- data/lib/one_apm/collector/support/proc_poller.rb +2 -2
- data/lib/one_apm/configuration.rb +2 -2
- data/lib/one_apm/configuration/default_source.rb +2 -2
- data/lib/one_apm/configuration/environment_source.rb +5 -5
- data/lib/one_apm/configuration/high_security_source.rb +7 -7
- data/lib/one_apm/errors/noticed_error.rb +2 -2
- data/lib/one_apm/inst/dispatcher/puma.rb +7 -4
- data/lib/one_apm/inst/framework/grape.rb +9 -9
- data/lib/one_apm/inst/framework/sinatra/transaction_namer.rb +2 -2
- data/lib/one_apm/inst/http_clients/curb.rb +2 -2
- data/lib/one_apm/inst/http_clients/excon.rb +7 -7
- data/lib/one_apm/inst/http_clients/httpclient.rb +2 -2
- data/lib/one_apm/inst/http_clients/typhoeus.rb +2 -2
- data/lib/one_apm/inst/nosql/memcache.rb +5 -5
- data/lib/one_apm/inst/nosql/mongo2.rb +8 -8
- data/lib/one_apm/inst/orm/active_record.rb +2 -2
- data/lib/one_apm/inst/rails3/action_controller.rb +1 -1
- data/lib/one_apm/inst/rails4/action_view_subscriber.rb +2 -2
- data/lib/one_apm/inst/rails4/active_record_subscriber.rb +3 -3
- data/lib/one_apm/inst/support/queue_time.rb +14 -14
- data/lib/one_apm/logger/agent_logger.rb +4 -4
- data/lib/one_apm/metrics/metric_spec.rb +10 -10
- data/lib/one_apm/rack/browser_monitoring.rb +135 -144
- data/lib/one_apm/rack/developer_mode.rb +22 -33
- data/lib/one_apm/rack/developer_mode/helper.rb +1 -1
- data/lib/one_apm/rack/middleware_base.rb +2 -0
- data/lib/one_apm/rack/middleware_helper.rb +21 -0
- data/lib/one_apm/rack/middleware_hooks.rb +10 -8
- data/lib/one_apm/rack/middleware_tracing.rb +47 -44
- data/lib/one_apm/rack/middleware_wrapper.rb +63 -57
- data/lib/one_apm/support/backtrace/backtrace_node.rb +4 -4
- data/lib/one_apm/support/backtrace/backtrace_service.rb +7 -7
- data/lib/one_apm/support/collection_helper.rb +4 -4
- data/lib/one_apm/support/event_buffer/synthetics_event_buffer.rb +2 -2
- data/lib/one_apm/support/json_marshaller.rb +2 -2
- data/lib/one_apm/support/method_tracer.rb +2 -2
- data/lib/one_apm/support/method_tracer/helpers.rb +2 -2
- data/lib/one_apm/support/obfuscator.rb +5 -5
- data/lib/one_apm/support/rules_engine.rb +2 -2
- data/lib/one_apm/support/rules_engine/replacement_rule.rb +4 -4
- data/lib/one_apm/support/rules_engine/segment_terms_rule.rb +8 -8
- data/lib/one_apm/support/supported_versions.rb +9 -13
- data/lib/one_apm/support/vm/rubinius_vm.rb +1 -1
- data/lib/one_apm/transaction.rb +8 -8
- data/lib/one_apm/transaction/class_methods.rb +8 -8
- data/lib/one_apm/transaction/instance_helpers.rb +1 -1
- data/lib/one_apm/transaction/metric_constants.rb +27 -27
- data/lib/one_apm/transaction/sample_buffer/developer_mode_sample_buffer.rb +3 -3
- data/lib/one_apm/transaction/sample_buffer/force_persist_sample_buffer.rb +2 -2
- data/lib/one_apm/transaction/sample_buffer/slowest_sample_buffer.rb +2 -2
- data/lib/one_apm/transaction/sample_buffer/transaction_sample_buffer.rb +3 -3
- data/lib/one_apm/transaction/segment.rb +2 -2
- data/lib/one_apm/transaction/transaction_finish_append.rb +3 -3
- data/lib/one_apm/transaction/transaction_jruby_functions.rb +3 -3
- data/lib/one_apm/transaction/transaction_name.rb +3 -3
- data/lib/one_apm/transaction/transaction_namer.rb +7 -7
- data/lib/one_apm/transaction/transaction_sample_builder.rb +3 -3
- data/lib/one_apm/transaction/transaction_summary.rb +4 -4
- data/lib/one_apm/transaction/transaction_timings.rb +1 -1
- data/lib/one_apm/version.rb +3 -2
- metadata +3 -2
@@ -3,43 +3,43 @@
|
|
3
3
|
module OneApm
|
4
4
|
class Transaction
|
5
5
|
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
6
|
+
OA_SUBTRANSACTION_PREFIX = 'Nested/'.freeze
|
7
|
+
OA_CONTROLLER_PREFIX = 'Controller/'.freeze
|
8
|
+
OA_MIDDLEWARE_PREFIX = 'Middleware/Rack/'.freeze
|
9
|
+
OA_TASK_PREFIX = 'OtherTransaction/Background/'.freeze
|
10
|
+
OA_RACK_PREFIX = 'WebTransaction/Rack/'.freeze
|
11
|
+
OA_SINATRA_PREFIX = 'WebTransaction/Sinatra/'.freeze
|
12
|
+
OA_GRAPE_PREFIX = 'WebTransaction/Grape/'.freeze
|
13
|
+
OA_OTHER_TRANSACTION_PREFIX = 'OtherTransaction/'.freeze
|
14
|
+
OA_WEB_TRANSACTION_PREFIX = 'WebTransaction/'.freeze
|
15
15
|
|
16
|
-
|
16
|
+
OA_CONTROLLER_OA_MIDDLEWARE_PREFIX = 'Controller/Middleware/Rack'.freeze
|
17
17
|
|
18
|
-
|
19
|
-
|
18
|
+
OA_WEB_SUMMARY_METRIC = 'WebTransaction'.freeze
|
19
|
+
OA_OTHER_SUMMARY_METRIC = 'OtherTransaction/all'.freeze
|
20
20
|
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
21
|
+
OA_APDEX_S = 'S'.freeze
|
22
|
+
OA_APDEX_T = 'T'.freeze
|
23
|
+
OA_APDEX_F = 'F'.freeze
|
24
|
+
OA_APDEX_METRIC = 'Apdex'.freeze
|
25
25
|
|
26
|
-
|
26
|
+
OA_QUEUE_TIME_METRIC = 'WebFrontend/QueueTime'.freeze
|
27
27
|
|
28
|
-
|
29
|
-
|
30
|
-
|
28
|
+
OA_NESTED_TRACE_STOP_OPTIONS = { :metric => true }.freeze
|
29
|
+
OA_WEB_TRANSACTION_CATEGORIES = [:controller, :uri, :rack, :sinatra, :grape, :middleware].freeze
|
30
|
+
OA_TRANSACTION_NAMING_SOURCES = [:child, :api].freeze
|
31
31
|
|
32
|
-
|
33
|
-
|
32
|
+
OA_MIDDLEWARE_SUMMARY_METRICS = ['Middleware/all'.freeze].freeze
|
33
|
+
OA_EMPTY_SUMMARY_METRICS = [].freeze
|
34
34
|
|
35
|
-
|
36
|
-
|
35
|
+
OA_TRACE_OPTIONS_SCOPED = {:metric => true, :scoped_metric => true}.freeze
|
36
|
+
OA_TRACE_OPTIONS_UNSCOPED = {:metric => true, :scoped_metric => false}.freeze
|
37
37
|
|
38
|
-
|
38
|
+
OA_TRACE_IGNORE_OPTIONS = {:metric => false}.freeze
|
39
39
|
|
40
|
-
|
40
|
+
OA_UNKNOWN_METRIC = '(unknown)'.freeze
|
41
41
|
|
42
|
-
|
42
|
+
OA_FAILED_TO_STOP_MESSAGE = "Failed during Transaction.stop because there is no current transaction"
|
43
43
|
|
44
44
|
end
|
45
45
|
end
|
@@ -6,7 +6,7 @@ module OneApm
|
|
6
6
|
class Transaction
|
7
7
|
class DeveloperModeSampleBuffer < TransactionSampleBuffer
|
8
8
|
|
9
|
-
|
9
|
+
OA_CAPACITY = 100
|
10
10
|
|
11
11
|
def capacity
|
12
12
|
max_capacity
|
@@ -15,11 +15,11 @@ module OneApm
|
|
15
15
|
# Dev mode is allowed more than the typical upper limit.
|
16
16
|
# Sidestep normal cap by overriding max_capacity.
|
17
17
|
def max_capacity
|
18
|
-
|
18
|
+
OA_CAPACITY
|
19
19
|
end
|
20
20
|
|
21
21
|
def harvest_samples
|
22
|
-
|
22
|
+
OA_NO_SAMPLES
|
23
23
|
end
|
24
24
|
|
25
25
|
def enabled?
|
@@ -5,8 +5,8 @@ module OneApm
|
|
5
5
|
class TransactionSampleBuffer
|
6
6
|
attr_reader :samples
|
7
7
|
|
8
|
-
|
9
|
-
|
8
|
+
OA_SINGLE_BUFFER_MAX = 20
|
9
|
+
OA_NO_SAMPLES = [].freeze
|
10
10
|
|
11
11
|
def initialize
|
12
12
|
@samples = []
|
@@ -68,7 +68,7 @@ module OneApm
|
|
68
68
|
# A typical buffer should NOT override this method (although we do for
|
69
69
|
# odd things like dev-mode)
|
70
70
|
def max_capacity
|
71
|
-
capacity >
|
71
|
+
capacity > OA_SINGLE_BUFFER_MAX ? OA_SINGLE_BUFFER_MAX : capacity
|
72
72
|
end
|
73
73
|
|
74
74
|
# Our default truncation strategy is to keep max_capacity
|
@@ -15,11 +15,11 @@ module OneApm
|
|
15
15
|
|
16
16
|
attr_accessor :metric_name
|
17
17
|
|
18
|
-
|
18
|
+
OA_UNKNOWN_SEGMENT_NAME = '<unknown>'.freeze
|
19
19
|
|
20
20
|
def initialize(timestamp, metric_name, segment_id=nil)
|
21
21
|
@entry_timestamp = timestamp
|
22
|
-
@metric_name = metric_name ||
|
22
|
+
@metric_name = metric_name || OA_UNKNOWN_SEGMENT_NAME
|
23
23
|
@segment_id = segment_id || object_id
|
24
24
|
end
|
25
25
|
|
@@ -31,9 +31,9 @@ module OneApm
|
|
31
31
|
|
32
32
|
bucket = apdex_bucket(duration)
|
33
33
|
bucket_str = case bucket
|
34
|
-
when :apdex_s then Transaction::
|
35
|
-
when :apdex_t then Transaction::
|
36
|
-
when :apdex_f then Transaction::
|
34
|
+
when :apdex_s then Transaction::OA_APDEX_S
|
35
|
+
when :apdex_t then Transaction::OA_APDEX_T
|
36
|
+
when :apdex_f then Transaction::OA_APDEX_F
|
37
37
|
else nil
|
38
38
|
end
|
39
39
|
payload[:apdex_perf_zone] = bucket_str if bucket_str
|
@@ -15,7 +15,7 @@ module OneApm
|
|
15
15
|
end
|
16
16
|
end
|
17
17
|
|
18
|
-
|
18
|
+
OA_JRUBY_CPU_TIME_ERROR = "Error calculating JRuby CPU Time".freeze
|
19
19
|
|
20
20
|
def jruby_cpu_time
|
21
21
|
return nil unless @@java_classes_loaded
|
@@ -26,8 +26,8 @@ module OneApm
|
|
26
26
|
|
27
27
|
-1 == java_utime ? 0.0 : java_utime/1e9
|
28
28
|
rescue => e
|
29
|
-
OneApm::Manager.logger.log_once(:warn, :jruby_cpu_time,
|
30
|
-
OneApm::Manager.logger.debug(
|
29
|
+
OneApm::Manager.logger.log_once(:warn, :jruby_cpu_time, OA_JRUBY_CPU_TIME_ERROR, e)
|
30
|
+
OneApm::Manager.logger.debug(OA_JRUBY_CPU_TIME_ERROR, e)
|
31
31
|
nil
|
32
32
|
end
|
33
33
|
|
@@ -56,7 +56,7 @@ module OneApm
|
|
56
56
|
|
57
57
|
def best_name
|
58
58
|
@frozen_name || @overridden_name ||
|
59
|
-
@default_name || Transaction::
|
59
|
+
@default_name || Transaction::OA_UNKNOWN_METRIC
|
60
60
|
end
|
61
61
|
|
62
62
|
def name_set?
|
@@ -64,8 +64,8 @@ module OneApm
|
|
64
64
|
end
|
65
65
|
|
66
66
|
def promoted_transaction_name(name)
|
67
|
-
if name.start_with?(Transaction::
|
68
|
-
"#{Transaction::
|
67
|
+
if name.start_with?(Transaction::OA_MIDDLEWARE_PREFIX)
|
68
|
+
"#{Transaction::OA_WEB_TRANSACTION_PREFIX}#{name}"
|
69
69
|
else
|
70
70
|
name
|
71
71
|
end
|
@@ -8,13 +8,13 @@ module OneApm
|
|
8
8
|
def self.prefix_for_category(txn, category = nil)
|
9
9
|
category ||= (txn && txn.category)
|
10
10
|
case category
|
11
|
-
when :controller then ::OneApm::Transaction::
|
12
|
-
when :task then ::OneApm::Transaction::
|
13
|
-
when :rack then ::OneApm::Transaction::
|
14
|
-
when :uri then ::OneApm::Transaction::
|
15
|
-
when :sinatra then ::OneApm::Transaction::
|
16
|
-
when :middleware then ::OneApm::Transaction::
|
17
|
-
when :grape then ::OneApm::Transaction::
|
11
|
+
when :controller then ::OneApm::Transaction::OA_WEB_TRANSACTION_PREFIX
|
12
|
+
when :task then ::OneApm::Transaction::OA_TASK_PREFIX
|
13
|
+
when :rack then ::OneApm::Transaction::OA_RACK_PREFIX
|
14
|
+
when :uri then ::OneApm::Transaction::OA_WEB_TRANSACTION_PREFIX
|
15
|
+
when :sinatra then ::OneApm::Transaction::OA_SINATRA_PREFIX
|
16
|
+
when :middleware then ::OneApm::Transaction::OA_MIDDLEWARE_PREFIX
|
17
|
+
when :grape then ::OneApm::Transaction::OA_GRAPE_PREFIX
|
18
18
|
else "#{category.to_s}/" # for internal use only
|
19
19
|
end
|
20
20
|
end
|
@@ -115,15 +115,15 @@ module OneApm
|
|
115
115
|
@current_segment = nil
|
116
116
|
end
|
117
117
|
|
118
|
-
|
118
|
+
OA_TT_THRESHOLD_KEY = :'transaction_tracer.transaction_threshold'
|
119
119
|
|
120
120
|
def transaction_trace_threshold
|
121
121
|
state = TransactionState.tl_get
|
122
|
-
source_class = OneApm::Manager.config.source(
|
122
|
+
source_class = OneApm::Manager.config.source(OA_TT_THRESHOLD_KEY).class
|
123
123
|
if source_class == Configuration::DefaultSource && state.current_transaction
|
124
124
|
state.current_transaction.apdex_t * 4
|
125
125
|
else
|
126
|
-
OneApm::Manager.config[
|
126
|
+
OneApm::Manager.config[OA_TT_THRESHOLD_KEY]
|
127
127
|
end
|
128
128
|
end
|
129
129
|
|
@@ -4,8 +4,8 @@ module OneApm
|
|
4
4
|
class Transaction
|
5
5
|
|
6
6
|
def summary_metrics
|
7
|
-
if @frozen_name.start_with?(
|
8
|
-
[
|
7
|
+
if @frozen_name.start_with?(OA_WEB_TRANSACTION_PREFIX)
|
8
|
+
[OA_WEB_SUMMARY_METRIC]
|
9
9
|
else
|
10
10
|
background_summary_metrics
|
11
11
|
end
|
@@ -14,14 +14,14 @@ module OneApm
|
|
14
14
|
def background_summary_metrics
|
15
15
|
segments = @frozen_name.split('/')
|
16
16
|
if segments.size > 2
|
17
|
-
["OtherTransaction/#{segments[1]}/all",
|
17
|
+
["OtherTransaction/#{segments[1]}/all", OA_OTHER_SUMMARY_METRIC]
|
18
18
|
else
|
19
19
|
[]
|
20
20
|
end
|
21
21
|
end
|
22
22
|
|
23
23
|
def needs_middleware_summary_metrics?(name)
|
24
|
-
name.start_with?(
|
24
|
+
name.start_with?(OA_MIDDLEWARE_PREFIX)
|
25
25
|
end
|
26
26
|
|
27
27
|
end
|
data/lib/one_apm/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: oneapm_rpm
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.7.rc1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- oneapm
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-05
|
11
|
+
date: 2016-06-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -429,6 +429,7 @@ files:
|
|
429
429
|
- lib/one_apm/rack/developer_mode/views/oneapm/slide.tmpl
|
430
430
|
- lib/one_apm/rack/developer_mode/views/oneapm/threads.html.erb
|
431
431
|
- lib/one_apm/rack/middleware_base.rb
|
432
|
+
- lib/one_apm/rack/middleware_helper.rb
|
432
433
|
- lib/one_apm/rack/middleware_hooks.rb
|
433
434
|
- lib/one_apm/rack/middleware_tracing.rb
|
434
435
|
- lib/one_apm/rack/middleware_wrapper.rb
|