Skip to content

Commit

Permalink
chore: update trace id
Browse files Browse the repository at this point in the history
Signed-off-by: surajgour-d11 <[email protected]>
  • Loading branch information
surajgour-d11 committed Dec 10, 2024
1 parent 8ad4b94 commit 24f4e49
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
3 changes: 2 additions & 1 deletion cmd/deploy/service-set.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ func executeDeployServiceSet(cmd *cobra.Command) {

err := serviceClient.DeployServiceSet(&ctx, &deployServiceSetRequest, traceId)
if err != nil {
log.Fatal("Failed to deploy service ", err)
log.Info("TraceId: ", traceId)
log.Fatal("Failed to deploy service set", err)
}
}
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (
)

func main() {
// Configure Logrus to disable timestamps
// Configure Logrus to fix timestamp format
logrus.SetFormatter(&logrus.TextFormatter{
TimestampFormat: "2006-01-02 15:04:05", // Custom format
FullTimestamp: true,
Expand Down
6 changes: 2 additions & 4 deletions pkg/util/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,10 @@ package util

import (
"fmt"
v1 "github.com/dream11/odin/proto/gen/go/dream11/od/service/v1"
"github.com/google/uuid"
"net"
"strings"
"time"

v1 "github.com/dream11/odin/proto/gen/go/dream11/od/service/v1"
)

// SplitProviderAccount splits string into list of cloud provider accounts
Expand Down Expand Up @@ -56,5 +54,5 @@ func GenerateResponseMessageComponentSpecific(response *v1.ServiceResponse, comp

// GenerateTraceId generates a trace id
func GenerateTraceId() string {
return fmt.Sprintf("%d-%s", time.Now().Unix(), strings.Split(uuid.New().String(), "-")[0])
return fmt.Sprintf("%s", uuid.New().String())

Check failure on line 57 in pkg/util/util.go

View workflow job for this annotation

GitHub Actions / lint

the argument is already a string, there's no need to use fmt.Sprintf (S1025)
}

0 comments on commit 24f4e49

Please sign in to comment.