Options for creating the child span.
A new Span object.
Gets the value of enhancedDatabaseReporting in the trace agent's configuration object.
A boolean value indicating whether the trace agent was configured to have an enhanced level of reporting enabled.
Returns a unique identifier for the currently active context. This can be used to uniquely identify the current root span. If there is no current, context, or if we have lost context, this will return null. The structure and the length of the returned string should be treated opaquely - the only guarantee is that the value would unique for every root span.
an id for the current context, or null if there is none
Gets the active root span for the current context. This method is
guaranteed to return an object with the surface of a RootSpan object, but
it may not represent a real root span if we are not in one. Use isRealSpan
or check the type
field to determine whether this is a real or phantom
span.
An object that represents either a real or phantom root span.
Returns the projectId that was either configured or auto-discovered by the TraceWriter.
Generates a stringified trace context that should be set as the trace context header in a response to an incoming web request. This value is based on the trace context header value in the corresponding incoming request, as well as the result from the local trace policy on whether this request will be traced or not.
The trace context that was attached to the incoming web request, or null if the incoming request didn't have one.
Whether the incoming was traced. This is determined by the local tracing policy.
If the response should contain the trace context within its header, the string to be set as this header's value. Otherwise, an empty string.
Returns the projectId that was either configured or auto-discovered by the TraceWriter. Note that the auto-discovery is done asynchronously, so this may return falsey until the projectId auto-discovery completes.
Returns whether a given span is real or not by checking its SpanType.
Runs the given function in a root span corresponding to an incoming request, passing it an object that exposes an interface for adding labels and closing the span.
An object that specifies options for how the root span is created and propagated.
A function that will be called exactly once. If the incoming request should be traced, a root span will be created, and this function will be called with a Span object exposing functions operating on the root span; otherwise, it will be called with a phantom Span object.
The return value of calling fn.
Binds the trace context to the given event emitter. This is necessary in order to create child spans correctly in event handlers.
An event emitter whose handlers should have the trace context binded to them.
Generated using TypeDoc
Creates and returns a new Span object nested within the current root span, which is detected automatically. If the root span is a phantom span or doesn't exist, the child span will be a phantom span as well.