Files
services/helloworld/main.go
Dominic Wong 5cd61c7dfb Tracing (#156)
2021-06-11 17:50:32 +01:00

26 lines
505 B
Go

package main
import (
"github.com/micro/micro/v3/service"
"github.com/micro/micro/v3/service/logger"
"github.com/micro/services/helloworld/handler"
"github.com/micro/services/pkg/tracing"
)
func main() {
// Create service
srv := service.New(
service.Name("helloworld"),
)
// Register Handler
srv.Handle(new(handler.Helloworld))
traceCloser := tracing.SetupOpentracing("helloworld")
defer traceCloser.Close()
// Run the service
if err := srv.Run(); err != nil {
logger.Fatal(err)
}
}