Related Tools
samber/do
Section titled “samber/do”samber/do is a dependency injection framework based on Go’s type system. do-auditlog is a plugin for do v2 — it cannot function without it.
If you’re not using samber/do yet, check it out first:
go get github.com/samber/do/v2go-output
Section titled “go-output”go-output provides the rendering engines for Mermaid, PlantUML, DOT, D2, tree, and table export formats. do-auditlog depends on it for all diagram and table output.
If you need custom diagram generation outside of do-auditlog, go-output is a standalone library with validated escaping for every format.
md-go-validator
Section titled “md-go-validator”md-go-validator validates code blocks in Markdown and MDX files. This website’s CI uses it to ensure code examples are syntactically valid Go.
Other Go DI Observability Tools
Section titled “Other Go DI Observability Tools”| Tool | Scope | How It Compares |
|---|---|---|
| do-auditlog | samber/do v2 only | Full lifecycle audit with 9+ export formats and HTML visualization |
| wire analyze | google/wire | Compile-time only — no runtime audit |
| dig introspection | uber/dig | dig.Container.Visualize for graph output, no event timeline |
Complementary Patterns
Section titled “Complementary Patterns”Prometheus Integration
Section titled “Prometheus Integration”Use Config.OnEvent to stream metrics:
plugin, _ := auditlog.New(auditlog.Config{ Enabled: true, OnEvent: func(ev auditlog.Event) { if ev.Phase == auditlog.PhaseAfter && ev.EventType == auditlog.EventTypeInvocation { invocationDuration.Observe(ev.Duration().Seconds()) } },})OpenTelemetry Spans
Section titled “OpenTelemetry Spans”plugin, _ := auditlog.New(auditlog.Config{ Enabled: true, OnEvent: func(ev auditlog.Event) { if ev.EventType == auditlog.EventTypeInvocation && ev.Phase == auditlog.PhaseAfter { _, span := tracer.Start(context.Background(), ev.ServiceName) defer span.End() } },})