-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
281 additions
and
124 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// Copyright (c) 2024 The sloth authors | ||
// Use of this source code is governed by a MIT license found in the LICENSE file. | ||
|
||
package otel | ||
|
||
// WithRecordEvent enables recording log records as trace span's events. | ||
// If passThrough is true, the log record will pass through to the next handler. | ||
// | ||
// If the level is less than slog.LevelError, the log record will be recorded as an event. | ||
// Otherwise. the log record will be recorded as an exception event and set the status of span to Error. | ||
func WithRecordEvent(passThrough bool) Option { | ||
return func(options *options) { | ||
options.recordEvent = true | ||
options.passThrough = passThrough | ||
} | ||
} | ||
|
||
type ( | ||
// Option configures the Handler with specific options. | ||
Option func(*options) | ||
options Handler | ||
) |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.