Documentation ¶
Index ¶
- func AddNewTagKey(views []*view.View, key *tag.Key) []*view.View
- func AddSpanToFasthttpContext(ctx *fasthttp.RequestCtx, span trace.Span)
- func AddSpanToRequest(r *http.Request, span trace.Span)
- func BinaryFromSpanContext(sc trace.SpanContext) []byte
- func CreateRulesMap(rules []config.MetricsRule) error
- func GetTraceSamplingRate(rate string) float64
- func IsTracingEnabled(rate string) bool
- func NewMeasureView(measure stats.Measure, keys []tag.Key, aggregation *view.Aggregation) *view.View
- func SpanContextFromBinary(b []byte) (sc trace.SpanContext, ok bool)
- func SpanFromContext(ctx context.Context) trace.Span
- func WithTags(name string, opts ...interface{}) []tag.Mutator
- type NullExporter
- type StdoutExporter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddNewTagKey ¶
AddNewTagKey adds new tag keys to existing view.
func AddSpanToFasthttpContext ¶ added in v1.12.0
func AddSpanToFasthttpContext(ctx *fasthttp.RequestCtx, span trace.Span)
AddSpanToFasthttpContext adds the span to the fasthttp request context. TODO: Remove fasthttp compatibility when no HTTP API using contexts depend on fasthttp.
func AddSpanToRequest ¶ added in v1.12.0
AddSpanToRequest sets span into a request context.
func BinaryFromSpanContext ¶ added in v1.9.0
func BinaryFromSpanContext(sc trace.SpanContext) []byte
BinaryFromSpanContext returns the binary format representation of a SpanContext.
If sc is the zero value, Binary returns nil.
func CreateRulesMap ¶ added in v1.10.0
func CreateRulesMap(rules []config.MetricsRule) error
CreateRulesMap generates a fast lookup map for metrics regex.
func GetTraceSamplingRate ¶ added in v0.7.0
GetTraceSamplingRate parses the given rate and returns the parsed rate.
func IsTracingEnabled ¶ added in v0.8.0
IsTracingEnabled parses the given rate and returns false if sampling rate is explicitly set 0.
func NewMeasureView ¶
func NewMeasureView(measure stats.Measure, keys []tag.Key, aggregation *view.Aggregation) *view.View
NewMeasureView creates opencensus View instance using stats.Measure.
func SpanContextFromBinary ¶ added in v1.9.0
func SpanContextFromBinary(b []byte) (sc trace.SpanContext, ok bool)
SpanContextFromBinary returns the SpanContext represented by b.
If b has an unsupported version ID or contains no TraceID, SpanContextFromBinary returns with ok==false.
func SpanFromContext ¶ added in v0.8.0
SpanFromContext returns the Span stored in a context, or nil or trace.noopSpan{} if there isn't one.
Types ¶
type NullExporter ¶ added in v1.11.0
type NullExporter struct{}
NullExporter implements an open telemetry span exporter that discards all telemetry.
func NewNullExporter ¶ added in v1.11.0
func NewNullExporter() *NullExporter
NewNullExporter returns a NullExporter
func (*NullExporter) ExportSpans ¶ added in v1.11.0
func (e *NullExporter) ExportSpans(ctx context.Context, spans []sdktrace.ReadOnlySpan) error
ExportSpans implements the open telemetry span exporter interface.
type StdoutExporter ¶ added in v0.10.0
type StdoutExporter struct {
// contains filtered or unexported fields
}
StdoutExporter implements an open telemetry span exporter that writes to stdout.
func NewStdOutExporter ¶ added in v1.9.0
func NewStdOutExporter() *StdoutExporter
NewStdOutExporter returns a StdOutExporter
func (*StdoutExporter) ExportSpans ¶ added in v1.9.0
func (e *StdoutExporter) ExportSpans(ctx context.Context, spans []sdktrace.ReadOnlySpan) error
ExportSpans implements the open telemetry span exporter interface.