Documentation ¶
Index ¶
- Constants
- func GetTraceIDListByRuleID(ruleID string, limit int64) ([]string, error)
- func GetTracer() trace.Tracer
- func InitTracer() error
- func SetTracer(config *TracerConfig) error
- type GlobalTracerManager
- func (g *GlobalTracerManager) GetTraceById(traceID string) (root *LocalSpan, err error)
- func (g *GlobalTracerManager) GetTraceByRuleID(ruleID string, limit int64) ([]string, error)
- func (g *GlobalTracerManager) InitIfNot()
- func (g *GlobalTracerManager) SetTracer(enableRemote bool, serviceName, endpoint string) error
- type LocalLink
- type LocalSpan
- type LocalSpanMemoryStorage
- type LocalSpanStorage
- type Queue
- type SpanExporter
- func (l *SpanExporter) ExportSpans(ctx context.Context, spans []sdktrace.ReadOnlySpan) error
- func (l *SpanExporter) GetTraceById(traceID string) (*LocalSpan, error)
- func (l *SpanExporter) GetTraceByRuleID(ruleID string, limit int64) ([]string, error)
- func (l *SpanExporter) Shutdown(ctx context.Context) error
- type TracerConfig
Constants ¶
View Source
const (
TraceCfgKey = "$$tracer_cfg"
)
Variables ¶
This section is empty.
Functions ¶
func GetTraceIDListByRuleID ¶
func InitTracer ¶
func InitTracer() error
func SetTracer ¶
func SetTracer(config *TracerConfig) error
Types ¶
type GlobalTracerManager ¶
type GlobalTracerManager struct { sync.RWMutex Init bool ServiceName string EnableRemoteEndpoint bool RemoteEndpoint string SpanExporter *SpanExporter }
func (*GlobalTracerManager) GetTraceById ¶
func (g *GlobalTracerManager) GetTraceById(traceID string) (root *LocalSpan, err error)
func (*GlobalTracerManager) GetTraceByRuleID ¶
func (g *GlobalTracerManager) GetTraceByRuleID(ruleID string, limit int64) ([]string, error)
func (*GlobalTracerManager) InitIfNot ¶
func (g *GlobalTracerManager) InitIfNot()
type LocalSpan ¶
type LocalSpan struct { Name string `json:"name"` TraceID string `json:"traceID"` SpanID string `json:"spanID"` ParentSpanID string `json:"parentSpanID,omitempty"` Attribute map[string]interface{} `json:"attribute,omitempty"` Links []LocalLink `json:"links,omitempty"` StartTime time.Time `json:"startTime"` EndTime time.Time `json:"endTime"` RuleID string `json:"ruleID"` ChildSpan []*LocalSpan }
func FromReadonlySpan ¶
func FromReadonlySpan(readonly sdktrace.ReadOnlySpan) *LocalSpan
func GetSpanByTraceID ¶
type LocalSpanMemoryStorage ¶
func (*LocalSpanMemoryStorage) GetTraceById ¶
func (l *LocalSpanMemoryStorage) GetTraceById(traceID string) (*LocalSpan, error)
func (*LocalSpanMemoryStorage) GetTraceByRuleID ¶
func (l *LocalSpanMemoryStorage) GetTraceByRuleID(ruleID string, limit int64) ([]string, error)
func (*LocalSpanMemoryStorage) SaveSpan ¶
func (l *LocalSpanMemoryStorage) SaveSpan(span sdktrace.ReadOnlySpan) error
type LocalSpanStorage ¶
type Queue ¶
type Queue struct {
// contains filtered or unexported fields
}
Queue is traceID FIFO queue with sized capacity
type SpanExporter ¶
type SpanExporter struct {
// contains filtered or unexported fields
}
func NewSpanExporter ¶
func NewSpanExporter(remoteCollector bool, remoteEndpoint string) (*SpanExporter, error)
func (*SpanExporter) ExportSpans ¶
func (l *SpanExporter) ExportSpans(ctx context.Context, spans []sdktrace.ReadOnlySpan) error
func (*SpanExporter) GetTraceById ¶
func (l *SpanExporter) GetTraceById(traceID string) (*LocalSpan, error)
func (*SpanExporter) GetTraceByRuleID ¶
func (l *SpanExporter) GetTraceByRuleID(ruleID string, limit int64) ([]string, error)
type TracerConfig ¶
type TracerConfig struct { EnableRemoteCollector bool `json:"enableRemoteCollector"` ServiceName string `json:"serviceName"` RemoteEndpoint string `json:"remoteEndpoint"` }
func TracerConfigFromConf ¶
func TracerConfigFromConf() *TracerConfig
Click to show internal directories.
Click to hide internal directories.