kong.tracing
Ends a Span Set the end time and release the span, the span table MUST not being used after ended.
Parameters
- end_time_ns ():
Usage
span:set_attribute(key, value)
Set an attribute to a Span
Parameters
- value (
string|number|boolean
):
Usage
span:set_attribute("net.transport", "ip_tcp")
span:set_attribute("net.peer.port", 443)
span:set_attribute("exception.escaped", true)
span:add_event(name, attributes, time_ns)
Adds an event to a Span
- name (
string
): Event name - attributes (): Event attributes
- time_ns (
number|nil
): Event timestamp
Adds an error event to a Span
Parameters
- err (
string
): error string
span:set_status(status)
Adds an error event to a Span Status codes:
0
unset1
ok
Parameters
- status (
number
): status code
kong.tracing.new_span()
Get the active span Returns the root span by default
Phases
- rewrite, access, header_filter, response, body_filter, log, admin_api
Returns
- : span
Phases
- rewrite, access, header_filter, response, body_filter, log, admin_api
Parameters
- span (
table
):
kong.tracing.new_span(name, options)
Create a new Span
Phases
- rewrite, access, header_filter, response, body_filter, log, admin_api
Parameters
- name (
string
): span name - options (
table
): TODO(mayo)
Returns
table
: span
kong.tracing.process_span(processor)
Batch process spans Please note that socket is not available in the log phase, use ngx.timer.at
instead
- log
Parameters