Documentation
¶
Index ¶
- Constants
- type AttrAdapter
- type AttrsAdapter
- type Config
- type LokiHandler
- func (h *LokiHandler) Close() error
- func (h *LokiHandler) Enabled(ctx context.Context, level slog.Level) bool
- func (h *LokiHandler) Handle(ctx context.Context, r slog.Record) error
- func (h *LokiHandler) WithAttrs(attrs []slog.Attr) slog.Handler
- func (h *LokiHandler) WithGroup(name string) slog.Handler
- type LokiNextHandler
- type Option
Constants ¶
View Source
const ( BatchWait = 500 * time.Millisecond BatchSize int = 512 MinBackoff = 500 * time.Millisecond MaxBackoff = 5 * time.Minute MaxRetries int = 10 Timeout = 10 * time.Second QueueMaxSize int = 10 * 1024 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AttrAdapter ¶
type AttrAdapter struct {
Name, Value string
}
type AttrsAdapter ¶
type AttrsAdapter []AttrAdapter
func (AttrsAdapter) MarshalJSON ¶
func (ls AttrsAdapter) MarshalJSON() ([]byte, error)
Marshal as a map
type Config ¶
type Config struct {
// HTTP host
URL string
// Log level
Level slog.Leveler
// X-Scope-OrgID
TenantID string
// Batch size and max wait time
BatchSize int
BatchWait time.Duration
// Local queue size
QueueMaxSize int
// Backoff/retries
MinBackoff time.Duration
MaxBackoff time.Duration
MaxRetries int
// Timeout
Timeout time.Duration
}
func NewDefaultConfig ¶
type LokiHandler ¶
type LokiHandler struct {
// contains filtered or unexported fields
}
func NewLokiHandler ¶
func NewLokiHandler(config *Config, labels map[string]string) (*LokiHandler, error)
func (*LokiHandler) Close ¶
func (h *LokiHandler) Close() error
type LokiNextHandler ¶
type LokiNextHandler struct {
// contains filtered or unexported fields
}
Click to show internal directories.
Click to hide internal directories.