opentracing library

Copyright 2016 The OpenTracing Authors

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Classes

AbstractTracer
AbstractTracer provides the abstract definition for a Tracer and contains some default method implementations.
BinaryCarrier
The binary Carrier format is an opaque byte array (Convenience class to use as a binary carrier.)
LogData
LogData is data associated with a Span. Every LogData instance should specify at least one of Event and/or Payload.
Reference
Pairs a reference type constant (e.g., referenceChildOf or referenceFollowsFrom) with the SpanContext it points to.
Scope
A Scope formalizes the activation and deactivation of a Span, usually from a CPU standpoint.
ScopeManager
The ScopeManager abstracts both the activation of Span instances via ScopeManager.activate(Span, boolean)} and access to an active Span/Scope via ScopeManager.active.
Span
Span represents a logical unit of work as part of a broader Trace. Examples of Span might include remote procedure calls or a in-process function calls to sub-components. A Trace has a single, top-level "root" Span that in turn may have zero or more child Spans, which in turn may have children.
SpanContext
SpanContext represents Span state that must propagate to descendant Spans and across process boundaries.

Constants

component → const String
Low-cardinality identifier of the module, library, or package that is generating a Span.
formatBinary → const String
Represents SpanContexts in an opaque binary carrier.
formatHttpHeaders → const String
Represents SpanContexts using a character-restricted Map<String, String> as a carrier.
formatTextMap → const String
Represents SpanContexts using a Map<String, String> map as a carrier.
httpMethod → const String
Identifies the HTTP method of the request. Both upper/lower case values are allowed.
httpStatusCode → const String
Identifies the numeric HTTP status code (200, 404, etc) of the HTTP response. Expected int.
httpUrl → const String
HTTP tags Identifies the URL of the request being handled in this segment of the trace, in standard URI format. The protocol is optional.
peerHostIpV4 → const String
Identifies IP v4 host address of the peer. Expected int.
peerHostIpV6 → const String
Identifies the IP v6 host address of the peer.
peerHostname → const String
Identifies the host name of the peer.
peerPort → const String
Identifies the port number of the peer. Expect int.
peerService → const String
peer* tags can be emitted by either client-side of server-side to describe the other side/service in a peer-to-peer communications, like an RPC call. Identifies the service name of the peer.
referenceChildOf → const String
A Span may be the "child of" a parent Span. In a “child of” reference, the parent Span depends on the child Span in some capacity.
referenceFollowsFrom → const String
Some parent Spans do not depend in any way on the result of their child Spans. In these cases, we say merely that the child Span “follows from” the parent Span in a causal sense.
samplingPriority → const String
Determines the priority of sampling this Span. Expected int.
spanKind → const String
Here we define standard names for tags that can be added to Spans by the instrumentation code. The actual tracing systems are not required to retain these as tags in the stored Spans if they have other means of representing the same data. For example, the spanKind='server' can be inferred from a Zipkin span by the presence of ss/sr annotations. Hints at relationship between Spans, e.g. client/server.
spanKindRpcClient → const String
Marks a Span representing the client-side of an RPC or other remote call.
spanKindRpcServer → const String
Marks a Span representing the server-side of an RPC or other remote call.

Properties

maxInt int
Max possible integer value usable by Random.nextInt Implementation note: The default implementation supports max values between 1 and (1<<32) inclusive.
final
opentracingVersion String
tracing specification version
final
random Random
random number generator
final

Functions

globalTracer() AbstractTracer
GlobalTracer returns the global singleton AbstractTracer implementation. Before initGlobalTracer() is called, the GlobalTracer() is a noop implementation that drops all data handed to it.
initGlobalTracer(AbstractTracer tracer) → void
Sets the opentracing.AbstractTracer singleton that is returned by globalTracer()

Exceptions / Errors

InvalidCarrierFormatError
This error describes the state of a Carrier Format being invalid.
SpanContextCorruptedError
This error describes the state of a SpanContext being corrupt.