Documentation ¶
Index ¶
- func Init(cfg *config.AgentConfig) func()
- func NewHttpOperationMetricsHandler() sdk.HttpOperationMetricsHandler
- func SpanFromContext(ctx context.Context) sdk.Span
- func StartSpan(ctx context.Context, name string, opts *sdk.SpanOptions) (context.Context, sdk.Span, func())
- type Span
- func (s *Span) AddEvent(name string, _ time.Time, attributes map[string]interface{})
- func (s *Span) GetAttributes() sdk.AttributeList
- func (s *Span) IsNoop() bool
- func (s *Span) SetAttribute(key string, value interface{})
- func (s *Span) SetError(err error)
- func (s *Span) SetStatus(code sdk.Code, message string)
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Init ¶
func Init(cfg *config.AgentConfig) func()
Init initializes opencensus tracing and returns a shutdown function to flush data immediately on a termination signal.
Example ¶
cfg := config.Load() cfg.ServiceName = config.String("my_example_svc") cfg.DataCapture.HttpHeaders.Request = config.Bool(true) cfg.Reporting.Endpoint = config.String("https://api.traceable.ai:9411/api/v2/spans") shutdown := Init(cfg) defer shutdown()
Output:
func NewHttpOperationMetricsHandler ¶ added in v0.12.0
func NewHttpOperationMetricsHandler() sdk.HttpOperationMetricsHandler
Types ¶
type Span ¶
func (*Span) GetAttributes ¶ added in v0.6.0
func (s *Span) GetAttributes() sdk.AttributeList
func (*Span) SetAttribute ¶
Click to show internal directories.
Click to hide internal directories.