module OneApm
encoding: utf-8
This is the base class for all errors that we want to record through the OneApm::Collector::ErrorCollector#notice_agent_error
API. It provides the standard support text at the front of the message, and is used for flagging agent errors when checking queue limits.
Listen for ActiveSupport::Notifications events for ActionView render events. Write metric data and transaction trace segments for each event.
Listen for ActiveSupport::Notifications events for ActiveRecord query events. Write metric data, transaction trace segments and slow sql nodes for each event.
Base class for startup logging and testing in multiverse
This module is intended to be included into both MiddlewareWrapper and our internal middleware classes.
Host classes must define two methods:
-
target: returns the original middleware being traced
-
category: returns the category for the resulting agent transaction
should be either :middleware or :rack
-
transaction_options: returns an options hash to be passed to
Transaction.start when tracing this middleware.
The target may be self, in which case the host class should define a traced_call method, instead of the usual call.
EventBuffer is intended to be an abstract base class. It should not be instantiated directly. Subclasses should define an `append_event` method looking something like this:
def append_event(x)
<attempt to append> if append_success? return x else return nil end
end
This module includes utilities for manipulating URIs, particularly from the context of Net::HTTP
requests. We don't always have direct access to the full URI from our instrumentation points in Net::HTTP
, and we want to filter out some URI parts before saving URIs from instrumented calls - logic for that lives here.
require 'base64'
Some parts adapted from golang.org/src/pkg/json/decode.go and golang.org/src/pkg/utf8/utf8.go
Defines the constant TimerLib
to the appropriate timeout library
The GC::Profiler class available on MRI has to be reset periodically to avoid memory “leaking” in the underlying implementation. However, it's a major bummer for how we want to gather those statistics.
This class comes to the rescue. It relies on being the only party to reset the underlying GC::Profiler, but otherwise gives us a steadily increasing total time.
Add these methods to TransactionSample
that enable performance analysis in the user interface.
This class represents a set of metrics that were recorded during a single transaction. Since the name of the transaction is not known until its end, we don't save explicit scopes with these metrics, we just keep separate collections of scoped and unscoped metrics.
Constants
- OA_MYSQL_EXPLAIN_COLUMNS
- TimerLib