refactors air.toml configuration, updates Go dependencies, and improves application startup telemetry and signal handling.
This commit is contained in:
9
main.go
9
main.go
@@ -16,13 +16,13 @@ import (
|
||||
"os"
|
||||
"os/signal"
|
||||
"sync"
|
||||
"syscall"
|
||||
"time"
|
||||
|
||||
"github.com/rs/zerolog"
|
||||
"go.opentelemetry.io/otel/attribute"
|
||||
"go.opentelemetry.io/otel/codes"
|
||||
"go.opentelemetry.io/otel/trace"
|
||||
"golang.org/x/sys/unix"
|
||||
|
||||
"gitea.libretechconsulting.com/rmcguire/go-app/pkg/app"
|
||||
"gitea.libretechconsulting.com/rmcguire/go-app/pkg/otel"
|
||||
@@ -50,7 +50,7 @@ var (
|
||||
)
|
||||
|
||||
func main() {
|
||||
ctx, cncl := signal.NotifyContext(context.Background(), os.Interrupt, unix.SIGTERM)
|
||||
ctx, cncl := signal.NotifyContext(context.Background(), os.Interrupt, syscall.SIGTERM, syscall.SIGQUIT)
|
||||
defer cncl()
|
||||
|
||||
// Load configuration and setup logging. The go-app framework
|
||||
@@ -96,6 +96,11 @@ func main() {
|
||||
app.GRPC = grpcSvcs
|
||||
app.HTTP = httpSvcs
|
||||
|
||||
span.SetAttributes(
|
||||
attribute.Int("grpcServices", len(app.GRPC.Services)),
|
||||
attribute.Int("httpServices", len(app.HTTP.Funcs)+len(app.HTTP.Handlers)),
|
||||
)
|
||||
|
||||
// Launch app
|
||||
app.MustRun()
|
||||
|
||||
|
Reference in New Issue
Block a user