reorganize exporters and simplify their use
This commit is contained in:
@ -10,8 +10,7 @@ import (
|
||||
|
||||
"git.ma-al.com/gora_filip/observer/pkg/tracer"
|
||||
"git.ma-al.com/gora_filip/pkg/attr"
|
||||
"git.ma-al.com/gora_filip/pkg/combined_exporter"
|
||||
"git.ma-al.com/gora_filip/pkg/console_exporter"
|
||||
"git.ma-al.com/gora_filip/pkg/exporters"
|
||||
"git.ma-al.com/gora_filip/pkg/fiber_tracing"
|
||||
"git.ma-al.com/gora_filip/pkg/level"
|
||||
"github.com/gofiber/fiber/v2"
|
||||
@ -26,19 +25,17 @@ func main() {
|
||||
StreamRequestBody: true,
|
||||
})
|
||||
|
||||
lvl := level.DEBUG
|
||||
exporter := combined_exporter.NewExporter(
|
||||
console_exporter.NewExporter(
|
||||
console_exporter.ExporterOptions{
|
||||
FilterOnLevel: &lvl,
|
||||
//EmitOnlyOnError: true,
|
||||
},
|
||||
))
|
||||
exps := make([]exporters.ExporterWithConfig, 2)
|
||||
exps = append(exps, exporters.DevConsoleExporter())
|
||||
gelfExp, err := exporters.GelfExporter()
|
||||
if err == nil {
|
||||
exps = append(exps, gelfExp)
|
||||
}
|
||||
main.Use(fiber_tracing.NewMiddleware(fiber_tracing.Config{
|
||||
AppName: "example",
|
||||
Version: "0.0.0",
|
||||
ServiceProvider: "maal",
|
||||
Exporter: exporter,
|
||||
Exporters: exps,
|
||||
}))
|
||||
defer fiber_tracing.ShutdownTracer()
|
||||
|
||||
|
Reference in New Issue
Block a user