• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

pace / bricks / 11250208184

09 Oct 2024 07:25AM UTC coverage: 57.466% (-13.7%) from 71.177%
11250208184

push

github

web-flow
Merge pull request #380 from pace/sentry-tracing-poc

tracing: replace Jaeger with Sentry

140 of 206 new or added lines in 19 files covered. (67.96%)

3 existing lines in 3 files now uncovered.

5515 of 9597 relevant lines covered (57.47%)

21.77 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

89.29
/pkg/context/transfer.go
1
package context
2

3
import (
4
        "context"
5

6
        "github.com/getsentry/sentry-go"
7
        http "github.com/pace/bricks/http/middleware"
8
        "github.com/pace/bricks/http/oauth2"
9
        "github.com/pace/bricks/locale"
10
        "github.com/pace/bricks/maintenance/errors"
11
        "github.com/pace/bricks/maintenance/log"
12
        "github.com/pace/bricks/maintenance/log/hlog"
13
        "github.com/pace/bricks/pkg/redact"
14
        "github.com/pace/bricks/pkg/tracking/utm"
15
)
16

17
// Transfer takes the logger, log.Sink, authentication, request and
18
// error info from the given context and returns a complete
19
// new context with all these objects.
20
func Transfer(in context.Context) context.Context {
9✔
21
        // transfer logger, log.Sink, authentication and error info
9✔
22
        out := log.Ctx(in).WithContext(context.Background())
9✔
23
        out = log.SinkContextTransfer(in, out)
9✔
24
        out = oauth2.ContextTransfer(in, out)
9✔
25
        out = errors.ContextTransfer(in, out)
9✔
26
        out = http.ContextTransfer(in, out)
9✔
27
        out = redact.ContextTransfer(in, out)
9✔
28
        out = utm.ContextTransfer(in, out)
9✔
29
        out = hlog.ContextTransfer(in, out)
9✔
30
        out = TransferTracingContext(in, out)
9✔
31
        out = locale.ContextTransfer(in, out)
9✔
32
        out = TransferExternalDependencyContext(in, out)
9✔
33

9✔
34
        return out
9✔
35
}
9✔
36

37
func TransferTracingContext(in, out context.Context) context.Context {
9✔
38
        span := sentry.SpanFromContext(in)
9✔
39
        if span != nil {
9✔
NEW
40
                out = span.Context()
×
41
        }
×
42
        return out
9✔
43
}
44

45
func TransferExternalDependencyContext(in, out context.Context) context.Context {
9✔
46
        edc := http.ExternalDependencyContextFromContext(in)
9✔
47
        if edc == nil {
18✔
48
                return out
9✔
49
        }
9✔
50
        return http.ContextWithExternalDependency(out, edc)
×
51
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc