1
0
mirror of https://github.com/open-telemetry/opentelemetry-go.git synced 2025-11-29 23:07:45 +02:00

Creates a internal facing logging interface

This is a simple loggin interface to be used interally for the sdk.
Included is an exmaple in `namedtracer` run:
```
cd example/namedtracer
go run . >/dev/null
```
This commit is contained in:
Aaron Clawson
2021-11-03 16:18:50 +00:00
committed by GitHub
parent dc888a9802
commit 8d0b098602
36 changed files with 217 additions and 0 deletions

View File

@@ -22,6 +22,7 @@ import (
"time"
"go.opentelemetry.io/otel"
"go.opentelemetry.io/otel/internal/debug"
"go.opentelemetry.io/otel/trace"
)
@@ -224,6 +225,7 @@ func WithBlocking() BatchSpanProcessorOption {
// exportSpans is a subroutine of processing and draining the queue.
func (bsp *batchSpanProcessor) exportSpans(ctx context.Context) error {
bsp.timer.Reset(bsp.o.BatchTimeout)
bsp.batchMutex.Lock()
@@ -236,6 +238,7 @@ func (bsp *batchSpanProcessor) exportSpans(ctx context.Context) error {
}
if l := len(bsp.batch); l > 0 {
debug.Log.V(5).Info("exporting spans", "count", len(bsp.batch))
err := bsp.e.ExportSpans(ctx, bsp.batch)
// A new batch is always created after exporting, even if the batch failed to be exported.