What's Changed
Added
-
Sentry Error Tracking Adapter - Enterprise-grade error monitoring integration (#63)
- Automatic error capture with stack traces and breadcrumbs
- Transaction tracking for distributed tracing
- 7 sampling strategies: fixed, adaptive, priority, burst detection, group-based, profiles, and custom
- Retry logic with exponential backoff for network resilience
- Real-time metrics and observability with atomic counters
- Message template interpolation in Sentry UI
- Performance optimized: stack trace caching (60.74 ns/op), retry calculation (11.07 ns/op)
- Separate module at
github.com/willibrandon/mtlog/adapters/sentry
-
Context Deadline Awareness - Automatic timeout warnings (#48)
- Automatically detects and warns when operations approach context deadlines
- Configurable warning threshold (e.g., warn when <100ms remaining)
- Adds properties:
DeadlineRemaining,DeadlineAt,DeadlineApproaching - Optionally upgrades log level (Info → Warning) when deadline is near
- Zero-cost when context has no deadline
- Perfect for HTTP handlers, database operations, and microservice calls
-
Per-Message Sampling - Adaptive log volume control (#61)
- Multiple sampling strategies: counter-based, rate-based, time-based, first-N, group-based, conditional, exponential backoff
- Adaptive sampling automatically adjusts rate to maintain target events/second
- Oscillation prevention with hysteresis threshold and dampening factor
- Profile versioning with semantic versioning and migration policies
- Thread-safe, immutable profile registry with freeze capability
- Performance: 17ns for simple sampling decisions, 209ns with properties
- Fluent configuration API with predefined dampening presets
-
Conditional and Router Sinks - Advanced event routing (#60)
- Zero-overhead conditional routing (3.7ns when predicate returns false)
- Flexible routing modes: FirstMatch (exclusive) and AllMatch (broadcast)
- Production resilience: circuit breakers, health checks, fallback sinks
- Enterprise monitoring: Prometheus metrics, Grafana dashboards
- Runtime management: add/remove routes and groups dynamically
- 11 documented routing patterns for real-world scenarios
- JSON configuration support via existing configuration builder
-
HTTP Middleware - Multi-framework request/response logging (#59)
- Support for net/http, Gin, Echo, Fiber, and Chi frameworks
- Request/response logging with configurable fields and timing
- Request ID generation and propagation with multiple header support
- Context injection for nested logging with helper methods
- Configurable log levels based on HTTP status codes
- Advanced sampling strategies: rate-based, adaptive, path-based, composite
- Object pooling for zero-allocation paths (~2.3μs per request overhead)
- Distributed tracing support (W3C Trace Context, B3, X-Ray)
- Panic recovery with detailed stack traces
- Separate module at
github.com/willibrandon/mtlog/adapters/middleware
-
RenderMessage() Method - Public API for rendering message templates (#64)
- New
RenderMessage()method oncore.LogEventfor custom sinks - Properly handles capturing operators (
{@Property}), scalar hints ({$Property}), and format specifiers ({Property:format}) - Enables custom sinks to render message templates without accessing internal parser
- Returns the original template as fallback if parsing fails
- Example:
message := event.RenderMessage()renders the template with all properties
- New
-
Zed Extension - Full editor support via Language Server Protocol (#56)
- New
mtlog-lspcommand providing LSP wrapper for mtlog-analyzer - Native Zed extension using Rust/WASM (wasm32-wasip2 target)
- Real-time diagnostics for all MTLOG001-MTLOG013 issues
- Code actions with quick fixes for common problems
- Automatic binary detection in standard Go paths
- Configurable analyzer flags and custom paths
- Proper UTF-16 code unit handling for accurate text positioning
- Comprehensive CI/CD integration with GitHub Actions
- New
Installation
mtlog Library
go get github.com/willibrandon/mtlog@v0.10.0mtlog-analyzer Tool
Download the binary for your platform below.
VS Code Extension
Install from the VS Code Marketplace or download the .vsix file below.
GoLand Plugin
Install from JetBrains Marketplace or download the .zip file below.
Neovim Plugin
-- Using lazy.nvim
{
'willibrandon/mtlog',
rtp = 'neovim-plugin',
ft = 'go',
tag = 'v0.10.0',
config = function()
require('mtlog').setup()
end,
}Or download the .tar.gz file below for manual installation.
Full Changelog: v0.9.0...v0.10.0