Skip to content

v0.3.0

Choose a tag to compare

@mikluko mikluko released this 22 Jun 13:19
· 4 commits to main since this release
8531be0

What's Changed

  • refactor: split slogging into pretty package
  • feat: add service_name to otel trace attributes

Breaking Changes

Package Structure:

  • slogging package split into pretty and otel packages
  • Import path changes required:
    // Old
    import "github.com/mikluko/slogging"
    
    // New  
    import "github.com/mikluko/slogging/pretty"
    import "github.com/mikluko/slogging/otel"

API Changes:

  • New()pretty.NewHandler()
  • WithDestinationWriter()WithWriter()
  • WithOutputEmptyAttrs()WithOutputEmptyAttrs(true)
  • OpenTelemetry tracing moved to separate otel.Wrap() wrapper

New Features

OpenTelemetry Integration:

  • Dedicated otel package for tracing integration
  • Automatic extraction of service_name from OpenTelemetry resources
  • Filters out default unknown_service:* names
  • Zero overhead when no tracing context present
  • Trace attributes always at root level regardless of log groups

Pretty Handler Improvements:

  • Cleaner API with options-based constructor
  • Exported Encoder type for external use
  • Added WithLevel() option for consistency

Performance

  • Otel handler: ~1.4% overhead without tracing, ~70% with active spans
  • No memory leaks: All allocations are request-scoped
  • Service name extraction: Minimal 4% performance impact

Upgrade Effort: MESO

This release requires moderate effort to upgrade due to package restructuring and API changes.

Full Changelog: v0.2.0...v0.3.0