diff --git a/TODO.md b/TODO.md index cd184c85..9536fbec 100644 --- a/TODO.md +++ b/TODO.md @@ -1,6 +1,28 @@ +# required before ready to use in production + +- test + + - xopotel.BaseLogger() + - actually feed xopotel traces into Jaeger + - redact functions + - propogation + +- xopjson + + - change request.ver -> span.ver + +- drop rest/ or finish it + +- integrations + + - resty + - remove dependency on mux in middleware + # Ideas to ponder +- could we drop xopbase.Logger.ID() in favor of using pointers? or change ID sequential integers? Add Name()? + - is Attribute.ExampleValue() useful? It's not enforcable at compile time for Any. - rename LogLine/Line to Entry? @@ -52,21 +74,7 @@ # Just do it (build ready) -- redaction - - - add log setting for redacting Any types. - - `type RedactAnyFunc(*Log, key string, value interface{}) interface{}` - - The idea being that it can log an additional thing if it wants - - - add log setting for redacting string types. - - `type RedactAnyFunc(*Log, key string, value string) string` - - The idea being that it can log an additional thing if it wants - - - add redaction option to pre-registering attributes. +- make deepcopy function configurable - dictionary support @@ -104,6 +112,13 @@ - Pre-encoded data - Add Object(func(*BaseType)) - Add Pairs(k, v, k, v, ...) + - URLs + +- Round out the types of attributes + + - uint + - table + - url - Write panic trappers. Should log the panic and flush. @@ -196,6 +211,8 @@ - can *Sub be Sub instead? Would that have better performance? + - preallocate blocks of Attributes + - Standard tracing - figure out a way to modify trace State diff --git a/line.go b/line.go index f6a37352..bd94818f 100644 --- a/line.go +++ b/line.go @@ -45,17 +45,12 @@ func (line *Line) Any(k string, v interface{}) *Line { return line } if line.log.span.referencesKept { - // TODO: make copy function configurable v = deepcopy.Copy(v) } line.line.Any(k, v) return line } -// TODO: func (l *Log) Guage(name string, value float64, ) -// TODO: func (l *Log) AdjustCounter(name string, value float64, ) -// TODO: func (l *Log) Event - func (line *Line) Float32(k string, v float32) *Line { line.line.Float64(k, float64(v), xopbase.Float32DataType) return line diff --git a/logger.go b/logger.go index 88ddf91c..a61533c9 100644 --- a/logger.go +++ b/logger.go @@ -53,7 +53,7 @@ type shared struct { FlushTimer *time.Timer FlushDelay time.Duration FlushActive int32 // 1 == timer is running, 0 = timer is not running - Flushers map[string]xopbase.Request // key is xopbase.Logger.ID() // TODO: change key to int? + Flushers map[string]xopbase.Request // key is xopbase.Logger.ID() Description string LogCount int32 ActiveDetached map[int32]*Log diff --git a/xopat/attributes.go b/xopat/attributes.go index aadc95bb..320c230c 100644 --- a/xopat/attributes.go +++ b/xopat/attributes.go @@ -13,11 +13,6 @@ import ( "github.com/muir/xop-go/trace" ) -// TODO: PERFORMANCE: pre-allocate blocks of 128 Attributes to provide better locality of reference when using these -// TODO: UintAttribute? -// TODO: TableAttribute? -// TODO: URLAttribute? - // Attribute is the base type for the keys that are used to add // key/value metadata to spans. The actual keys are matched to the // values to provide compile-time type checking on the metadata calls. diff --git a/xopat/attributes.zzzgo b/xopat/attributes.zzzgo index 1c5ed593..a64a5c54 100644 --- a/xopat/attributes.zzzgo +++ b/xopat/attributes.zzzgo @@ -11,11 +11,6 @@ import ( "github.com/muir/xop-go/trace" ) -// TODO: PERFORMANCE: pre-allocate blocks of 128 Attributes to provide better locality of reference when using these -// TODO: UintAttribute? -// TODO: TableAttribute? -// TODO: URLAttribute? - // Attribute is the base type for the keys that are used to add // key/value metadata to spans. The actual keys are matched to the // values to provide compile-time type checking on the metadata calls. diff --git a/xopjson/jsonlogger_test.go b/xopjson/jsonlogger_test.go index 51d97488..b794bdee 100644 --- a/xopjson/jsonlogger_test.go +++ b/xopjson/jsonlogger_test.go @@ -53,7 +53,7 @@ type supersetObject struct { RequestID string `json:"request.id"` State string `json:"trace.state"` Baggage string `json:"trace.baggage"` - RequestVersion int `json:"request.ver"` // TODO: change to span.ver? + RequestVersion int `json:"request.ver"` // spans diff --git a/xopjson/models.go b/xopjson/models.go index 4fd0fddb..129ed62a 100644 --- a/xopjson/models.go +++ b/xopjson/models.go @@ -58,7 +58,6 @@ type Logger struct { stackLineRewrite func(string) string timeFormatter TimeFormatter activeRequests sync.WaitGroup - // TODO: withGoroutine bool } type request struct { diff --git a/xopotel/otel.go b/xopotel/otel.go index c0666a60..8081cdee 100644 --- a/xopotel/otel.go +++ b/xopotel/otel.go @@ -75,7 +75,6 @@ func SpanLog(ctx context.Context, name string, extraModifiers ...xop.SeedModifie // BaseLogger provides SeedModifiers to set up an OTEL Tracer as a xopbase.Logger // so that xop logs are output through the OTEL Tracer. -// TODO: test this func BaseLogger(ctx context.Context, tracer oteltrace.Tracer, doLogging bool) xop.SeedModifier { return xop.CombineSeedModifiers( xop.WithBase(&logger{ diff --git a/xopotel/otel.zzzgo b/xopotel/otel.zzzgo index 5b0633a6..910ce1d2 100644 --- a/xopotel/otel.zzzgo +++ b/xopotel/otel.zzzgo @@ -72,7 +72,6 @@ func SpanLog(ctx context.Context, name string, extraModifiers ...xop.SeedModifie // BaseLogger provides SeedModifiers to set up an OTEL Tracer as a xopbase.Logger // so that xop logs are output through the OTEL Tracer. -// TODO: test this func BaseLogger(ctx context.Context, tracer oteltrace.Tracer, doLogging bool) xop.SeedModifier { return xop.CombineSeedModifiers( xop.WithBase(&logger{