Skip to content

Pilatuz/otelzap

Repository files navigation

otelzap GoDoc Build Status Coverage Status Go Report Card

OpenTelemetry integration with ZAP logger.

Released under the MIT License.

Quick start

This package can be used to add regular log messages as OpenTelemetry events.

func MyAction(ctx context.Context, foo int) {
    ctx, span := tracer.Start(ctx, "MyAction")
    defer span.End()

    LOG := otelzap.SpanLogger(span, logger)

    LOG.Debug("do my action", zap.Int("foo", foo))
    // will write to stdout as normal zap logger does
    // and also will add "do my action" event to the span
}

About

OpenTelemetry integration with ZAP logger

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages