Merged in feature/semver (pull request #93)
Add semantic versioning to all services * working * Merge branch 'main' of bitbucket.org:aarete/query-orchestration into feature/semver * 1.24 mod * go upgrade * tool * Merge branch 'main' of bitbucket.org:aarete/query-orchestration into feature/semver
This commit is contained in:
@@ -3,6 +3,8 @@ package server
|
||||
import (
|
||||
"context"
|
||||
|
||||
"queryorchestration/internal/serviceconfig/observability"
|
||||
|
||||
"queryorchestration/internal/database/migrations"
|
||||
"queryorchestration/internal/serviceconfig"
|
||||
|
||||
@@ -41,6 +43,9 @@ func New(ctx context.Context, cfg Config) (func() error, error) {
|
||||
cfg.PrintConfig(DEFAULT_SECRET_PREFIX)
|
||||
closeTracer := cfg.SetOtel(ctx)
|
||||
|
||||
version := observability.GetVersion()
|
||||
cfg.GetLogger().Info("Starting", "version", version)
|
||||
|
||||
err := migrations.Run(ctx, cfg)
|
||||
if err != nil {
|
||||
return func() error { return nil }, err
|
||||
|
||||
@@ -4,6 +4,8 @@ import (
|
||||
"context"
|
||||
"log/slog"
|
||||
|
||||
"runtime/debug"
|
||||
|
||||
"queryorchestration/internal/serviceconfig/observability/prometheus"
|
||||
|
||||
"go.opentelemetry.io/otel"
|
||||
@@ -15,6 +17,14 @@ const (
|
||||
SystemName = "doczy"
|
||||
)
|
||||
|
||||
func GetVersion() string {
|
||||
info, ok := debug.ReadBuildInfo()
|
||||
if !ok {
|
||||
return "unknown"
|
||||
}
|
||||
return info.Main.Version
|
||||
}
|
||||
|
||||
type ConfigProvider interface {
|
||||
IsOtelEnabled() bool
|
||||
SetOtel(context.Context) func() error
|
||||
|
||||
Reference in New Issue
Block a user