Skip to content

Commit

Permalink
Merge pull request #174 from flc1125/client-support-log
Browse files Browse the repository at this point in the history
feat: support for ForceFlush of LoggerProvider and unified naming
  • Loading branch information
vmihailenco authored Sep 15, 2024
2 parents ad257c4 + d61132b commit 6eff1e4
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions uptrace/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"go.opentelemetry.io/otel"
"go.opentelemetry.io/otel/attribute"
sdklog "go.opentelemetry.io/otel/sdk/log"
"go.opentelemetry.io/otel/sdk/metric"
sdkmetric "go.opentelemetry.io/otel/sdk/metric"
sdktrace "go.opentelemetry.io/otel/sdk/trace"
"go.opentelemetry.io/otel/trace"
)
Expand All @@ -21,7 +21,7 @@ type client struct {
tracer trace.Tracer

tp *sdktrace.TracerProvider
mp *metric.MeterProvider
mp *sdkmetric.MeterProvider
lp *sdklog.LoggerProvider
}

Expand Down Expand Up @@ -65,6 +65,11 @@ func (c *client) ForceFlush(ctx context.Context) (lastErr error) {
lastErr = err
}
}
if c.lp != nil {
if err := c.lp.ForceFlush(ctx); err != nil {
lastErr = err
}
}
return lastErr
}

Expand Down

0 comments on commit 6eff1e4

Please sign in to comment.