class DetailedTraceSpan

{

"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"
  } ]
}

Attributes

operation[R]

What is the “name” of this span.

Examples:

SQL/User/find
Controller/Users/index
HTTP/GET/example.com
parent_id[R]
span_id[R]
span_type[R]
start_instant[R]
stop_instant[R]
tags[R]

Public Class Methods

new(span_id, parent_id, start_instant, stop_instant, operation, tags) click to toggle source
# File lib/scout_apm/detailed_trace.rb, line 162
def initialize(span_id, parent_id, start_instant, stop_instant, operation, tags)
  # 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(tags)
end

Public Instance Methods

as_json(*) click to toggle source
# 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