Versions in this module Expand all Collapse all v1 v1.1.5 Nov 25, 2022 v1.1.3 Nov 14, 2022 Changes in this version type Tag + const TagHTTPStatusCode + const TagRPCStatusCode v1.1.2 Nov 14, 2022 Changes in this version type Tag + const TagHTTPHost v1.1.1 Nov 14, 2022 Changes in this version + const ComponentIDHttpServer + const EmptyServiceInstanceName + const EmptyServiceName + const EmptySpanID + const EmptyTraceID + const EmptyTraceSegmentID + const InstanceCPUUsedRate + const InstanceGolangGCCount + const InstanceGolangGCTime + const InstanceGolangGoroutineNum + const InstanceGolangHeap + const InstanceGolangStack + const InstanceGolangThreadNum + const InstanceMemUsedRate + func GetCorrelation(ctx context.Context, key string) string + func InitMetricCollector(reporter MetricsReporter, interval *time.Duration, cancelCtx context.Context) + func PutCorrelation(ctx context.Context, key, value string) bool + func ServiceInstanceName(ctx context.Context) string + func ServiceName(ctx context.Context) string + func SetGlobalTracer(tracer *Tracer) + func SpanID(ctx context.Context) int32 + func TraceID(ctx context.Context) string + func TraceSegmentID(ctx context.Context) string + func WithSpan(ctx context.Context, span Span) context.Context + type AgentConfigChangeWatcher interface + Key func() string + Notify func(eventType AgentConfigEventType, newValue string) + Value func() string + type AgentConfigEventType int32 + const DELETED + const MODIFY + type ConfigDiscoveryService struct + UUID string + func NewConfigDiscoveryService() *ConfigDiscoveryService + func (s *ConfigDiscoveryService) BindWatchers(watchers []AgentConfigChangeWatcher) + func (s *ConfigDiscoveryService) HandleCommand(command *common.Command) + type ConstSampler struct + func NewConstSampler(sample bool) *ConstSampler + func (s *ConstSampler) IsSampled(operation string) bool + type CorrelationConfig struct + MaxKeyCount int + MaxValueSize int + type DefaultLogData struct + LogContent string + LogCtx context.Context + LogErrLevel string + func (l *DefaultLogData) Context() context.Context + func (l *DefaultLogData) Data() string + func (l *DefaultLogData) ErrorLevel() string + type DynamicSampler struct + func NewDynamicSampler(samplingRate float64, tracer *Tracer) *DynamicSampler + func (s *DynamicSampler) IsSampled(operation string) bool + func (s *DynamicSampler) Key() string + func (s *DynamicSampler) Notify(eventType AgentConfigEventType, newValue string) + func (s *DynamicSampler) Value() string + type MetricCollector struct + type MetricsReporter interface + SendMetrics func(runTimeMeter RunTimeMetric) + type NoopSpan struct + func (*NoopSpan) End() + func (*NoopSpan) Error(time.Time, ...string) + func (*NoopSpan) GetOperationName() string + func (*NoopSpan) IsEntry() bool + func (*NoopSpan) IsExit() bool + func (*NoopSpan) IsValid() bool + func (*NoopSpan) Log(time.Time, ...string) + func (*NoopSpan) SetComponent(int32) + func (*NoopSpan) SetOperationName(string) + func (*NoopSpan) SetPeer(string) + func (*NoopSpan) SetSpanLayer(agentv3.SpanLayer) + func (*NoopSpan) Tag(Tag, string) + type RandomSampler struct + func NewRandomSampler(samplingRate float64) *RandomSampler + func (s *RandomSampler) IsSampled(operation string) bool + type ReportedLogData interface + Context func() context.Context + Data func() string + ErrorLevel func() string + type ReportedSpan interface + ComponentID func() int32 + Context func() *SegmentContext + EndTime func() int64 + IsError func() bool + Logs func() []*agentv3.Log + OperationName func() string + Peer func() string + Refs func() []*propagation.SpanContext + SpanLayer func() agentv3.SpanLayer + SpanType func() agentv3.SpanType + StartTime func() int64 + Tags func() []*commonv3.KeyStringValuePair + type Reporter interface + Boot func(service string, serviceInstance string, cdsWatchers []AgentConfigChangeWatcher) + Close func() + Send func(spans []ReportedSpan) + SendLog func(logData ReportedLogData) + type RunTimeMetric struct + CpuUsedRate float64 + GCCount int64 + GCPauseTime int64 + GoroutineNum int64 + HeapAlloc int64 + MemUsedRate float64 + StackInUse int64 + ThreadNum int64 + Time int64 + type Sampler interface + IsSampled func(operation string) (sampled bool) + type SegmentContext struct + CorrelationContext map[string]string + FirstSpan Span + ParentSegmentID string + ParentSpanID int32 + SegmentID string + SpanID int32 + TraceID string + type SkyLogger struct + func NewSkyLogger(reporter Reporter) (error, *SkyLogger) + func (l *SkyLogger) WriteLogWithContext(ctx context.Context, level string, data string) + type Span interface + End func() + Error func(time.Time, ...string) + GetOperationName func() string + IsEntry func() bool + IsExit func() bool + IsValid func() bool + Log func(time.Time, ...string) + SetComponent func(int32) + SetOperationName func(string) + SetPeer func(string) + SetSpanLayer func(agentv3.SpanLayer) + Tag func(Tag, string) + func ActiveSpan(ctx context.Context) Span + type SpanOption func(s *defaultSpan) + func WithContext(sc *propagation.SpanContext) SpanOption + func WithOperationName(operationName string) SpanOption + func WithSpanType(spanType SpanType) SpanOption + type SpanType int32 + const SpanTypeEntry + const SpanTypeExit + const SpanTypeLocal + type Tag string + const TagDBInstance + const TagDBSqlParameters + const TagDBStatement + const TagDBType + const TagHTTPMethod + const TagMQBroker + const TagMQQueue + const TagMQTopic + const TagStatusCode + const TagURL + type Tracer struct + func GetGlobalTracer() *Tracer + func NewTracer(service string, opts ...TracerOption) (tracer *Tracer, err error) + func (t *Tracer) CreateEntrySpan(ctx context.Context, operationName string, extractor propagation.Extractor) (s Span, nCtx context.Context, err error) + func (t *Tracer) CreateExitSpan(ctx context.Context, operationName string, peer string, ...) (s Span, err error) + func (t *Tracer) CreateExitSpanWithContext(ctx context.Context, operationName string, peer string, ...) (s Span, nCtx context.Context, err error) + func (t *Tracer) CreateLocalSpan(ctx context.Context, opts ...SpanOption) (s Span, c context.Context, err error) + type TracerOption func(t *Tracer) + func WithCorrelation(keyCount, valueSize int) TracerOption + func WithCustomSampler(sampler Sampler) TracerOption + func WithInstance(instance string) TracerOption + func WithReporter(reporter Reporter) TracerOption + func WithSampler(samplingRate float64) TracerOption