Documentation ¶
Overview ¶
Package oplog implements standard (but extensible) logging for operations (events with status, start/end times). Useful for operational queries and dashboarding with CloudWatch Insights/Metrics. Using standard attributes describing operations and their status allows easy creation of Cloudwatch alarms for discrete system operations. The 3 level (namespace, component, operation) hierarchy enables grouping when graphing/querying. For example, if the hierarchy has top level namespace of "logprocessor" then you can see all errors where namespace="logprocessor" in single graph/query. Similarly you can compute latency and other performance related metrics in aggregate over different _standard_ dimensions.
Example usage:
manager := oplog.NewManager("panther", "logprocessor") // record every S3 object read operation := manager.Start("readlogfile") defer func() { operation.Stop() operation.Log(err, zap.String("bucket", bucket), zap.String("object", object)) }() ... code to read log from S3
Index ¶
Constants ¶
const ( Success = "success" Failure = "failure" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Manager ¶
func NewManager ¶
type Operation ¶
type Operation struct { Manager *Manager Name string Dimensions []zap.Field StartTime time.Time EndTime time.Time }