Documentation
¶
Index ¶
- func ContextWithTracer(ctx context.Context, tracer trace.Tracer) context.Context
- func StartSpan(ctx context.Context, name string, opts ...trace.SpanStartOption) (context.Context, trace.Span)
- func TracerFromContext(ctx context.Context) (trace.Tracer, bool)
- type Encoder
- type MetricFileExporter
- func (m *MetricFileExporter) Aggregation(k metric.InstrumentKind) metric.Aggregation
- func (m *MetricFileExporter) Export(ctx context.Context, data *metricdata.ResourceMetrics) error
- func (m *MetricFileExporter) ForceFlush(ctx context.Context) error
- func (m *MetricFileExporter) Shutdown(ctx context.Context) error
- func (m *MetricFileExporter) Temporality(k metric.InstrumentKind) metricdata.Temporality
- type ShutdownFunc
- type TraceRestorer
- type TraceUploader
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ContextWithTracer ¶
ContextWithTracer returns a new context.Context that contains the provided tracer.
func StartSpan ¶
func StartSpan( ctx context.Context, name string, opts ...trace.SpanStartOption, ) (context.Context, trace.Span)
StartSpan creates a span and a context.Context containing the newly-created span.
If the context.Context provided in `ctx` contains a Span then the newly-created Span will be a child of that span, otherwise it will be a root span. This behavior can be overridden by providing `WithNewRoot()` as a SpanOption, causing the newly-created Span to be a root span even if `ctx` contains a Span.
When creating a Span it is recommended to provide all known span attributes using the `WithAttributes()` SpanOption as samplers will only have access to the attributes provided when a Span is created.
Any Span that is created MUST also be ended. This is the responsibility of the user. Implementations of this API may leak memory or other resources if Spans are not ended.
Types ¶
type MetricFileExporter ¶
type MetricFileExporter struct {
// contains filtered or unexported fields
}
func NewMetricFileExporter ¶
func NewMetricFileExporter() *MetricFileExporter
func (*MetricFileExporter) Aggregation ¶
func (m *MetricFileExporter) Aggregation(k metric.InstrumentKind) metric.Aggregation
func (*MetricFileExporter) Export ¶
func (m *MetricFileExporter) Export(ctx context.Context, data *metricdata.ResourceMetrics) error
func (*MetricFileExporter) ForceFlush ¶
func (m *MetricFileExporter) ForceFlush(ctx context.Context) error
func (*MetricFileExporter) Shutdown ¶
func (m *MetricFileExporter) Shutdown(ctx context.Context) error
Shutdown replaces the encoder with a shutdownEncoder, which always returns errShutdown when Encode is called.
func (*MetricFileExporter) Temporality ¶
func (m *MetricFileExporter) Temporality(k metric.InstrumentKind) metricdata.Temporality
type ShutdownFunc ¶
func InitTracer ¶
type TraceRestorer ¶
type TraceRestorer interface {
RestoreTraces() []*coltracepb.ExportTraceServiceRequest
}
type TraceUploader ¶
type TraceUploader struct {
// contains filtered or unexported fields
}
func NewTraceUploader ¶
func NewTraceUploader(restorer TraceRestorer) *TraceUploader