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.
NewTelemetry records spans with its Tracer and metrics with its Meter, and sends them, together with those from the OpenTelemetry SDK passed through package otelexport: spans to OTLP/HTTP receivers, OpenSearch, ClickHouse, files, and stdout, and metrics to OTLP/HTTP receivers, VictoriaMetrics, files, and stdout. Pass its Tracer and Meter to loggers with WithObservers to trace and measure their work.
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
- func NewAdminHandler(cfg AdminHandlerConfig, audit *DeliveryRuntime) (http.Handler, error)
- type AdminHandlerConfig
- type AdminLogSearchConfig
- type AdminMembers
- type AdminServer
- type AdminServerConfig
- type AdminStatusConfig
- type AppliedOutputSettings
- type AsyncConfig
- type AsyncLogger
- type AsyncRuntime
- func (r *AsyncRuntime) Close() error
- func (r *AsyncRuntime) ForceClose() error
- func (r *AsyncRuntime) OutputSettings() map[LogOutputDestination]OutputSettings
- func (r *AsyncRuntime) Shutdown(ctx context.Context) error
- func (r *AsyncRuntime) UpdateOutputSettings(changes map[LogOutputDestination]OutputSettingsChange) (map[LogOutputDestination]AppliedOutputSettings, error)
- type BackendSpoolRunnerConfig
- type Config
- type Counter
- type DeliveryConfig
- type DeliveryLogger
- type DeliveryReport
- type DeliveryRuntime
- type EnvConfig
- func (c *EnvConfig) AdminAuditConfig() (DeliveryConfig, []Option, error)
- func (c *EnvConfig) AdminServerConfig() (AdminServerConfig, bool)
- 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) NewAdminAudit(ctx context.Context, opts ...Option) (*DeliveryRuntime, error)
- func (c *EnvConfig) NewAsync(ctx context.Context, opts ...Option) (*AsyncRuntime, error)
- func (c *EnvConfig) NewDelivery(ctx context.Context, opts ...Option) (*DeliveryRuntime, error)
- func (c *EnvConfig) NewTelemetry(ctx context.Context, opts ...Option) (*Telemetry, error)
- func (c *EnvConfig) TelemetryConfig() TelemetryConfig
- 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 Histogram
- type InvalidEnvironmentValueError
- type InvalidStreamRoutingError
- type Level
- type LogEntryTooLargeError
- type LogOutputDestination
- type Logger
- type LoggerFailure
- type MemoryPressureMonitor
- type Meter
- type MetricExporter
- type MultiLoggerError
- type NotificationTargetError
- type ObserverAttr
- type Option
- type OutputSettings
- type OutputSettingsChange
- type RenamedEnvironmentKeyError
- type Runtime
- func (r *Runtime) Close() error
- func (r *Runtime) ForceClose() error
- func (r *Runtime) Log(ctx context.Context, level Level, message string, fields ...Field) error
- func (r *Runtime) OutputSettings() map[LogOutputDestination]OutputSettings
- func (r *Runtime) Shutdown(ctx context.Context) error
- func (r *Runtime) UpdateOutputSettings(changes map[LogOutputDestination]OutputSettingsChange) (map[LogOutputDestination]AppliedOutputSettings, error)
- type SamplingChange
- type SamplingConfig
- type SettingsController
- type SlogHandler
- type Span
- type SpoolConfig
- type SpoolFinalizeConfig
- type SpoolLifecycleConfig
- type SpoolLoopConfig
- type SpoolRunnerConfig
- type SpoolSupervisorConfig
- type SpoolWorkerConfig
- type StreamRouting
- type Telemetry
- type TelemetryConfig
- type TelemetryMember
- type TraceExporter
- 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 = pkgcloudwatchlogs.StreamRoutingNone StreamRoutingMonthly = pkgcloudwatchlogs.StreamRoutingMonthly StreamRoutingDaily = pkgcloudwatchlogs.StreamRoutingDaily StreamRoutingHourly = pkgcloudwatchlogs.StreamRoutingHourly )
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.ConfigFieldTimeout // 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.ConfigFieldMaxParallel )
const ( TraceExporterOTLP = pkgtelemetry.TraceExporterOTLP TraceExporterFile = pkgtelemetry.TraceExporterFile TraceExporterStdout = pkgtelemetry.TraceExporterStdout TraceExporterOpenSearch = pkgtelemetry.TraceExporterOpenSearch TraceExporterClickHouse = pkgtelemetry.TraceExporterClickHouse )
const ( MetricExporterOTLP = pkgtelemetry.MetricExporterOTLP MetricExporterFile = pkgtelemetry.MetricExporterFile MetricExporterStdout = pkgtelemetry.MetricExporterStdout MetricExporterVictoriaMetrics = pkgtelemetry.MetricExporterVictoriaMetrics )
const MaxFieldNestingDepth = pkglogger.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 leaves 1,000 of the 10,000 levels that JSON decoders accept for them, so every accepted value can be stored and replayed.
const MinAdminTokenLength = pkgadmin.MinTokenLength
MinAdminTokenLength is the minimum length in bytes of an admin API token.
Variables ¶
var ( // ErrAdminTokenTooShort reports an admin API token shorter than // MinAdminTokenLength. The error never contains the token. ErrAdminTokenTooShort = admin.ErrTokenTooShort // ErrAdminNoLoggers reports an admin API configuration without loggers. ErrAdminNoLoggers = outputsettings.ErrNoLoggers // ErrAdminAuditLoggerRequired reports an admin API without the delivery // logger that records its audit log. ErrAdminAuditLoggerRequired = outputsettings.ErrNoAuditLogger // to the admin API share one pkg/logger LiveSettings, set through // RuntimeConfig.Live, in one logger or in different loggers. A logger given // under two names shares all of its outputs. A change of one output would // also change the other, which the audit log could neither record nor // verify. ErrAdminSharedLiveSettings = outputsettings.ErrSharedLiveSettings // ErrAdminDuplicateName reports a name used in more than one map of // AdminMembers. ErrAdminDuplicateName = admin.ErrDuplicateName // ErrAdminInvalidStatusConfig reports an AdminStatusConfig with a negative // duration or a percentage outside 0 to 100. ErrAdminInvalidStatusConfig = admin.ErrInvalidStatusConfig // ErrAdminInvalidLogSearchConfig reports an AdminLogSearchConfig with a // negative limit. ErrAdminInvalidLogSearchConfig = admin.ErrInvalidLogSearchConfig // ErrAdminServerAddrRequired reports an AdminServerConfig without Addr. ErrAdminServerAddrRequired = admin.ErrServerAddrRequired // ErrAdminServerInsecure reports an admin server that would listen on a // non-loopback address without TLS, which would send the token over the // network in clear text. ErrAdminServerInsecure = admin.ErrServerInsecure // ErrAdminServerTLSIncomplete reports an AdminServerConfig that sets only // one of TLSCertFile and TLSKeyFile. ErrAdminServerTLSIncomplete = admin.ErrServerTLSIncomplete )
var ( ErrFieldKeyInvalid = pkglogger.ErrFieldKeyInvalid ErrFieldValueNotJSON = pkglogger.ErrFieldValueNotJSON ErrFieldFloatNotFinite = pkglogger.ErrFieldFloatNotFinite ErrLoggerClosed = pkglogger.ErrLoggerClosed ErrLogEntryTooLarge = pkglogger.ErrLogEntryTooLarge ErrForcedClose = pkgshutdown.ErrForcedClose ErrForceCloseUnsupported = applogging.ErrForceCloseUnsupported ErrLogDropped = pkglogger.ErrLogDropped ErrNoActiveLogOutput = pkglogger.ErrNoActiveLogOutput )
var ( // ErrNilContext reports that New, NewAsync, NewDelivery or NewTelemetry // received a nil context. ErrNilContext = loggerruntime.ErrNilContext // ErrDeliverySpoolUnsupported reports that NewDelivery received WithSpool. A // Delivery logger reports each delivery to the caller and has no replay workers. ErrDeliverySpoolUnsupported = loggerruntime.ErrDeliverySpoolUnsupported // 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 = pkglogger.ErrInvalidNotificationTarget )
var ErrEnvAdminAuditNotEnabled = envconfig.ErrAdminAuditNotEnabled
ErrEnvAdminAuditNotEnabled reports that EnvConfig has no settings for the audit logger of the admin API because HETEROLOG_ADMIN_ADDR is empty.
var ErrEnvLoggerDisabled = envconfig.ErrLoggerDisabled
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 = pkgcloudwatchlogs.ErrInvalidStreamRouting
ErrInvalidStreamRouting reports that WithCloudWatchLogsStreamRouting received a StreamRouting value that is not supported. The constructors return it as an *InvalidStreamRoutingError.
var ErrUnknownOutput = pkglogger.ErrUnknownOutput
ErrUnknownOutput reports that UpdateOutputSettings named an output that the logger does not use.
Functions ¶
func NewAdminHandler ¶ added in v0.3.0
func NewAdminHandler(cfg AdminHandlerConfig, audit *DeliveryRuntime) (http.Handler, error)
NewAdminHandler returns an http.Handler for the admin API, which reads and changes the level and sampling of the outputs of running loggers and reports the configuration of loggers and telemetries. Mount it on your own server, behind your own TLS when it is reachable over a network; StartAdminServer starts a dedicated server instead. The handler serves:
GET /settings returns the current settings of every logger PATCH /settings changes the fields given in the JSON body GET /config returns the configuration of every member GET /config/<path> returns one value of that configuration GET /status returns the status of the process and every member GET /status/<path> returns one value of that status GET /logs/files lists the log files that can be searched GET /logs/search returns the log entries that match a word, levels and a period GET /logs/count counts the matching log entries by level, time or message GET / serves a browser page that uses the API (with /ui.css and /ui.js)
Every request except the three files of the browser page must send "Authorization: Bearer <Token>"; the page asks for the token and keeps it in the browser's session storage. PATCH requests are processed one at a time, and a PATCH checks all of its changes before applying any of them. Changes take effect from the next entry and are kept in memory only, so a restart returns to the configured settings.
GET /config returns the configuration each member was created with, as the structs of Config, AsyncConfig, DeliveryConfig and TelemetryConfig in JSON with snake_case keys. Tokens, passwords and keys are replaced by "***". Only members created by heterolog are reported; other implementations of SettingsController, DeliveryLogger and Telemetry are left out. Changes made through PATCH /settings are not part of it. GET /config/<path> walks the document by its keys and array indexes, for example /config/loggers/app/config/file/log_dir, and is 404 when the path does not exist, and GET /config?path=<path>&path=<path> returns several values in one request, as {"values": {"<path>": ...}}. It returns ErrAdminDuplicateName if a name is used in more than one map of cfg.Members.
GET /status returns the CPU, memory and goroutines of the process, and for every member the records, request durations, retries, circuit breaker, failure store and spool of each destination, the directories in use with their size limits and free disk space, and the warnings judged from them (disk nearly full, a destination slow or failing, a spool whose resend stopped, and so on), critical ones first. The file counts come from a background scan at the interval of cfg.Status and are approximate; they are reported with the time of the scan. GET /status/<path> and ?path= work as for /config. It returns ErrAdminInvalidStatusConfig if cfg.Status is out of range.
The endpoints under /logs/ read the log files of the file outputs of the loggers and delivery loggers, including rotated files and files compressed with gzip, zstd, lz4 or xz; encrypted files are listed but not read, since the process holds only the public key. They answer 403 unless cfg.LogSearch.Enabled is set. GET /logs/search takes q (a word, matched without regard to case), level, since and until (an RFC 3339 time or a duration back from now, such as 1h or 7d), member, series, order (newest or oldest), limit and cursor (the "next" of the previous page), and GET /logs/count takes by (level, minute, hour, day or message), tz and top instead of order, limit and cursor. Both return JSON, or the bare log lines and counts with format=text. One request runs at a time; a request that reaches the limits of cfg.LogSearch returns what it found, marked as incomplete. Every search and count is recorded in audit, with its query, before the response. It returns ErrAdminInvalidLogSearchConfig if a limit of cfg.LogSearch is negative.
audit records the audit log of the API: each change request, the settings when the change starts and after it, and every rejected request; only a successful GET is not recorded. Every record has the field log_kind=audit and the request ID, which the response also sends in X-Request-Id. When the settings after a change do not match the request, the change is not reverted: the mismatch is recorded at ERROR and the response is 500. When a record does not reach every output of audit, the change still goes ahead, the response carries a warning, and this is recorded at ERROR too. Use a delivery logger made for the audit log, such as the one of EnvConfig.NewAdminAudit, and close it after the handler is no longer used. It returns ErrAdminAuditLoggerRequired if audit is nil.
Each output of the loggers must have its own settings, so that every change is recorded and verified for the output it changes. It returns ErrAdminSharedLiveSettings if two outputs share one LiveSettings. Loggers created by New and NewAsync are checked; other implementations of SettingsController are not.
Types ¶
type AdminHandlerConfig ¶ added in v0.3.0
type AdminHandlerConfig = pkgadmin.HandlerConfig
AdminHandlerConfig configures NewAdminHandler: the bearer Token (at least MinAdminTokenLength bytes) and the Members served by the API.
type AdminLogSearchConfig ¶ added in v0.9.0
type AdminLogSearchConfig = pkgadmin.LogSearchConfig
AdminLogSearchConfig configures the log search of the admin API under /logs/: whether it is on, and how much one request reads and returns. A zero limit uses the default of DefaultAdminLogSearchConfig.
func DefaultAdminLogSearchConfig ¶ added in v0.9.0
func DefaultAdminLogSearchConfig() AdminLogSearchConfig
DefaultAdminLogSearchConfig returns the default limits of the log search of the admin API: 256 MiB of log text and 30 seconds per request, and up to 1000 entries per search. The search itself stays off.
type AdminMembers ¶ added in v0.7.0
AdminMembers are the loggers and telemetries the admin API serves, each under the name used in the API: Loggers, whose settings it reads and changes and whose configuration it reports, and DeliveryLoggers and Telemetries, whose configuration it reports. A name must not appear in more than one map.
type AdminServer ¶ added in v0.3.0
type AdminServer struct {
// contains filtered or unexported fields
}
AdminServer serves the admin API until Shutdown or Close stops it.
func StartAdminServer ¶ added in v0.3.0
func StartAdminServer(cfg AdminServerConfig, members AdminMembers, audit *DeliveryRuntime) (*AdminServer, error)
StartAdminServer starts a dedicated HTTP server for the admin API of NewAdminHandler and returns once it listens. members are the loggers and telemetries served under the names used in the API, and audit records the audit log; both are checked as in NewAdminHandler. The server listens on a loopback address unless cfg names another host and enables TLS. Call Shutdown or Close to stop it, and close audit after that.
func (*AdminServer) Addr ¶ added in v0.3.0
func (s *AdminServer) Addr() string
Addr returns the address the server listens on, including the port chosen when AdminServerConfig.Addr asked for port 0.
func (*AdminServer) Close ¶ added in v0.3.0
func (s *AdminServer) Close() error
Close stops the server immediately and closes active connections.
type AdminServerConfig ¶ added in v0.3.0
type AdminServerConfig = pkgadmin.ServerConfig
AdminServerConfig configures StartAdminServer. Addr is the TCP address to listen on; with an empty host, such as ":9100", the server listens on 127.0.0.1 only. Listening on a non-loopback address requires TLSCertFile and TLSKeyFile. Token is as in AdminHandlerConfig.
type AdminStatusConfig ¶ added in v0.7.0
type AdminStatusConfig = pkgadmin.StatusConfig
AdminStatusConfig configures GET /status of the admin API: the interval of the directory scans, whether they run at all, and the thresholds of the warnings. A zero field uses the default of DefaultAdminStatusConfig.
func DefaultAdminStatusConfig ¶ added in v0.7.0
func DefaultAdminStatusConfig() AdminStatusConfig
DefaultAdminStatusConfig returns the default settings of GET /status: a directory scan every 5 minutes, disk warnings below 10% and 5% free, directory warnings from 90% of the limit, and backend warnings above 10% failed records or 5 seconds per request on average.
type AppliedOutputSettings ¶ added in v0.5.0
type AppliedOutputSettings = pkglogger.AppliedOutputSettings
AppliedOutputSettings holds the settings of one output right before and right after UpdateOutputSettings changed it.
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 = pkglogger.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 (r *AsyncRuntime) Close() error
Close stops accepting new entries, waits for accepted operations and final buffer flushing, 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 (r *AsyncRuntime) ForceClose() error
ForceClose stops accepting new entries, releases callers waiting in Close or Shutdown, and requests the background and recovery work, such as spool replay and the compression and upload of log files, to stop. It returns without waiting, while the regular cleanup continues in the background. Unless shutdown has already finished, it returns ErrForcedClose, which the released Close and Shutdown calls also return; after shutdown has finished, it returns the result of that shutdown. Unfinished checkpoints or archives may remain, and OS I/O may still need time to complete.
func (*AsyncRuntime) OutputSettings ¶ added in v0.3.0
func (r *AsyncRuntime) OutputSettings() map[LogOutputDestination]OutputSettings
OutputSettings returns the current settings of each output of the logger, like Runtime.OutputSettings.
func (*AsyncRuntime) Shutdown ¶
func (r *AsyncRuntime) Shutdown(ctx context.Context) error
Shutdown starts graceful shutdown and waits until it completes or ctx ends. If ctx has already ended, it returns ctx.Err() without starting shutdown. Cancellation only stops this caller's wait; cleanup continues. A later Close or Shutdown joins cleanup. Use ForceClose to request aborting recovery work.
func (*AsyncRuntime) UpdateOutputSettings ¶ added in v0.3.0
func (r *AsyncRuntime) UpdateOutputSettings(changes map[LogOutputDestination]OutputSettingsChange) (map[LogOutputDestination]AppliedOutputSettings, error)
UpdateOutputSettings changes the level and sampling of outputs while the logger runs, like Runtime.UpdateOutputSettings. An asynchronous logger applies the settings in effect when it processes an entry.
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 Counter ¶
type Counter = pkgobserver.Counter
These aliases name the types for custom instrumentation and memory pressure monitoring, so callers need not import pkg/observer or pkg/memorypressure.
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 sample entries, and only their Slack output filters severity.
type DeliveryLogger ¶
type DeliveryLogger = pkglogger.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 has no replay workers, so NewDelivery returns ErrDeliverySpoolUnsupported when opts include WithSpool.
func (*DeliveryRuntime) Close ¶
func (r *DeliveryRuntime) Close() error
Close stops accepting new entries, flushes accepted buffered entries and releases resources. It waits without a deadline.
func (*DeliveryRuntime) ForceClose ¶
func (r *DeliveryRuntime) ForceClose() error
ForceClose stops accepting new entries, releases callers waiting in Close or Shutdown, and requests the background and recovery work, such as spool replay and the compression and upload of log files, to stop. It returns without waiting, while the regular cleanup continues in the background. Unless shutdown has already finished, it returns ErrForcedClose, which the released Close and Shutdown calls also return; after shutdown has finished, it returns the result of that shutdown. Unfinished checkpoints or archives may remain, and OS I/O may still need time to complete.
func (*DeliveryRuntime) Shutdown ¶
func (r *DeliveryRuntime) Shutdown(ctx context.Context) error
Shutdown starts graceful shutdown and waits until it completes or ctx ends. If ctx has already ended, it returns ctx.Err() without starting shutdown. Cancellation only stops this caller's wait; cleanup continues. A later Close or Shutdown joins cleanup. Use ForceClose to request aborting recovery work.
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.
Loggers constructed from the environment do not trace or measure by themselves: pass the Tracer and the Meter of the Telemetry that NewTelemetry constructs from the HETEROLOG_TRACES_* and HETEROLOG_METRICS_* settings with WithObservers as an option. A spool that a HETEROLOG_USE_MEMORY_PRESSURE_* setting enables judges memory pressure with HETEROLOG_MEMORY_CRITICAL_RATIO, HETEROLOG_MIN_AVAILABLE_MEMORY_BYTES_MB and HETEROLOG_MEMORY_CRITICAL_CONSECUTIVE_HITS, unless WithMemoryPressureMonitor supplies a monitor.
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 env 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 the problems it finds joined with errors.Join. Some problems, such as a value of the wrong type, stop the later checks, so fixing them can reveal others. 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) AdminAuditConfig ¶ added in v0.5.0
func (c *EnvConfig) AdminAuditConfig() (DeliveryConfig, []Option, error)
AdminAuditConfig returns the settings of the delivery logger that records the audit log of the admin API, and the options for NewAdminAudit. Its outputs are HETEROLOG_ADMIN_AUDIT_LOG_TYPE, by default stdout and file, and the HETEROLOG_ADMIN_AUDIT_* settings give where each output records, such as the file directory, by default audit_logs. The other settings, such as endpoints, credentials and timeouts, are those of the delivery logger (HETEROLOG_DELIVERY_*), even when HETEROLOG_ENABLE_DELIVERY_LOGGING is false. The audit logger keeps its own directories: its files are written to one file per period for every level, are not compressed, uploaded or removed, and its failure archives use their own directories. It returns ErrEnvAdminAuditNotEnabled when HETEROLOG_ADMIN_ADDR is empty.
func (*EnvConfig) AdminServerConfig ¶ added in v0.3.0
func (c *EnvConfig) AdminServerConfig() (AdminServerConfig, bool)
AdminServerConfig returns the admin server settings read from HETEROLOG_ADMIN_ADDR, HETEROLOG_ADMIN_TOKEN, HETEROLOG_ADMIN_TLS_CERT_FILE and HETEROLOG_ADMIN_TLS_KEY_FILE, and whether HETEROLOG_ADMIN_ADDR enables the server. LoadEnvConfig has already checked them. Pass the settings to StartAdminServer together with the audit logger of NewAdminAudit.
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 a new Config, but slices in it, such as LogOutputDestinations, can share their backing arrays with the EnvConfig, so replace a slice instead of changing its elements. 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) NewAdminAudit ¶ added in v0.5.0
NewAdminAudit constructs the audit logger of the admin API from the settings and options that AdminAuditConfig returns, followed by opts. Pass it to StartAdminServer or NewAdminHandler, and close it after the admin API stops.
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.
func (*EnvConfig) NewTelemetry ¶ added in v0.7.0
NewTelemetry constructs a Telemetry from the settings that TelemetryConfig returns. Of opts, only the Meter of WithObservers and WithTelemetryErrorHandler are used, as with the package-level NewTelemetry.
func (*EnvConfig) TelemetryConfig ¶ added in v0.7.0
func (c *EnvConfig) TelemetryConfig() TelemetryConfig
TelemetryConfig returns the settings for NewTelemetry. The trace settings are read from HETEROLOG_ENABLE_TRACES and HETEROLOG_TRACES_*, the metric settings from HETEROLOG_ENABLE_METRICS and HETEROLOG_METRICS_*, and Resource from the settings that loggers also use, such as HETEROLOG_APP_NAME and HETEROLOG_APP_ENV. A signal that is not enabled has no destinations, and a Telemetry records nothing for it. LoadEnvConfig has already checked them.
type EnvFileError ¶
type EnvFileError = pkgenv.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 ¶
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 sets the request ID of a single log entry. An empty id sets no request ID.
type 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 Gauge ¶
type Gauge = pkgobserver.Gauge
These aliases name the types for custom instrumentation and memory pressure monitoring, so callers need not import pkg/observer or pkg/memorypressure.
type Histogram ¶ added in v0.7.0
type Histogram = pkgobserver.Histogram
These aliases name the types for custom instrumentation and memory pressure monitoring, so callers need not import pkg/observer or pkg/memorypressure.
type InvalidEnvironmentValueError ¶
type InvalidEnvironmentValueError = pkgenv.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, except values that may contain credentials, which are reported as this error.
type InvalidStreamRoutingError ¶
type InvalidStreamRoutingError = pkgcloudwatchlogs.InvalidStreamRoutingError
InvalidStreamRoutingError reports the unsupported StreamRouting value in its Granularity field. errors.Is matches ErrInvalidStreamRouting.
type LogEntryTooLargeError ¶
type LogEntryTooLargeError = pkglogger.LogEntryTooLargeError
LogEntryTooLargeError describes an entry rejected before fan-out.
type LogOutputDestination ¶ added in v0.3.0
type LogOutputDestination = pkglogger.LogOutputDestination
LogOutputDestination names an output, such as stdout or opensearch.
type LoggerFailure ¶
type LoggerFailure = pkglogger.LoggerFailure
LoggerFailure describes a failure from a single physical handler.
type MemoryPressureMonitor ¶
type MemoryPressureMonitor = memorypressure.Monitor
These aliases name the types for custom instrumentation and memory pressure monitoring, so callers need not import pkg/observer or pkg/memorypressure.
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 Meter ¶
type Meter = pkgobserver.Meter
These aliases name the types for custom instrumentation and memory pressure monitoring, so callers need not import pkg/observer or pkg/memorypressure.
type MetricExporter ¶ added in v0.7.0
type MetricExporter = pkgtelemetry.MetricExporter
MetricExporter names a destination of metrics in TelemetryConfig.
type MultiLoggerError ¶
type MultiLoggerError = pkglogger.MultiLoggerError
MultiLoggerError contains the failures from a fan-out operation.
type NotificationTargetError ¶
type NotificationTargetError = pkglogger.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 ¶
type ObserverAttr = pkgobserver.Attr
These aliases name the types for custom instrumentation and memory pressure monitoring, so callers need not import pkg/observer or pkg/memorypressure.
type Option ¶
type Option = loggerruntime.Option
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. Its policy replaces the MemoryCriticalRatio, MinAvailableMemoryBytes and MemoryCriticalConsecutiveHits of the spool settings. Without it, each spool that enables UseMemoryPressureForOverload starts and stops its own monitor with those settings.
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.
func WithTelemetryErrorHandler ¶ added in v0.7.0
WithTelemetryErrorHandler sets the function that a Telemetry calls with the errors of its delivery: a batch of spans that could not be sent after the retries, spans that a receiver rejected, and spans dropped because a queue was full or because they ended after Shutdown started. Dropped spans are reported in one error per destination at most once per ExportInterval.
The function may be called concurrently from several goroutines, and the delivery to a destination waits until it returns, so it should return quickly. A panic in it is recovered and written to the standard logger. Without this option, each error is written as one line to the standard logger. To pass the errors to the error handler of the OpenTelemetry SDK, pass otel.Handle. Loggers do not use this option.
type OutputSettings ¶ added in v0.3.0
type OutputSettings = pkglogger.OutputSettings
OutputSettings are the settings of an output that can change while a logger runs: its Level, the lowest severity it records, and its Sampling.
type OutputSettingsChange ¶ added in v0.3.0
type OutputSettingsChange = pkglogger.OutputSettingsChange
OutputSettingsChange changes the Level or some Sampling fields of one output. A nil field keeps the current value.
type RenamedEnvironmentKeyError ¶
type RenamedEnvironmentKeyError = pkgenv.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 ¶
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 ¶
ForceClose stops accepting new entries, releases callers waiting in Close or Shutdown, and requests the background and recovery work, such as spool replay and the compression and upload of log files, to stop. It returns without waiting, while the regular cleanup continues in the background. Unless shutdown has already finished, it returns ErrForcedClose, which the released Close and Shutdown calls also return; after shutdown has finished, it returns the result of that shutdown. Unfinished checkpoints or archives may remain, and OS I/O may still need time to complete.
func (*Runtime) OutputSettings ¶ added in v0.3.0
func (r *Runtime) OutputSettings() map[LogOutputDestination]OutputSettings
OutputSettings returns the current settings of each output of the logger. Outputs used only for internal log notifications are not included.
func (*Runtime) Shutdown ¶
Shutdown starts graceful shutdown and waits until it completes or ctx ends. If ctx has already ended, it returns ctx.Err() without starting shutdown. Cancellation only stops this caller's wait; cleanup continues. A later Close or Shutdown joins cleanup. Use ForceClose to request aborting recovery work.
func (*Runtime) UpdateOutputSettings ¶ added in v0.3.0
func (r *Runtime) UpdateOutputSettings(changes map[LogOutputDestination]OutputSettingsChange) (map[LogOutputDestination]AppliedOutputSettings, error)
UpdateOutputSettings changes the level and sampling of outputs while the logger runs and returns the settings of each changed output right before and after the change. It applies each change to the settings current when it runs, so changes to different fields made at the same time, for example through the admin API, do not undo each other. It checks every change first and applies none of them when any is invalid; an output the logger does not use is reported as ErrUnknownOutput, and an invalid value as a pkg/logger ConfigFieldError. Changes take effect from the next entry and are not kept after the process exits.
type SamplingChange ¶ added in v0.5.0
type SamplingChange = pkglogger.SamplingChange
SamplingChange changes the fields of the sampling settings of one output that it sets. A nil field keeps the current value. See pkg/logger.
type SamplingConfig ¶ added in v0.3.0
type SamplingConfig = pkglogger.SamplingConfig
SamplingConfig configures how an output samples entries. See pkg/logger.
type SettingsController ¶ added in v0.3.0
type SettingsController = pkglogger.SettingsController
SettingsController is a logger whose output settings can change while it runs. *Runtime and *AsyncRuntime implement it.
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, so the level, message and time of a log appear twice in its output. ReplaceAttr can remove time and level from the fields, but removing msg also empties the message. 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 Span ¶
type Span = pkgobserver.Span
These aliases name the types for custom instrumentation and memory pressure monitoring, so callers need not import pkg/observer or pkg/memorypressure.
type SpoolConfig ¶
type SpoolConfig = pkgspool.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 = pkgcloudwatchlogs.StreamRouting
StreamRouting selects time partitioning for CloudWatch Logs stream names.
type Telemetry ¶ added in v0.7.0
type Telemetry struct {
// contains filtered or unexported fields
}
Telemetry records spans and metrics with its Tracer and Meter and delivers them, together with those from the OpenTelemetry SDK passed through package otelexport, to the destinations of its TelemetryConfig. Obtain one with NewTelemetry; the zero value records nothing. Do not copy a Telemetry.
func NewTelemetry ¶ added in v0.7.0
NewTelemetry starts delivering spans and metrics to the destinations of cfg. It returns the errors of cfg.Validate, and ErrNilContext for a nil ctx. ctx applies only to construction. Call Shutdown when the application exits to send the spans and metrics that are still queued.
Of opts, only the Meter of WithObservers and WithTelemetryErrorHandler are used: the Meter records the heterolog_trace_* and heterolog_metric_* metrics of the delivery, and the error handler receives its errors. The delivery does not create spans for its own sending, so the Tracer of WithObservers is not used.
To trace and measure the work of loggers, pass the Tracer and the Meter of the Telemetry to the loggers with WithObservers.
func (*Telemetry) Meter ¶ added in v0.7.0
Meter returns the Meter that records metrics. Counters are sent as cumulative sums, gauges as their last value, and histograms with the buckets of MetricsConfig.HistogramBounds, every MetricsConfig.ExportInterval. Without metric destinations, the Meter records nothing.
func (*Telemetry) Shutdown ¶ added in v0.7.0
Shutdown stops accepting spans and waits until the queued spans are sent, then collects the values of the Meter one last time, sends the queued metrics, and closes the destinations, or until ctx ends. If ctx ends first, it returns ctx.Err() and the sending continues in the background. Spans and metrics recorded after Shutdown started are dropped. A later Shutdown waits for the same cleanup.
func (*Telemetry) Tracer ¶ added in v0.7.0
Tracer returns the Tracer that records spans. It also implements pkg/observer OptionsTracer, which accepts a span kind and links. A span becomes a child of the span context in the context passed to StartSpan, and otherwise starts a new trace that TracesConfig.SamplingRatio decides to record or not. Without destinations, the Tracer records nothing.
type TelemetryConfig ¶ added in v0.7.0
type TelemetryConfig = pkgtelemetry.Config
TelemetryConfig configures NewTelemetry. See pkg/telemetry for its settings.
func DefaultTelemetryConfig ¶ added in v0.7.0
func DefaultTelemetryConfig() TelemetryConfig
DefaultTelemetryConfig returns settings with no destinations, which record nothing, and the host name and OS in Resource. Choose the destinations in Traces.Exporters and Metrics.Exporters, and set Resource.ServiceName.
type TelemetryMember ¶ added in v0.7.0
type TelemetryMember = pkgtelemetry.Telemetry
TelemetryMember is the interface of *Telemetry: a Tracer and a Meter whose data is delivered until Shutdown. AdminMembers.Telemetries takes it.
type TraceExporter ¶ added in v0.7.0
type TraceExporter = pkgtelemetry.TraceExporter
TraceExporter names a destination of spans in TelemetryConfig.
type TraceID ¶
type TraceID = pkgobserver.TraceID
These aliases name the types for custom instrumentation and memory pressure monitoring, so callers need not import pkg/observer or pkg/memorypressure.
type Tracer ¶
type Tracer = pkgobserver.Tracer
These aliases name the types for custom instrumentation and memory pressure monitoring, so callers need not import pkg/observer or pkg/memorypressure.
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
cmd
|
|
|
log-decrypt
command
|
|
|
log-recovery
command
|
|
|
examples
|
|
|
slog
command
Run with: go run ./examples/slog
|
Run with: go run ./examples/slog |
|
internal
|
|
|
application/configview
Package configviewは、loggerとtelemetryを作った設定を、管理用APIが返すJSONの文書に します。
|
Package configviewは、loggerとtelemetryを作った設定を、管理用APIが返すJSONの文書に します。 |
|
application/loggerruntime
Package loggerruntimeは、公開APIのNew・NewAsync・NewDeliveryの処理を受け持ちます。
|
Package loggerruntimeは、公開APIのNew・NewAsync・NewDeliveryの処理を受け持ちます。 |
|
application/logsearch
Package logsearchは、loggerが書いたlog fileから、語・level・期間で記録を探し、記録の数を 集計する処理です。
|
Package logsearchは、loggerが書いたlog fileから、語・level・期間で記録を探し、記録の数を 集計する処理です。 |
|
application/metricnames
Package metricnamesは、heterologが記録するmetricsとspan属性の名前と、属性の値です。
|
Package metricnamesは、heterologが記録するmetricsとspan属性の名前と、属性の値です。 |
|
application/metrics
Package metricsは、heterologのMeterを実装します。
|
Package metricsは、heterologのMeterを実装します。 |
|
application/outputsettings
Package outputsettingsは、稼働中のloggerの出力先ごとのlog levelとsampling設定を、 読み取り・変更する処理を提供します。
|
Package outputsettingsは、稼働中のloggerの出力先ごとのlog levelとsampling設定を、 読み取り・変更する処理を提供します。 |
|
application/status
Package statusは、稼働中のloggerとtelemetryの様子(processのCPUとmemory、出力先ごとの 送信の結果と所要時間、spoolとdirectoryの使用状況)を一つの報告にまとめ、注意すべき状態を 判定します。
|
Package statusは、稼働中のloggerとtelemetryの様子(processのCPUとmemory、出力先ごとの 送信の結果と所要時間、spoolとdirectoryの使用状況)を一つの報告にまとめ、注意すべき状態を 判定します。 |
|
application/telemetrydata
Package telemetrydataは、spanとmetricsに共通する記録の部品です。
|
Package telemetrydataは、spanとmetricsに共通する記録の部品です。 |
|
application/telemetryruntime
Package telemetryruntimeは、NewTelemetryが返すtelemetryの実体です。
|
Package telemetryruntimeは、NewTelemetryが返すtelemetryの実体です。 |
|
application/tracing
Package tracingは、heterologのTracerを実装します。
|
Package tracingは、heterologのTracerを実装します。 |
|
bootstrap
Package bootstrapは、application層のloggerの処理に、infrastructure層の実装を渡して loggerを組み立てます。
|
Package bootstrapは、application層のloggerの処理に、infrastructure層の実装を渡して loggerを組み立てます。 |
|
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について、旧名と現在のkey名の対応を定義します。
|
Package renamedkeyは、公開前に綴りを修正した環境変数keyと、値の意味を変えて名前を 変えたkeyについて、旧名と現在のkey名の対応を定義します。 |
|
goroutineid
Package goroutineidは、callbackが同じgoroutineから直接呼び直されたことを見分けるために、 今のgoroutineのidを読みます。
|
Package goroutineidは、callbackが同じgoroutineから直接呼び直されたことを見分けるために、 今のgoroutineのidを読みます。 |
|
infrastructure/delivery
Package deliveryは、NewTelemetryがspanとmetricsを送る仕組みのうち、送るものの種類に よらない部分です。
|
Package deliveryは、NewTelemetryがspanとmetricsを送る仕組みのうち、送るものの種類に よらない部分です。 |
|
infrastructure/delivery/failurestore
Package failurestoreは、NewTelemetryの送り先へ送れなかったもの(spanやmetric)を、 ログの出力先と同じ失敗処理(spool、failure archive、degrade、overload)へ渡し、spoolに 保存したものを送り直します。
|
Package failurestoreは、NewTelemetryの送り先へ送れなかったもの(spanやmetric)を、 ログの出力先と同じ失敗処理(spool、failure archive、degrade、overload)へ渡し、spoolに 保存したものを送り直します。 |
|
infrastructure/delivery/jsonlines
Package jsonlinesは、spanやmetricsのbatchをOTLP/JSONの1行にして書く送り先(fileと stdout)です。
|
Package jsonlinesは、spanやmetricsのbatchをOTLP/JSONの1行にして書く送り先(fileと stdout)です。 |
|
infrastructure/delivery/otlphttp
Package otlphttpは、spanやmetricsをOTLP/HTTPのprotobufで受信側(OpenTelemetry Collector、Grafana Tempoなど)へ送る送り先です。
|
Package otlphttpは、spanやmetricsをOTLP/HTTPのprotobufで受信側(OpenTelemetry Collector、Grafana Tempoなど)へ送る送り先です。 |
|
infrastructure/delivery/retrying
Package retryingは、spanやmetricsのbatchを送り先へ送る処理のうち、送り先によらない 部分です。
|
Package retryingは、spanやmetricsのbatchを送り先へ送る処理のうち、送り先によらない 部分です。 |
|
infrastructure/fsstore/checkpoint
Package checkpointは、ログファイルの宛先登録・送信完了記録と、そのファイル保存・再試行を管理します。
|
Package checkpointは、ログファイルの宛先登録・送信完了記録と、そのファイル保存・再試行を管理します。 |
|
infrastructure/fsstore/cipherfile
Package cipherfileは、log file・failure archive・OTLP/JSONのfileをdiskに書くときの 暗号化です。
|
Package cipherfileは、log file・failure archive・OTLP/JSONのfileをdiskに書くときの 暗号化です。 |
|
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は、loggerの送信からdurable failure handlerへ渡す、 backendに依存しない結果を定義します。
|
Package failureは、loggerの送信からdurable failure handlerへ渡す、 backendに依存しない結果を定義します。 |
|
infrastructure/logger/flushfailure
Package flushfailureは、logger backendへの送信失敗後に実行する共通処理を提供します。
|
Package flushfailureは、logger backendへの送信失敗後に実行する共通処理を提供します。 |
|
infrastructure/logger/flushfailure/degradehandler
Package degradehandlerは、主たるdurable failure storeが明示的に無効化されたときに使う、 直接退避の経路を提供します。
|
Package degradehandlerは、主たるdurable failure storeが明示的に無効化されたときに使う、 直接退避の経路を提供します。 |
|
infrastructure/logger/flushfailure/evacuation
Package evacuationは、直接のdegradationと、durable storeのoverload処理とで共有する 退避先のwriterを提供します。
|
Package evacuationは、直接のdegradationと、durable storeのoverload処理とで共有する 退避先のwriterを提供します。 |
|
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/logreader
Package logreaderは、file loggerが書いたplain textのlog fileを、記録ごとに読みます。
|
Package logreaderは、file loggerが書いたplain textのlog fileを、記録ごとに読みます。 |
|
infrastructure/logrecovery
Package logrecoveryは、停止中のアプリケーションのログファイルと、traceとmetricsの 送信失敗archiveを手動復旧します。
|
Package logrecoveryは、停止中のアプリケーションのログファイルと、traceとmetricsの 送信失敗archiveを手動復旧します。 |
|
infrastructure/metrics
Package metricsは、NewTelemetryのmetricsの配送の仕組みです。
|
Package metricsは、NewTelemetryのmetricsの配送の仕組みです。 |
|
infrastructure/metrics/otlp
Package otlpは、metricsをOTLP(OpenTelemetry Protocol)のprotobufとJSONに変換します。
|
Package otlpは、metricsをOTLP(OpenTelemetry Protocol)のprotobufとJSONに変換します。 |
|
infrastructure/metrics/victoriametrics
Package victoriametricsは、metricsをPrometheusのtext形式(exposition format)で VictoriaMetricsの/api/v1/import/prometheusへ送る送り先です。
|
Package victoriametricsは、metricsをPrometheusのtext形式(exposition format)で VictoriaMetricsの/api/v1/import/prometheusへ送る送り先です。 |
|
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/otlpcommon
Package otlpcommonは、OTLP(OpenTelemetry Protocol)の、spanとmetricsに共通する部分の 変換です。
|
Package otlpcommonは、OTLP(OpenTelemetry Protocol)の、spanとmetricsに共通する部分の 変換です。 |
|
infrastructure/shutdown
Package shutdownは、受理済み処理の完了を待つ正常終了の進捗を通知します。
|
Package shutdownは、受理済み処理の完了を待つ正常終了の進捗を通知します。 |
|
infrastructure/spool/compressedlog/internal/testutil
Package replaytestは、compressed logのrunnerとworkerのtestで共有するfixtureを提供します。
|
Package replaytestは、compressed logのrunnerとworkerのtestで共有するfixtureを提供します。 |
|
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/status
Package statusは、管理用APIのstatusの報告に使う、OSとfile systemの読み取りです。
|
Package statusは、管理用APIのstatusの報告に使う、OSとfile systemの読み取りです。 |
|
infrastructure/storageowner
Package storageownerは、object storageへ送れなかった圧縮ログを保存するdirectory (圧縮ログのspoolとfailure archive)を、所有者ごとに分ける名前を定義します。
|
Package storageownerは、object storageへ送れなかった圧縮ログを保存するdirectory (圧縮ログのspoolとfailure archive)を、所有者ごとに分ける名前を定義します。 |
|
infrastructure/telemetry
Package telemetryは、loggerが記録するmetricsとspan属性の記録の共通処理をまとめます。
|
Package telemetryは、loggerが記録するmetricsとspan属性の記録の共通処理をまとめます。 |
|
infrastructure/traces
Package tracesは、NewTelemetryのtraceの配送の仕組みです。
|
Package tracesは、NewTelemetryのtraceの配送の仕組みです。 |
|
infrastructure/traces/clickhouse
Package clickhouseは、spanをClickHouseの表へ書く送り先です。
|
Package clickhouseは、spanをClickHouseの表へ書く送り先です。 |
|
infrastructure/traces/opensearch
Package opensearchは、spanをOpenSearchへ文書として書く送り先です。
|
Package opensearchは、spanをOpenSearchへ文書として書く送り先です。 |
|
infrastructure/traces/otlp
Package otlpは、終わったspanをOTLP(OpenTelemetry Protocol)のprotobufとJSONに変換します。
|
Package otlpは、終わったspanをOTLP(OpenTelemetry Protocol)のprotobufとJSONに変換します。 |
|
pathcaserule
Package pathcaseruleは、試験だけがpathidentityのdirectoryの大小文字の規則を差し替えるための 内部hookです。
|
Package pathcaseruleは、試験だけがpathidentityのdirectoryの大小文字の規則を差し替えるための 内部hookです。 |
|
presentation/cli/logdecrypt
Package logdecryptは、暗号化したlog file・failure archive・OTLP/JSONのfileを秘密鍵で 復号するCLIと、その鍵を作るCLIと、log file(暗号化したfileを含む)を検索・集計するCLIです。
|
Package logdecryptは、暗号化したlog file・failure archive・OTLP/JSONのfileを秘密鍵で 復号するCLIと、その鍵を作るCLIと、log file(暗号化したfileを含む)を検索・集計するCLIです。 |
|
presentation/cli/logrecovery
Package logrecovery はアプリケーション停止中の手動ログ復旧CLIを提供します。
|
Package logrecovery はアプリケーション停止中の手動ログ復旧CLIを提供します。 |
|
presentation/envconfig
Package envconfigは、HETEROLOG_の環境変数とenv fileから届く設定の入力窓口です。
|
Package envconfigは、HETEROLOG_の環境変数とenv fileから届く設定の入力窓口です。 |
|
presentation/http/admin
Package adminは、稼働中のloggerの出力先ごとのlog levelとsampling設定を読み取り・ 変更し、loggerとtelemetryを作った設定と様子を返し、log fileを検索する、HTTPの管理用APIの 受け口です。
|
Package adminは、稼働中のloggerの出力先ごとのlog levelとsampling設定を読み取り・ 変更し、loggerとtelemetryを作った設定と様子を返し、log fileを検索する、HTTPの管理用APIの 受け口です。 |
|
presentation/otelexport
Package otelexportは、OpenTelemetry SDKから届くspanとmetricsの入口です。
|
Package otelexportは、OpenTelemetry SDKから届くspanとmetricsの入口です。 |
|
presentation/sloghandler
Package sloghandlerは、標準libraryのlog/slogから届くlogの入力窓口です。
|
Package sloghandlerは、標準libraryのlog/slogから届くlogの入力窓口です。 |
|
testutil
Package testutilは、ファイルシステム関連の回帰試験で共用する補助関数を提供します。
|
Package testutilは、ファイルシステム関連の回帰試験で共用する補助関数を提供します。 |
|
testutil/boundedwait
Package boundedwaitは、試験が処理の完了を待つ時間に上限を設ける共通helperです。
|
Package boundedwaitは、試験が処理の完了を待つ時間に上限を設ける共通helperです。 |
|
testutil/checkpoint
Package checkpointtestは、checkpointの統合test用のfilesystem fixtureを提供します。
|
Package checkpointtestは、checkpointの統合test用のfilesystem fixtureを提供します。 |
|
testutil/configfixture
Package configfixtureは、公開されている環境設定の例からofflineのfixtureを作成します。
|
Package configfixtureは、公開されている環境設定の例からofflineのfixtureを作成します。 |
|
testutil/errortree
Package errortreeは、errors.Joinや%wでまとめたerror treeから型付きerrorを探す試験用helperです。
|
Package errortreeは、errors.Joinや%wでまとめたerror treeから型付きerrorを探す試験用helperです。 |
|
testutil/observertest
Package observertestは、loggerが記録したmetricsとspanを試験で確かめるための、 記録するだけのTracerとMeterを提供します。
|
Package observertestは、loggerが記録したmetricsとspanを試験で確かめるための、 記録するだけのTracerとMeterを提供します。 |
|
testutil/uploadertest
Package uploadertestは試験用の送信入力をコンストラクタ経由で作成します。
|
Package uploadertestは試験用の送信入力をコンストラクタ経由で作成します。 |
|
Package otelexport passes spans and metrics from the OpenTelemetry SDK to a heterolog.Telemetry, which delivers them together with the spans and metrics of its own Tracer and Meter.
|
Package otelexport passes spans and metrics from the OpenTelemetry SDK to a heterolog.Telemetry, which delivers them together with the spans and metrics of its own Tracer and Meter. |
|
pkg
|
|
|
admin
Package admin holds the configuration types of the admin API, which reads and changes the level and sampling of the outputs of running loggers and reports the configuration of loggers and telemetries.
|
Package admin holds the configuration types of the admin API, which reads and changes the level and sampling of the outputs of running loggers and reports the configuration of loggers and telemetries. |
|
cloudwatchlogs
Package cloudwatchlogs provides a lightweight client that calls the AWS CloudWatch Logs PutLogEvents and CreateLogStream APIs with SigV4-signed HTTP requests.
|
Package cloudwatchlogs provides a lightweight client that calls the AWS CloudWatch Logs PutLogEvents and CreateLogStream APIs with SigV4-signed HTTP requests. |
|
env
Package env reads the values of environment variables as typed configuration values.
|
Package env reads the values of environment variables as typed configuration values. |
|
failurestore
Package failurestore defines the durable store selection values shared by failure pipelines with different payload formats.
|
Package failurestore defines the durable store selection values shared by failure pipelines with different payload formats. |
|
internal/endpointurl
Package endpointurlは、pkg配下のclientが送信先endpointのURLを解析するときに、URLのuser info (ユーザー名・パスワード)を解析エラーの文面へ含めないための補助です。
|
Package endpointurlは、pkg配下のclientが送信先endpointのURLを解析するときに、URLのuser info (ユーザー名・パスワード)を解析エラーの文面へ含めないための補助です。 |
|
objectstorage/validation
Package validation validates the typed settings of object storage upload destinations.
|
Package validation validates the typed settings of object storage upload destinations. |
|
observer
Package observer defines the instrumentation interfaces that heterolog loggers report to.
|
Package observer defines the instrumentation interfaces that heterolog loggers report to. |
|
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 resolves the real path of a storage location when the location is initialized, and generates comparison keys for paths.
|
Package pathidentity resolves the real path of a storage location when the location is initialized, and generates comparison keys for paths. |
|
retry
Package retry runs a function again after it fails.
|
Package retry runs a function again after it fails. |
|
shutdown
Package shutdown defines the result of an explicit forced shutdown.
|
Package shutdown defines the result of an explicit forced shutdown. |
|
spool
Package spool defines the records that the spool keeps for log entries whose delivery failed, and the per-record results that the replay workers collect when they resend a batch of those records to the backend.
|
Package spool defines the records that the spool keeps for log entries whose delivery failed, and the per-record results that the replay workers collect when they resend a batch of those records to the backend. |
|
spool/spoollifecycle
Package spoollifecycle holds the settings that control the retention of finalized spool records.
|
Package spoollifecycle holds the settings that control the retention of finalized spool records. |
|
spool/spoolrunner
Package spoolrunner holds the settings of the workers that replay durable failure spools.
|
Package spoolrunner holds the settings of the workers that replay durable failure spools. |
|
spool/spoolsupervisor
Package spoolsupervisor holds the settings of the supervisor that restarts spool replay workers.
|
Package spoolsupervisor holds the settings of the supervisor that restarts spool replay workers. |
|
telemetry
Package telemetry defines the configuration of heterolog.NewTelemetry, which delivers spans and metrics, from the Tracer and the Meter of heterolog and from the OpenTelemetry SDK, to OTLP/HTTP receivers, OpenSearch, ClickHouse, VictoriaMetrics, files and stdout.
|
Package telemetry defines the configuration of heterolog.NewTelemetry, which delivers spans and metrics, from the Tracer and the Meter of heterolog and from the OpenTelemetry SDK, to OTLP/HTTP receivers, OpenSearch, ClickHouse, VictoriaMetrics, files and stdout. |
|
testenv
|
|
|
windows/configfixture
command
configfixtureは、Windowsのtest用にofflineの設定rootを生成します。
|
configfixtureは、Windowsのtest用にofflineの設定rootを生成します。 |
|
windows/directory-sync-probe
command
directory-sync-probeは、新しく作成したtest directoryで、Windowsのdirectory flush APIを 比較します。
|
directory-sync-probeは、新しく作成したtest directoryで、Windowsのdirectory flush APIを 比較します。 |