Skip to content

Commit 45749e0

Browse files
committed
bundle-server: add region tracing
Using the logger in the 'bundleWebServer' struct, use 'TraceLogger.Region()' to log web requests as a region. Note that, unlike the 'git-bundle-server' regions, these regions will have different session IDs than those of the program startup logs. This is intentional, as the regions being added are scoped to the request, and are not "parented" by the overarching web server session. Signed-off-by: Victoria Dye <[email protected]>
1 parent 7ec84f8 commit 45749e0

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

cmd/git-bundle-web-server/bundle-server.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,9 @@ func (b *bundleWebServer) parseRoute(ctx context.Context, path string) (string,
6666
func (b *bundleWebServer) serve(w http.ResponseWriter, r *http.Request) {
6767
ctx := r.Context()
6868

69+
ctx, exitRegion := b.logger.Region(ctx, "http", "serve")
70+
defer exitRegion()
71+
6972
path := r.URL.Path
7073
owner, repo, file, err := b.parseRoute(ctx, path)
7174
if err != nil {

0 commit comments

Comments
 (0)