Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitaly.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
authorQuang-Minh Nguyen <qmnguyen@gitlab.com>2023-02-03 13:41:24 +0300
committerQuang-Minh Nguyen <qmnguyen@gitlab.com>2023-02-13 09:21:02 +0300
commitb74f3f6bd8f59bc51659ee39c951bc17bf58037d (patch)
treef2ae6ba93aa9c08a47ce0bac9615df8fbbc4d412 /cmd
parentfd0acf85438d466dd431105de4f90ffb3bf97d5e (diff)
tracing: Add a root span to Gitaly bootstrap
When Gitaly process bootstraps, it issues some git commands. So, we need to create a span there as a root trace of those commands.
Diffstat (limited to 'cmd')
-rw-r--r--cmd/gitaly/main.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/cmd/gitaly/main.go b/cmd/gitaly/main.go
index df49c8b44..2577b1c02 100644
--- a/cmd/gitaly/main.go
+++ b/cmd/gitaly/main.go
@@ -9,6 +9,7 @@ import (
"time"
"github.com/go-enry/go-license-detector/v4/licensedb"
+ "github.com/opentracing/opentracing-go"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promauto"
log "github.com/sirupsen/logrus"
@@ -145,6 +146,9 @@ func run(cfg config.Cfg) error {
ctx, cancel := context.WithCancel(context.Background())
defer cancel()
+ bootstrapSpan, ctx := opentracing.StartSpanFromContext(ctx, "gitaly-bootstrap")
+ defer bootstrapSpan.Finish()
+
if cfg.RuntimeDir != "" {
if err := config.PruneOldGitalyProcessDirectories(log.StandardLogger(), cfg.RuntimeDir); err != nil {
return fmt.Errorf("prune runtime directories: %w", err)
@@ -406,6 +410,7 @@ func run(cfg config.Cfg) error {
if err := b.Start(); err != nil {
return fmt.Errorf("unable to start the bootstrap: %v", err)
}
+ bootstrapSpan.Finish()
shutdownWorkers, err := maintenance.StartWorkers(
ctx,