Documentation
¶
Index ¶
Constants ¶
View Source
const DefaultAddress = ":8126"
DefaultAddress is the default address to listen to traces
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ColourFormatter ¶
type ColourFormatter struct{}
ColourFormatter formats spans in ANSI colour
func (ColourFormatter) Format ¶
func (ColourFormatter) Format(span Span) string
Format taks a span and formats it in ANSI colour
type Server ¶
type Server struct {
// tcp address to listen on
Address string
// contains filtered or unexported fields
}
Server mimics the HTTP API exposed by the datadog APM agent
func NewServer ¶
func NewServer(address string, options ...ServerOption) *Server
NewServer creates a new trace server
func (Server) HandleTrace ¶
func (server Server) HandleTrace(w http.ResponseWriter, req *http.Request)
HandleTrace receives tracing requests from datadog clients and prints them to the console
type ServerOption ¶
type ServerOption func(*serverConfig)
ServerOption provides optional configuration for initializing a new server
func WithOutput ¶
func WithOutput(output io.Writer) ServerOption
WithOutput allows for overriding the output destination for traces
type Span ¶
type Span struct {
Operation string `msgpack:"name"` // operation name
Service string `msgpack:"service"` // service name (i.e. "grpc.server", "http.request")
Resource string `msgpack:"resource"` // resource name (i.e. "/user?id=123", "SELECT * FROM users")
Type string `msgpack:"type"` // protocol associated with the span (i.e. "web", "db", "cache")
Start int64 `msgpack:"start"` // span start time expressed in nanoseconds since epoch
Duration int64 `msgpack:"duration"` // duration of the span expressed in nanoseconds
Meta map[string]string `msgpack:"meta,omitempty"` // arbitrary map of metadata
Metrics map[string]float64 `msgpack:"metrics,omitempty"` // arbitrary map of numeric metrics
SpanID uint64 `msgpack:"span_id"` // identifier of this span
TraceID uint64 `msgpack:"trace_id"` // identifier of the root span
ParentID uint64 `msgpack:"parent_id"` // identifier of the span's direct parent
Error int32 `msgpack:"error"` // error status of the span; 0 means no errors
}
Span is a single dd-trace span
https://github.com/DataDog/dd-trace-go/blob/v1/ddtrace/tracer/span.go
func DecodeSpans ¶
DecodeSpans decodes an array of spans from a msgpack encoded array
Click to show internal directories.
Click to hide internal directories.