OpenTelemetry integration with ZAP logger.
Released under the MIT License.
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
}