Class: DetailedTraceSpan
- Inherits:
-
Object
- Object
- DetailedTraceSpan
- Defined in:
- lib/scout_apm/detailed_trace.rb
Overview
{
"type": "Standard",
"identity": {
"id": "....",
"parent_id": "....",
"start_time": "01-01-01T00:00:00.0000Z",
"stop_time": "01-01-01T00:00:00.0001Z",
"operation": "SQL/User/find"
},
"tags": {
"allocations": 1000,
"db.statement": "SELECT * FROM users where id = 1",
"db.rows": 1,
"backtrace": [ {
"file": "app/controllers/users_controller.rb",
"line": 10,
"function": "index"
} ]
}
Instance Attribute Summary collapse
-
#operation ⇒ Object
readonly
What is the “name” of this span.
-
#parent_id ⇒ Object
readonly
Returns the value of attribute parent_id.
-
#span_id ⇒ Object
readonly
Returns the value of attribute span_id.
-
#span_type ⇒ Object
readonly
Returns the value of attribute span_type.
-
#start_instant ⇒ Object
readonly
Returns the value of attribute start_instant.
-
#stop_instant ⇒ Object
readonly
Returns the value of attribute stop_instant.
-
#tags ⇒ Object
readonly
Returns the value of attribute tags.
Instance Method Summary collapse
- #as_json ⇒ Object
-
#initialize(span_id, parent_id, start_instant, stop_instant, operation, tags) ⇒ DetailedTraceSpan
constructor
A new instance of DetailedTraceSpan.
Constructor Details
#initialize(span_id, parent_id, start_instant, stop_instant, operation, tags) ⇒ DetailedTraceSpan
Returns a new instance of DetailedTraceSpan.
162 163 164 165 166 167 168 169 170 171 172 173 |
# File 'lib/scout_apm/detailed_trace.rb', line 162 def initialize(span_id, parent_id, start_instant, stop_instant, operation, ) # This will be dynamic when we implement limited spans @span_type = "Standard" @span_id = span_id @parent_id = parent_id @start_instant = start_instant @stop_instant = stop_instant @operation = operation @tags = DetailedTraceTags() end |
Instance Attribute Details
#operation ⇒ Object (readonly)
What is the “name” of this span.
Examples:
SQL/User/find
Controller/Users/index
HTTP/GET/example.com
160 161 162 |
# File 'lib/scout_apm/detailed_trace.rb', line 160 def operation @operation end |
#parent_id ⇒ Object (readonly)
Returns the value of attribute parent_id.
151 152 153 |
# File 'lib/scout_apm/detailed_trace.rb', line 151 def parent_id @parent_id end |
#span_id ⇒ Object (readonly)
Returns the value of attribute span_id.
151 152 153 |
# File 'lib/scout_apm/detailed_trace.rb', line 151 def span_id @span_id end |
#span_type ⇒ Object (readonly)
Returns the value of attribute span_type.
150 151 152 |
# File 'lib/scout_apm/detailed_trace.rb', line 150 def span_type @span_type end |
#start_instant ⇒ Object (readonly)
Returns the value of attribute start_instant.
152 153 154 |
# File 'lib/scout_apm/detailed_trace.rb', line 152 def start_instant @start_instant end |
#stop_instant ⇒ Object (readonly)
Returns the value of attribute stop_instant.
152 153 154 |
# File 'lib/scout_apm/detailed_trace.rb', line 152 def stop_instant @stop_instant end |
#tags ⇒ Object (readonly)
Returns the value of attribute tags.
148 149 150 |
# File 'lib/scout_apm/detailed_trace.rb', line 148 def @tags end |
Instance Method Details
#as_json ⇒ Object
175 176 177 178 179 180 181 182 183 184 185 186 187 |
# File 'lib/scout_apm/detailed_trace.rb', line 175 def as_json(*) { :type => @span_type, :identity => { :id => span_id, :parent_id => parent_id, :start_instant => start_instant.iso8601(6), :stop_instant => stop_instant.iso8601(6), :operation => operation, }, :tags => @tags.as_json, } end |