Skip to content

Commit

Permalink
Merge pull request #72 from muir/sixty
Browse files Browse the repository at this point in the history
Prepare list of what needs to be address before release
  • Loading branch information
muir authored Sep 25, 2022
2 parents 9161587 + 8f7e993 commit cf73418
Show file tree
Hide file tree
Showing 12 changed files with 63 additions and 40 deletions.
18 changes: 18 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
*.zzzgo linguist-language=Go
doc.go linguist-documentation
*.md linguist-documentation
basegroup.go linguist-generated
line.go linguist-generated
seed.go linguist-generated
span.go linguist-generated
sub.go linguist-generated
internal/enumer_test.go linguist-generated
trace/hexbytes.go linguist-generated
xopat/attributes.go linguist-generated
xopbase/base.go linguist-generated
xopjson/attributes.go linguist-generated
xopjson/jsonlogger.go linguist-generated
xopotel/otel.go linguist-generated
xoptest/testlogger.go linguist-generated
xoputil/skip.go linguist-generated
xoptest/xoptestutil/enums.go linguist-generated
9 changes: 7 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,16 @@ ZZZGENERATED = $(patsubst %.zzzgo, %.go, $(ZZZGO))
TOOLS = ${GOBIN}/gofumpt ${GOBIN}/goimports ${GOBIN}/enumer
TEST_ONLY =?

all: $(ZZZGENERATED)
all: $(ZZZGENERATED) .gitattributes
go generate ./...
go build ./...

.gitattributes: $(ZZZGENERATED)
echo '*.zzzgo linguist-language=Go' > $@
echo 'doc.go linguist-documentation' >> $@
echo '*.md linguist-documentation' >> $@
for i in $(ZZZGENERATED); do echo "$$i linguist-generated" >> $@; done

test: $(ZZZGENERATED) testadjuster
go generate ./...
go test -v ./xopjson/... -run TestASingleLine
Expand Down Expand Up @@ -87,4 +93,3 @@ OTEL_TAG="v1.12.0"

otel-generate: ../opentelemetry-specification ../opentelemetry-go
cd ../opentelemetry-specification && git pull && git checkout tags/$(OTEL_TAG)

51 changes: 36 additions & 15 deletions TODO.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,32 @@

# required before ready to use in production

- documentation

- rewrite README.md

- 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?
Expand Down Expand Up @@ -52,21 +78,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

Expand Down Expand Up @@ -104,6 +116,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.

Expand Down Expand Up @@ -196,6 +215,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
Expand Down
4 changes: 0 additions & 4 deletions line.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 0 additions & 4 deletions line.zzzgo
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,6 @@ func (line *Line) Any(k string, v interface{}) *Line {
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
Expand Down
2 changes: 1 addition & 1 deletion logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 0 additions & 5 deletions xopat/attributes.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 0 additions & 5 deletions xopat/attributes.zzzgo
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion xopjson/jsonlogger_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
1 change: 0 additions & 1 deletion xopjson/models.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ type Logger struct {
stackLineRewrite func(string) string
timeFormatter TimeFormatter
activeRequests sync.WaitGroup
// TODO: withGoroutine bool
}

type request struct {
Expand Down
1 change: 0 additions & 1 deletion xopotel/otel.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion xopotel/otel.zzzgo
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down

0 comments on commit cf73418

Please sign in to comment.