Documentation ¶
Overview ¶
Package otelzap writes zap logs as OTEL events.
Index ¶
- func Any(key string, value interface{}) attribute.KeyValue
- func AppendZapFields(attributes []attribute.KeyValue, fields ...zapcore.Field) []attribute.KeyValue
- func HTTPHeader(key string, header http.Header, exclude map[string]bool) attribute.KeyValue
- func SpanLogger(span trace.Span, logger *zap.Logger) *zap.Logger
- func SpanLoggerFromContext(ctx context.Context, logger *zap.Logger) *zap.Logger
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AppendZapFields ¶ added in v0.1.2
AppendZapFields converts and appends a few ZAP fields.
func HTTPHeader ¶ added in v0.1.1
HTTPHeader converts HTTP headers into OpenTelemetry attribute as multi-line string. The HTTP headers to exclude should be in canonical form (see textproto.CanonicalMIMEHeaderKey).
func SpanLogger ¶
SpanLogger creates ZAP logger which also writes to OpenTelemetry span. If span is `nil“ or `no-op` then the same logger returned.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.