Documentation ¶
Index ¶
- func InstrumentAWSSession(session *awssession.Session, settings Settings) *awssession.Session
- func InstrumentDatabase(db *gorm.DB, appName string)
- func InstrumentRedis(client redis.UniversalClient, applicationName string)
- func TraceDatabase(ctx context.Context, db *gorm.DB) *gorm.DB
- type Config
- type LogContext
- type Profiler
- type Settings
- type Tracer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InstrumentAWSSession ¶
func InstrumentAWSSession(session *awssession.Session, settings Settings) *awssession.Session
InstrumentAWSSession configures DD tracing mode.
func InstrumentDatabase ¶
InstrumentDatabase adds callbacks for tracing, call TraceDatabase to make it work
func InstrumentRedis ¶ added in v1.30.0
func InstrumentRedis(client redis.UniversalClient, applicationName string)
Types ¶
type Config ¶
type Config struct { Enabled bool `mapstructure:"enabled"` ServiceName string `mapstructure:"service_name"` ServiceVersion string `mapstructure:"service_version"` // Enable Profiler Code Hotspots feature CodeHotspotsEnabled bool `mapstructure:"code_hotspots_enabled"` // Enable runtime metrics. RuntimeMetricsEnabled bool `mapstructure:"runtime_metrics_enabled"` // contains filtered or unexported fields }
type LogContext ¶
type LogContext struct { // TraceID returns the trace ID that this context is carrying. TraceID uint64 // SpanID returns the span ID that this context is carrying. SpanID uint64 }
LogContext represents a log state that can be used to collerate logs emitted across the request cycle.
func TraceLogs ¶
func TraceLogs(ctx context.Context) *LogContext
TraceLogs extracts and returns a LogContext for Logs.
type Profiler ¶
type Profiler struct {
// contains filtered or unexported fields
}
Profiler wraps DataDog profiles exporter.
func NewProfiler ¶
NewProfiler constructs new profiler with options. You can include common options like: profiler.WithService(appName), profiler.WithVersion(version).
type Tracer ¶
type Tracer struct { Enabled bool Environment string Options []tracer.StartOption // contains filtered or unexported fields }
Tracer is a "controller" to a ddtrace.tracer.
Tracer is not exactly a "wrapper" because the tracer is a private/global entity in the tracer library and it's not directly accessible. - https://godoc.org/gopkg.in/DataDog/dd-trace-go.v1/ddtrace/tracer#Start - https://github.com/DataDog/dd-trace-go/blob/v1.19.0/ddtrace/tracer/tracer.go
Tracer specifies an implementation of the Datadog tracer which allows starting and propagating spans.
func NewTracer ¶
func NewTracer(config *Config, options ...tracer.StartOption) *Tracer
NewTracer returns a new tracer with the giver configuration and an optional list of ddtrace's tracer.StartOptions.
NewTracer assigns universal the version of the service that is running, and will be applied to all spans, regardless of whether span service name and config service name match.