Skip to content

Commit

Permalink
Update bridges/otelzerolog/hook.go
Browse files Browse the repository at this point in the history
  • Loading branch information
pellared authored Jul 22, 2024
1 parent 798223f commit ff58f84
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions bridges/otelzerolog/hook.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@

// Package otelzerolog provides a [Hook], a [zerolog.Hook] implementation that
// can be used to bridge between the [zerolog] API and [OpenTelemetry].
// Note: otelzerolog is a basic implementation and does not support adding custom fields.

//
// # Record Conversion
//
// The [zerolog.event] records are converted to OpenTelemetry [log.Record] in
Expand All @@ -13,6 +12,7 @@
// - Message is set as the Body using a [log.StringValue].
// - Level is transformed and set as the Severity. The SeverityText is also
// set.
//
// The Level is transformed to the OpenTelemetry Severity types in the following way.
//
// - [zerolog.DebugLevel] is transformed to [log.SeverityDebug]
Expand All @@ -21,8 +21,11 @@
// - [zerolog.ErrorLevel] is transformed to [log.SeverityError]
// - [zerolog.PanicLevel] is transformed to [log.SeverityFatal1]
// - [zerolog.FatalLevel] is transformed to [log.SeverityFatal2]
//
//
// NOTE: Fields are not transformed because of https://github.com/rs/zerolog/issues/493.
//
// [OpenTelemetry]: https://opentelemetry.io/docs/concepts/signals/logs/

package otelzerolog // import "go.opentelemetry.io/contrib/bridges/otelzerolog"

import (
Expand Down

0 comments on commit ff58f84

Please sign in to comment.