Documentation
¶
Overview ¶
Package heterolog provides structured logging to files, standard output, Slack, OpenSearch, Loki, CloudWatch Logs, and ClickHouse.
Start with DefaultConfig and New, and call Close or Shutdown when the application exits to flush buffered logs and release owned resources. Configuration is explicit: importing this package or constructing a logger does not load environment files, install signal handlers, or change the process-wide slog logger or OpenTelemetry providers. To configure loggers from HETEROLOG_ environment variables and an env file, call LoadEnvConfig.
Advanced backend and durability settings are available in pkg/logger and its related public packages. A configuration must not be modified while a logger constructed from it is in use.
Index ¶
- Constants
- Variables
- type AsyncConfig
- type AsyncLogger
- type AsyncRuntime
- type BackendSpoolRunnerConfig
- type Config
- type Counter
- type DeliveryConfig
- type DeliveryLogger
- type DeliveryReport
- type DeliveryRuntime
- type EnvConfig
- func (c *EnvConfig) AsyncConfig() (AsyncConfig, []Option, error)
- func (c *EnvConfig) Config() (Config, []Option, error)
- func (c *EnvConfig) DeliveryConfig() (DeliveryConfig, []Option, error)
- func (c *EnvConfig) New(ctx context.Context, opts ...Option) (*Runtime, error)
- func (c *EnvConfig) NewAsync(ctx context.Context, opts ...Option) (*AsyncRuntime, error)
- func (c *EnvConfig) NewDelivery(ctx context.Context, opts ...Option) (*DeliveryRuntime, error)
- type EnvFileError
- type Field
- func Any(key string, value any) (Field, error)
- func Bool(key string, value bool) (Field, error)
- func Float64(key string, value float64) (Field, error)
- func Int(key string, value int) (Field, error)
- func Int64(key string, value int64) (Field, error)
- func String(key, value string) (Field, error)
- func Uint64(key string, value uint64) (Field, error)
- func WithRequestID(id string) Field
- type FieldKey
- type Gauge
- type InvalidEnvironmentValueError
- type InvalidStreamRoutingError
- type Level
- type LogEntryTooLargeError
- type Logger
- type LoggerFailure
- type MemoryPressureMonitor
- type Meter
- type MultiLoggerError
- type NotificationTargetError
- type ObserverAttr
- type Option
- type RenamedEnvironmentKeyError
- type Runtime
- type SlogHandler
- type Span
- type SpoolConfig
- type SpoolFinalizeConfig
- type SpoolLifecycleConfig
- type SpoolLoopConfig
- type SpoolRunnerConfig
- type SpoolSupervisorConfig
- type SpoolWorkerConfig
- type StreamRouting
- type TraceID
- type Tracer
Examples ¶
Constants ¶
const ( LevelDebug = pkglogger.LogLevelDebug LevelInfo = pkglogger.LogLevelInfo LevelWarn = pkglogger.LogLevelWarn LevelError = pkglogger.LogLevelError // DefaultMaxLogEntryBytes is the default size limit before backend fan-out. DefaultMaxLogEntryBytes = pkglogger.DefaultMaxLogEntryBytes )
const ( StreamRoutingNone = streamrouting.None StreamRoutingMonthly = streamrouting.Monthly StreamRoutingDaily = streamrouting.Daily StreamRoutingHourly = streamrouting.Hourly )
const ( // ConfigFieldTimeout identifies the Timeout of Config, AsyncConfig and // DeliveryConfig in a pkg/logger ConfigFieldError. A Timeout that is not // positive is reported with the kind pkg/logger ErrNonPositiveSetting. ConfigFieldTimeout pkglogger.ConfigField = "Timeout" // ConfigFieldMaxParallel identifies AsyncConfig.MaxParallel in a pkg/logger // ConfigFieldError. A MaxParallel that is not positive is reported with the // kind pkg/logger ErrNonPositiveSetting. ConfigFieldMaxParallel pkglogger.ConfigField = "MaxParallel" )
const MaxFieldNestingDepth = applogging.MaxFieldNestingDepth
MaxFieldNestingDepth is the deepest nesting of arrays and objects that Any and slog attributes accept: a scalar is depth 0 and one enclosing array is depth 1. Spool records and backend payloads add a few levels around each value; the limit keeps that total well below the 10,000 levels JSON decoders accept, so every accepted value can be stored and replayed.
Variables ¶
var ( ErrFieldKeyInvalid = applogging.ErrFieldKeyInvalid ErrFieldValueNotJSON = applogging.ErrFieldValueNotJSON ErrFieldFloatNotFinite = applogging.ErrFieldFloatNotFinite ErrLoggerClosed = applogging.ErrLoggerClosed ErrLogEntryTooLarge = applogging.ErrLogEntryTooLarge ErrForcedClose = applogging.ErrForcedClose ErrForceCloseUnsupported = applogging.ErrForceCloseUnsupported ErrLogDropped = pkglogger.ErrLogDropped ErrNoActiveLogOutput = pkglogger.ErrNoActiveLogOutput )
var ( // ErrNilContext reports that New, NewAsync or NewDelivery received a nil context. ErrNilContext = errors.New("logger context must not be nil") // ErrDeliverySpoolUnsupported reports that NewDelivery received WithSpool. A // Delivery logger reports each delivery to the caller and has no replay workers. ErrDeliverySpoolUnsupported = errors.New("delivery logging does not support WithSpool") // ErrInvalidNotificationTarget reports that a backend selected as an internal // log notification target (OnErrorConfig, OnWarnConfig, OnInfoConfig or // OnDebugConfig) has settings from which its notification writer cannot be // created, for example an unknown TimeZone or an empty LogLineDateFormat. The // constructors return it as a *NotificationTargetError before creating any // resource, instead of dropping notifications later. ErrInvalidNotificationTarget = infralogger.ErrInvalidNotificationTarget )
var ErrEnvLoggerDisabled = errors.New("logger is disabled by the environment")
ErrEnvLoggerDisabled reports that EnvConfig was asked for a logger that the environment disabled with HETEROLOG_ENABLE_LOGGING, HETEROLOG_ENABLE_ASYNC_BEST_EFFORT_LOGGING or HETEROLOG_ENABLE_DELIVERY_LOGGING set to false.
var ErrInvalidMemoryPressureMonitor = memorymonitor.ErrInvalidMonitorConfig
ErrInvalidMemoryPressureMonitor reports that NewMemoryPressureMonitor rejected its provider, policy, or poll interval.
var ErrInvalidStreamRouting = streamrouting.ErrInvalidGranularity
ErrInvalidStreamRouting reports that WithCloudWatchLogsStreamRouting received a StreamRouting value that is not supported. The constructors return it as an *InvalidStreamRoutingError.
Functions ¶
This section is empty.
Types ¶
type AsyncConfig ¶
type AsyncConfig = pkglogger.AsyncBestEffortMultiLoggerConfig
AsyncConfig configures a logger with asynchronous best-effort delivery.
func DefaultAsyncConfig ¶
func DefaultAsyncConfig() AsyncConfig
DefaultAsyncConfig returns stdout configuration with at most 16 parallel backend operations. Logging methods do not return delivery errors.
type AsyncLogger ¶
type AsyncLogger = applogging.AsyncLogger
AsyncLogger accepts entries without returning delivery errors.
type AsyncRuntime ¶
type AsyncRuntime struct {
AsyncLogger
// contains filtered or unexported fields
}
AsyncRuntime owns an asynchronous best-effort logger. Shutdown waits for accepted operations and final buffer flushing. Obtain one with NewAsync.
func NewAsync ¶
func NewAsync(ctx context.Context, cfg AsyncConfig, opts ...Option) (*AsyncRuntime, error)
NewAsync constructs an asynchronous best-effort logger. MaxParallel and the normal timeout and entry-size limits must all be positive.
func (AsyncRuntime) Close ¶
func (l AsyncRuntime) Close() error
Close stops accepting new entries, flushes accepted buffered entries and releases resources. It waits without a deadline. A spool's entire backlog need not be delivered; durable records remain available for later replay.
func (AsyncRuntime) ForceClose ¶
func (l AsyncRuntime) ForceClose() error
ForceClose requests immediate cancellation of recovery work. Unfinished checkpoints or archives may remain. OS I/O may still need time to complete.
type BackendSpoolRunnerConfig ¶
type BackendSpoolRunnerConfig = spoolrunner.BackendSpoolRunnerConfig
BackendSpoolRunnerConfig controls one backend's replay worker and lifecycle.
type Config ¶
type Config = pkglogger.LoggerConfig
Config configures a synchronous logger. See pkg/logger for backend settings.
func DefaultConfig ¶
func DefaultConfig() Config
DefaultConfig returns independent configuration for INFO and higher logs on stdout (WARN and ERROR on stderr). Timestamps use UTC and RFC3339Nano.
type DeliveryConfig ¶
type DeliveryConfig = pkglogger.DeliveryLoggerConfig
DeliveryConfig configures a logger that returns a report for each destination.
func DefaultDeliveryConfig ¶
func DefaultDeliveryConfig() DeliveryConfig
DefaultDeliveryConfig returns stdout configuration for reporting delivery. Delivery loggers do not filter severity or sample entries.
type DeliveryLogger ¶
type DeliveryLogger = applogging.DeliveryLogger
DeliveryLogger reports the result for each configured destination.
type DeliveryReport ¶
type DeliveryReport = pkglogger.DeliveryReport
DeliveryReport describes backend delivery, durable storage, and evacuation.
type DeliveryRuntime ¶
type DeliveryRuntime struct {
DeliveryLogger
// contains filtered or unexported fields
}
DeliveryRuntime owns a delivery-reporting logger. Obtain one with NewDelivery.
func NewDelivery ¶
func NewDelivery(ctx context.Context, cfg DeliveryConfig, opts ...Option) (*DeliveryRuntime, error)
NewDelivery constructs a logger that reports delivery per destination. Delivery mode does not use the replay workers configured by WithSpool.
func (DeliveryRuntime) Close ¶
func (l DeliveryRuntime) Close() error
Close stops accepting new entries, flushes accepted buffered entries and releases resources. It waits without a deadline. A spool's entire backlog need not be delivered; durable records remain available for later replay.
func (DeliveryRuntime) ForceClose ¶
func (l DeliveryRuntime) ForceClose() error
ForceClose requests immediate cancellation of recovery work. Unfinished checkpoints or archives may remain. OS I/O may still need time to complete.
type EnvConfig ¶
type EnvConfig struct {
// contains filtered or unexported fields
}
EnvConfig holds the settings that LoadEnvConfig read from HETEROLOG_ environment variables. New, NewAsync and NewDelivery construct loggers from them; Config, AsyncConfig and DeliveryConfig return the settings to adjust before calling the package-level constructors.
The environment does not configure tracing or a memory pressure monitor. Pass WithObservers and, when HETEROLOG_USE_MEMORY_PRESSURE_* settings are enabled, WithMemoryPressureMonitor as options.
func LoadEnvConfig ¶
LoadEnvConfig reads the HETEROLOG_ settings from the process environment and, when path is not empty, from the env file at path. A variable that is set in the process environment takes precedence over the file. LoadEnvConfig does not modify the process environment and reads no other file: it ignores HETEROLOG_ENV_PATH and a .env file that path does not name. The AWS SDK's AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_SESSION_TOKEN and AWS_REGION supply defaults for the S3 and CloudWatch Logs settings.
Settings that are not set use the defaults documented in .env.example, so an empty environment yields loggers that write to stdout. LoadEnvConfig checks the settings of every enabled logger and of the loggers together, such as directories that two stores would share, and returns all problems joined with errors.Join. Use errors.As with EnvFileError, InvalidEnvironmentValueError, RenamedEnvironmentKeyError or pkg/env VariableError to identify a setting.
Example ¶
LoadEnvConfig reads HETEROLOG_ variables and the named env file without changing the process environment. Unset settings use the defaults, which write to stdout.
package main
import (
"context"
"log"
"github.com/go-jappe/heterolog"
)
func main() {
env, err := heterolog.LoadEnvConfig(".env")
if err != nil {
log.Fatal(err)
}
ctx := context.Background()
runtime, err := env.New(ctx)
if err != nil {
log.Fatal(err)
}
defer func() {
if err := runtime.Close(); err != nil {
log.Print(err)
}
}()
if err := runtime.Info(ctx, "service started"); err != nil {
log.Print(err)
}
}
Output:
func (*EnvConfig) AsyncConfig ¶
func (c *EnvConfig) AsyncConfig() (AsyncConfig, []Option, error)
AsyncConfig returns the asynchronous logger settings and the options for NewAsync, like Config. It returns an error wrapping ErrEnvLoggerDisabled when HETEROLOG_ENABLE_ASYNC_BEST_EFFORT_LOGGING is false.
func (*EnvConfig) Config ¶
Config returns the synchronous logger settings and the options for the spool replay settings and CloudWatch Logs stream routing read from the environment. Pass both to New. Each call returns new settings. It returns an error wrapping ErrEnvLoggerDisabled when HETEROLOG_ENABLE_LOGGING is false.
func (*EnvConfig) DeliveryConfig ¶
func (c *EnvConfig) DeliveryConfig() (DeliveryConfig, []Option, error)
DeliveryConfig returns the delivery logger settings and the options for NewDelivery. Delivery loggers do not replay spools, so the options carry only the CloudWatch Logs stream routing. It returns an error wrapping ErrEnvLoggerDisabled when HETEROLOG_ENABLE_DELIVERY_LOGGING is false.
func (*EnvConfig) New ¶
New constructs a synchronous logger from the settings and options that Config returns. opts are applied after those options, so they can replace them or add WithObservers and WithMemoryPressureMonitor.
func (*EnvConfig) NewAsync ¶
NewAsync constructs an asynchronous best-effort logger from the settings and options that AsyncConfig returns, followed by opts.
func (*EnvConfig) NewDelivery ¶
NewDelivery constructs a delivery-reporting logger from the settings and options that DeliveryConfig returns, followed by opts.
type EnvFileError ¶
type EnvFileError = appconfig.EnvFileError
EnvFileError reports that LoadEnvConfig could not read the env file. Path is the file and Err the cause; errors.Is(err, fs.ErrNotExist) reports a missing file.
type Field ¶
type Field = applogging.Field
Field is one immutable structured attribute. Its zero value is ignored.
func Any ¶
Any snapshots a JSON-encodable value with a validated key. Values that cannot be encoded, or that nest arrays and objects deeper than MaxFieldNestingDepth, return ErrFieldValueNotJSON instead of a field.
func WithRequestID ¶
WithRequestID overrides the context request ID for a single log entry.
type FieldKey ¶
type FieldKey = applogging.FieldKey
FieldKey is a validated key that can efficiently construct typed fields.
func MustFieldKey ¶
MustFieldKey validates a constant attribute key and panics if it is invalid.
func NewFieldKey ¶
NewFieldKey validates a dynamic attribute key.
type InvalidEnvironmentValueError ¶
type InvalidEnvironmentValueError = appconfig.InvalidEnvironmentValueError
InvalidEnvironmentValueError reports a value that LoadEnvConfig rejected after reading it. Key names the variable and Err the reason. Value is empty for values that may contain credentials. Values that are not of the expected type, such as a number, are reported as a pkg/env VariableError.
type InvalidStreamRoutingError ¶
type InvalidStreamRoutingError = streamrouting.InvalidGranularityError
InvalidStreamRoutingError reports the unsupported StreamRouting value in its Granularity field. errors.Is matches ErrInvalidStreamRouting.
type LogEntryTooLargeError ¶
type LogEntryTooLargeError = applogging.LogEntryTooLargeError
LogEntryTooLargeError describes an entry rejected before fan-out.
type Logger ¶
type Logger = applogging.Logger
Logger synchronously records structured entries and reports failures.
type LoggerFailure ¶
type LoggerFailure = applogging.LoggerFailure
LoggerFailure describes a failure from a single physical handler.
type MemoryPressureMonitor ¶
type MemoryPressureMonitor = pressure.MemoryPressureMonitor
Public aliases allow custom instrumentation without importing internal packages.
func NewMemoryPressureMonitor ¶
func NewMemoryPressureMonitor( provider memorypressure.Provider, policy memorypressure.CriticalPolicy, pollInterval time.Duration, ) (MemoryPressureMonitor, error)
NewMemoryPressureMonitor returns a monitor to pass to WithMemoryPressureMonitor. After Start, it reads provider every pollInterval and evaluates each reading with the same rules as memorypressure.CriticalState: a reading is a critical candidate when a reliable observation reaches CriticalRatio or MinAvailableBytes, and the monitor reports critical once ConsecutiveCriticalHits candidates occur in a row (0 or 1 means the first).
The caller owns the monitor. Start reads once before returning and then polls until its context ends; cancel that context when no logger uses the monitor. If the first read fails, Start returns the error and polling does not begin.
It returns an error wrapping ErrInvalidMemoryPressureMonitor for a nil provider, a non-positive poll interval, or a policy that enables neither threshold, has a CriticalRatio above 1, or has a negative ConsecutiveCriticalHits.
type MultiLoggerError ¶
type MultiLoggerError = applogging.MultiLoggerError
MultiLoggerError contains the failures from a fan-out operation.
type NotificationTargetError ¶
type NotificationTargetError = infralogger.NotificationTargetError
NotificationTargetError reports the logger (Source) and the notification target (Backend) whose settings are invalid, and the cause in Err. errors.Is matches ErrInvalidNotificationTarget and the cause.
type ObserverAttr ¶
Public aliases allow custom instrumentation without importing internal packages.
type Option ¶
type Option func(*options)
Option supplies optional dependencies and runtime policies to constructors.
func WithCloudWatchLogsStreamRouting ¶
func WithCloudWatchLogsStreamRouting(routing StreamRouting) Option
WithCloudWatchLogsStreamRouting selects stream partitioning for CloudWatch.
func WithMemoryPressureMonitor ¶
func WithMemoryPressureMonitor(monitor MemoryPressureMonitor) Option
WithMemoryPressureMonitor supplies an already-started monitor, such as one from NewMemoryPressureMonitor, for overload policies. The caller owns its lifetime: loggers neither start, reset, nor stop it.
func WithObservers ¶
WithObservers supplies instrumentation. Nil dependencies use no-op observers. The caller retains ownership of observer providers and their shutdown.
func WithSpool ¶
func WithSpool(cfg SpoolConfig) Option
WithSpool supplies replay settings when a synchronous or asynchronous backend uses durable spooling. Delivery loggers do not own replay workers.
type RenamedEnvironmentKeyError ¶
type RenamedEnvironmentKeyError = appconfig.RenamedEnvironmentKeyError
RenamedEnvironmentKeyError reports a variable whose name was corrected. Old is the name that is set and New the current name. LoadEnvConfig does not read the old name as an alias, because ignoring it would silently drop a setting.
type Runtime ¶
type Runtime struct {
Logger
// contains filtered or unexported fields
}
Runtime owns a synchronous logger and its background resources. Obtain one with New; the zero value is not a usable logger. Do not copy a Runtime.
func New ¶
New constructs a logger from explicit configuration. It does not load the environment or modify global providers. Use DefaultConfig as a starting point. Close or Shutdown must be called to flush buffers and release resources.
func (Runtime) Close ¶
func (l Runtime) Close() error
Close stops accepting new entries, flushes accepted buffered entries and releases resources. It waits without a deadline. A spool's entire backlog need not be delivered; durable records remain available for later replay.
func (Runtime) ForceClose ¶
func (l Runtime) ForceClose() error
ForceClose requests immediate cancellation of recovery work. Unfinished checkpoints or archives may remain. OS I/O may still need time to complete.
type SlogHandler ¶
type SlogHandler struct {
// contains filtered or unexported fields
}
SlogHandler adapts the standard library's structured logger to Logger. Derived handlers share the destination; closing its runtime remains the caller's responsibility. The destination must support concurrent calls.
func NewSlogHandler ¶
func NewSlogHandler(logger Logger, opts *slog.HandlerOptions) *SlogHandler
NewSlogHandler returns a handler suitable for slog.New. A nil options pointer uses slog's defaults (Info level, no source). A nil logger panics.
Attributes follow slog.JSONHandler's encoding and ReplaceAttr behavior. The complete slog record, including time, level, msg and optional source, is available in the destination's structured fields. Duplicate keys retain their last value. The original record level determines backend routing, and its original time is also used as the backend event time. ReplaceAttr changes the structured fields and the backend's message, but not routing or event time. A removed message becomes empty; a non-string message uses its JSON encoding. String-valued top-level request_id, trace_id and span_id become event metadata. Non-string values remain ordinary structured fields alongside any context IDs.
slog.Logger discards errors returned by Handler.Handle. Use the native logging API for returned errors, or NewDelivery for per-destination delivery reports.
func (*SlogHandler) Enabled ¶
Enabled reports whether level meets the configured minimum. A LevelVar in the options is consulted on every call, allowing changes without rebuilding the handler. Each backend may impose its own additional level filter.
func (*SlogHandler) Handle ¶
Handle sends a record to the destination and returns any delivery error. Like the standard handlers, Handle does not apply Enabled itself. Context values (including trace and request IDs) are retained; cancellation does not suppress the log record.
type SpoolConfig ¶
type SpoolConfig = configspool.SpoolConfig
SpoolConfig configures background replay of durable failure spools.
func DefaultSpoolConfig ¶
func DefaultSpoolConfig() SpoolConfig
DefaultSpoolConfig returns replay settings for every supported backend. Purging is disabled so retained records are not deleted implicitly.
type SpoolFinalizeConfig ¶
type SpoolFinalizeConfig = spoolrunner.FinalizeConfig
SpoolFinalizeConfig bounds finalization retry state.
type SpoolLifecycleConfig ¶
type SpoolLifecycleConfig = spoollifecycle.LifecycleConfig
SpoolLifecycleConfig controls retention of finalized spool records.
type SpoolLoopConfig ¶
type SpoolLoopConfig = spoolrunner.RunnerConfig
SpoolLoopConfig controls replay polling.
type SpoolRunnerConfig ¶
type SpoolRunnerConfig = spoolrunner.SpoolRunnerConfig
SpoolRunnerConfig supplies separate replay settings for each backend.
type SpoolSupervisorConfig ¶
type SpoolSupervisorConfig = spoolsupervisor.RunnerSupervisorConfig
SpoolSupervisorConfig controls replay worker restarts.
type SpoolWorkerConfig ¶
type SpoolWorkerConfig = spoolrunner.WorkerConfig
SpoolWorkerConfig controls replay finalization and the maximum wait for a backend-specified Retry-After.
type StreamRouting ¶
type StreamRouting = streamrouting.Granularity
StreamRouting selects time partitioning for CloudWatch Logs stream names.
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
cmd
|
|
|
log-recovery
command
|
|
|
examples
|
|
|
slog
command
Run with: go run ./examples/slog
|
Run with: go run ./examples/slog |
|
internal
|
|
|
application/logrecovery
Package logrecoveryは、停止中のアプリケーションのログファイルを手動復旧します。
|
Package logrecoveryは、停止中のアプリケーションのログファイルを手動復旧します。 |
|
application/trace/span
sdk使う予定のため自作は廃止予定
|
sdk使う予定のため自作は廃止予定 |
|
application/trace/tracer
otel sdk使う予定のためこの自作は廃止予定
|
otel sdk使う予定のためこの自作は廃止予定 |
|
config/configerror
Package configerrorは、設定の検証errorに種類(sentinel)を付けるための補助です。
|
Package configerrorは、設定の検証errorに種類(sentinel)を付けるための補助です。 |
|
config/failure
Package failure はbackend共通のdurable failure設定を提供します。
|
Package failure はbackend共通のdurable failure設定を提供します。 |
|
config/filelifecycle
Package filelifecycle は、通常FileLoggerとfailure archiveの解決済みlifecycle modeごとに 実行時に有効となる責務を定義します。
|
Package filelifecycle は、通常FileLoggerとfailure archiveの解決済みlifecycle modeごとに 実行時に有効となる責務を定義します。 |
|
config/objectstoragecompressedlog
Package objectstoragecompressedlogは、圧縮ログファイルを S3などのobject storageへアップロードできなかった場合の保存設定を定義します。
|
Package objectstoragecompressedlogは、圧縮ログファイルを S3などのobject storageへアップロードできなかった場合の保存設定を定義します。 |
|
config/renamedkey
Package renamedkeyは、公開前に綴りを修正した環境変数keyについて、旧名と現在のkey名の 対応を定義します。
|
Package renamedkeyは、公開前に綴りを修正した環境変数keyについて、旧名と現在のkey名の 対応を定義します。 |
|
infrastructure/fsstore/checkpoint
Package checkpointは、ログファイルの宛先登録・送信完了記録と、そのファイル保存・再試行を管理します。
|
Package checkpointは、ログファイルの宛先登録・送信完了記録と、そのファイル保存・再試行を管理します。 |
|
infrastructure/fsstore/directorylease
Package directorylease は、同一process内で独立した構成instanceが同じfilesystem directoryを同時に管理しないための排他的なleaseを提供します。
|
Package directorylease は、同一process内で独立した構成instanceが同じfilesystem directoryを同時に管理しないための排他的なleaseを提供します。 |
|
infrastructure/fsstore/directorysize
Package directorysize は、directory内のfile size合計を、filesystem観測を開始するための 概算値として追跡します。
|
Package directorysize は、directory内のfile size合計を、filesystem観測を開始するための 概算値として追跡します。 |
|
infrastructure/fsstore/failurearchive/compressedlog
Package compressedlogarchive は、object storageへ送信できなかった圧縮log fileを 内容を変更せずfilesystemへ永続保存します。
|
Package compressedlogarchive は、object storageへ送信できなかった圧縮log fileを 内容を変更せずfilesystemへ永続保存します。 |
|
infrastructure/fsstore/spool/objectstorage
Package objectstoragespool は、object storageへ送信する圧縮log fileを filesystem上で永続管理します。
|
Package objectstoragespool は、object storageへ送信する圧縮log fileを filesystem上で永続管理します。 |
|
infrastructure/fsstore/spool/retryafter
Package retryafterは、spoolの送信先がRetry-Afterで指定した再送の下限時刻を、 その送信先を担当するrunnerのspoolディレクトリ内へ永続化します。
|
Package retryafterは、spoolの送信先がRetry-Afterで指定した再送の下限時刻を、 その送信先を担当するrunnerのspoolディレクトリ内へ永続化します。 |
|
infrastructure/logbackend/clickhouse/retryclassifier
Package retryclassifierはClickHouse送信失敗のretry可否を分類します。
|
Package retryclassifierはClickHouse送信失敗のretry可否を分類します。 |
|
infrastructure/logbackend/cloudwatchlogs/retryclassifier
Package retryclassifierは、CloudWatch Logs送信失敗のretry可否を分類します。
|
Package retryclassifierは、CloudWatch Logs送信失敗のretry可否を分類します。 |
|
infrastructure/logbackend/cloudwatchlogs/streamrouting
Package streamroutingは、eventを時間単位で分割したCloudWatch Logs streamへ 振り分けるapplication側のrouting policyを定義します。
|
Package streamroutingは、eventを時間単位で分割したCloudWatch Logs streamへ 振り分けるapplication側のrouting policyを定義します。 |
|
infrastructure/logbackend/opensearch/retryclassifier
Package retryclassifierはOpenSearchのrequest単位の失敗を分類します。
|
Package retryclassifierはOpenSearchのrequest単位の失敗を分類します。 |
|
infrastructure/logfile
Package logfileは、ログファイルの処理を進めるための共通部品を提供します。
|
Package logfileは、ログファイルの処理を進めるための共通部品を提供します。 |
|
infrastructure/logfile/lifecycle
Package lifecycleは、ログの保存ディレクトリを一巡し、各系列の圧縮・upload・ 保持設定による削除を進めます。
|
Package lifecycleは、ログの保存ディレクトリを一巡し、各系列の圧縮・upload・ 保持設定による削除を進めます。 |
|
infrastructure/logfile/processing
Package processingは、通常ログとbackend送信失敗archiveのファイルについて、 圧縮・送信と退避・checkpointへの完了反映・削除を一件ずつ進める共通処理を提供します。
|
Package processingは、通常ログとbackend送信失敗archiveのファイルについて、 圧縮・送信と退避・checkpointへの完了反映・削除を一件ずつ進める共通処理を提供します。 |
|
infrastructure/logfile/runner
Package runnerは、ログ保存先のlifecycle処理を定期間隔で実行し、結果を報告します。
|
Package runnerは、ログ保存先のlifecycle処理を定期間隔で実行し、結果を報告します。 |
|
infrastructure/logger/cloudwatchlogs
Package cloudwatchlogs は、アプリケーション内で生成された LogEntry を CloudWatch Logs の PutLogEvents へ送信するロガー実装を提供します。
|
Package cloudwatchlogs は、アプリケーション内で生成された LogEntry を CloudWatch Logs の PutLogEvents へ送信するロガー実装を提供します。 |
|
infrastructure/logger/failure
Package failure defines the backend-neutral result passed from logger sends to durable failure handlers.
|
Package failure defines the backend-neutral result passed from logger sends to durable failure handlers. |
|
infrastructure/logger/flushfailure
Package flushfailureは、logger backendへの送信失敗後に実行する共通処理を提供します。
|
Package flushfailureは、logger backendへの送信失敗後に実行する共通処理を提供します。 |
|
infrastructure/logger/flushfailure/degradehandler
Package degradehandler provides the direct evacuation path used when the primary durable failure store is disabled explicitly.
|
Package degradehandler provides the direct evacuation path used when the primary durable failure store is disabled explicitly. |
|
infrastructure/logger/flushfailure/evacuation
Package evacuation provides destination writers shared by direct degradation and durable-store overload handling.
|
Package evacuation provides destination writers shared by direct degradation and durable-store overload handling. |
|
infrastructure/logger/flushfailure/fsarchivehandler
Package fsarchivehandler はbackend-neutralなfailure archive保存と保守Pipelineを提供します。
|
Package fsarchivehandler はbackend-neutralなfailure archive保存と保守Pipelineを提供します。 |
|
infrastructure/logger/flushfailure/overload
Package overload は、backend送信失敗のdurable保存先が過負荷になった場合の 共通退避境界を提供します。
|
Package overload は、backend送信失敗のdurable保存先が過負荷になった場合の 共通退避境界を提供します。 |
|
infrastructure/logger/handler/reentrytest
Package reentrytestは、内部ログの通知先(OnError・OnWarn・OnInfo・OnDebug)が同じloggerへ 書き込む再入の試験に共通する、書き込み方法と通知の数え方を提供します。
|
Package reentrytestは、内部ログの通知先(OnError・OnWarn・OnInfo・OnDebug)が同じloggerへ 書き込む再入の試験に共通する、書き込み方法と通知の数え方を提供します。 |
|
infrastructure/logger/timestamp
Package timestampは、loggerが確定済みの発生時刻を各出力先の表示規則へ変換する機能を 提供します。
|
Package timestampは、loggerが確定済みの発生時刻を各出力先の表示規則へ変換する機能を 提供します。 |
|
infrastructure/metrics
Package metrics provides functionality for collecting and formatting system metrics.
|
Package metrics provides functionality for collecting and formatting system metrics. |
|
infrastructure/notification
Package notificationは、通知関数を受理順に別のgoroutineで実行する共通部品を提供します。
|
Package notificationは、通知関数を受理順に別のgoroutineで実行する共通部品を提供します。 |
|
infrastructure/objectstorage/compressedlogfailure
Package compressedlogfailureは、通常ログの.logとbackend送信失敗レコードの.jsonlの 圧縮ファイルについて、object storageへの送信と失敗時の退避先への保存を合成します。
|
Package compressedlogfailureは、通常ログの.logとbackend送信失敗レコードの.jsonlの 圧縮ファイルについて、object storageへの送信と失敗時の退避先への保存を合成します。 |
|
infrastructure/objectstorage/failurearchive
Package failurearchive はfailure archive用object storage uploadを構成します。
|
Package failurearchive はfailure archive用object storage uploadを構成します。 |
|
infrastructure/shutdown
Package shutdownは、受理済み処理の完了を待つ正常終了の進捗を通知します。
|
Package shutdownは、受理済み処理の完了を待つ正常終了の進捗を通知します。 |
|
infrastructure/spool/compressedlog/internal/testutil
Package replaytest provides fixtures shared by compressed log runner and worker tests.
|
Package replaytest provides fixtures shared by compressed log runner and worker tests. |
|
infrastructure/spool/compressedlog/uploader
Package uploaderは、保存先サービスに対応する圧縮ログspoolの再送部品を構築します。
|
Package uploaderは、保存先サービスに対応する圧縮ログspoolの再送部品を構築します。 |
|
infrastructure/spool/compressedlog/uploader/s3
Package s3は、圧縮ログspoolの再送とS3固有のcircuit breaker分類を提供します。
|
Package s3は、圧縮ログspoolの再送とS3固有のcircuit breaker分類を提供します。 |
|
infrastructure/spool/compressedlog/worker
Package workerは、spoolに保存された圧縮ログをobject storageへ再送します。
|
Package workerは、spoolに保存された圧縮ログをobject storageへ再送します。 |
|
infrastructure/spool/log/sender/storedvalue
Package storedvalueは、spoolに保存されたrecordの値を保持し得る検証errorを、表示文と 種類のsentinelだけを残したerrorへ置き換えます。
|
Package storedvalueは、spoolに保存されたrecordの値を保持し得る検証errorを、表示文と 種類のsentinelだけを残したerrorへ置き換えます。 |
|
infrastructure/victoriametrics
Package victoriametrics provides functionality for pushing metrics to VictoriaMetrics.
|
Package victoriametrics provides functionality for pushing metrics to VictoriaMetrics. |
|
pathcaserule
Package pathcaseruleは、試験だけがpathidentityのdirectoryの大小文字の規則を差し替えるための 内部hookです。
|
Package pathcaseruleは、試験だけがpathidentityのdirectoryの大小文字の規則を差し替えるための 内部hookです。 |
|
presentation/cli/logrecovery
Package logrecovery はアプリケーション停止中の手動ログ復旧CLIを提供します。
|
Package logrecovery はアプリケーション停止中の手動ログ復旧CLIを提供します。 |
|
testutil
Package testutilは、ファイルシステム関連の回帰試験で共用する補助関数を提供します。
|
Package testutilは、ファイルシステム関連の回帰試験で共用する補助関数を提供します。 |
|
testutil/boundedwait
Package boundedwaitは、試験が処理の完了を待つ時間に上限を設ける共通helperです。
|
Package boundedwaitは、試験が処理の完了を待つ時間に上限を設ける共通helperです。 |
|
testutil/checkpoint
Package checkpointtest provides filesystem fixtures for checkpoint integration tests.
|
Package checkpointtest provides filesystem fixtures for checkpoint integration tests. |
|
testutil/configfixture
Package configfixture creates offline fixtures from the public environment example.
|
Package configfixture creates offline fixtures from the public environment example. |
|
testutil/errortree
Package errortreeは、errors.Joinや%wでまとめたerror treeから型付きerrorを探す試験用helperです。
|
Package errortreeは、errors.Joinや%wでまとめたerror treeから型付きerrorを探す試験用helperです。 |
|
testutil/uploadertest
Package uploadertestは試験用の送信入力をコンストラクタ経由で作成します。
|
Package uploadertestは試験用の送信入力をコンストラクタ経由で作成します。 |
|
pkg
|
|
|
cloudwatchlogs
Package cloudwatchlogs は、AWS CloudWatch Logs の PutLogEvents API と CreateLogStream API を SigV4 署名付き HTTP リクエストで呼び出すための 軽量クライアントを提供します。
|
Package cloudwatchlogs は、AWS CloudWatch Logs の PutLogEvents API と CreateLogStream API を SigV4 署名付き HTTP リクエストで呼び出すための 軽量クライアントを提供します。 |
|
env
Package envは、環境変数の値を型付きの設定値として読み込みます。
|
Package envは、環境変数の値を型付きの設定値として読み込みます。 |
|
failurestore
Package failurestoreはpayload形式の異なるfailure pipelineが共有する durable store選択値を定義します。
|
Package failurestoreはpayload形式の異なるfailure pipelineが共有する durable store選択値を定義します。 |
|
internal/endpointurl
Package endpointurlは、pkg配下のclientが送信先endpointのURLを解析するときに、URLのuser info (ユーザー名・パスワード)を解析エラーの文面へ含めないための補助です。
|
Package endpointurlは、pkg配下のclientが送信先endpointのURLを解析するときに、URLのuser info (ユーザー名・パスワード)を解析エラーの文面へ含めないための補助です。 |
|
objectstorage/validation
Package validation は、object storage upload先の型付き設定を検証します。
|
Package validation は、object storage upload先の型付き設定を検証します。 |
|
path/internal/statehome
Package statehomeは、Linuxなどのunix系OSでrootで動いていない利用者について、保存先の 既定の基点directoryにするstate directory(XDG Base Directory仕様)を決めます。
|
Package statehomeは、Linuxなどのunix系OSでrootで動いていない利用者について、保存先の 既定の基点directoryにするstate directory(XDG Base Directory仕様)を決めます。 |
|
path/pathidentity
Package pathidentityは、保存先の初期化時の実体パス解決と、パスの比較キー生成を行います。
|
Package pathidentityは、保存先の初期化時の実体パス解決と、パスの比較キー生成を行います。 |
|
shutdown
Package shutdownは明示的な強制終了の結果を定義します。
|
Package shutdownは明示的な強制終了の結果を定義します。 |
|
testenv
|
|
|
windows/configfixture
command
configfixture generates an offline configuration root for Windows tests.
|
configfixture generates an offline configuration root for Windows tests. |
|
windows/directory-sync-probe
command
directory-sync-probe compares Windows directory flush APIs on a newly created test directory.
|
directory-sync-probe compares Windows directory flush APIs on a newly created test directory. |