diff options
author | Justin Tobler <jtobler@gitlab.com> | 2023-02-16 03:32:01 +0300 |
---|---|---|
committer | Justin Tobler <jtobler@gitlab.com> | 2023-02-16 03:32:01 +0300 |
commit | d4daa7a154ccc86d1b57372e4265bb502c886537 (patch) | |
tree | 64f6a4b735c7292274630adfa9d1ed22e0207e13 /cmd | |
parent | 954816989a09915efa2cad385f92e53b25b01675 (diff) | |
parent | b74f3f6bd8f59bc51659ee39c951bc17bf58037d (diff) |
Merge branch 'qmnguyen0711/improve-tracing' into 'master'
Make distributed tracing useful to Gitaly
See merge request https://gitlab.com/gitlab-org/gitaly/-/merge_requests/5338
Merged-by: Justin Tobler <jtobler@gitlab.com>
Approved-by: Justin Tobler <jtobler@gitlab.com>
Approved-by: Toon Claes <toon@gitlab.com>
Reviewed-by: Justin Tobler <jtobler@gitlab.com>
Co-authored-by: Quang-Minh Nguyen <qmnguyen@gitlab.com>
Diffstat (limited to 'cmd')
-rw-r--r-- | cmd/gitaly/main.go | 5 |
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, |