Releases: yakumioto/otelslog
Releases · yakumioto/otelslog
v1.1.0
Key Features & Improvements:
- Implemented context-based trace span creation for better trace lifecycle management
- Optimized key structure hierarchy for improved efficiency
- Fixed trace discontinuity issues when chaining .WithGroup().With().Info() methods
- Refactored complex code logic to enhance maintainability
This release focuses on improving trace reliability while making the codebase more efficient and maintainable.
Full Changelog: v1.0.0...v1.1.0
v1.0.0
First stable release of otelslog, a Go package that seamlessly integrates structured logging (slog) with OpenTelemetry tracing.
Features
- Automatic correlation between logs and traces via trace/span ID injection
- Flexible span creation based on log levels with support for mandatory spans
- Rich support for nested attribute groups in logs and traces
- Thread-safe operation for concurrent use
- Customizable configuration through functional options
Installation
go get github.com/yakumioto/otelslog
Basic Usage
slog.SetDefault(slog.New(
otelslog.NewHandler(slog.NewJSONHandler(os.Stdout, nil)),
))
span := otelslog.NewSpan("process-request")
slog.Info("handling request", "operation", span)
defer span.End()