-
-
Notifications
You must be signed in to change notification settings - Fork 30
/
client.go
35 lines (30 loc) · 921 Bytes
/
client.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
package tracing
import (
"net/http"
opentracing "github.com/opentracing/opentracing-go"
"github.com/oxyno-zeta/s3-proxy/pkg/s3-proxy/config"
"github.com/oxyno-zeta/s3-proxy/pkg/s3-proxy/log"
)
// Service interface.
type Service interface {
// Reload service (useful for configuration change).
Reload() error
// Get global tracer object.
GetTracer() opentracing.Tracer
}
// Trace object interface.
type Trace interface {
// Set tag on trace.
SetTag(key string, value interface{})
// Get child trace with an operation name.
GetChildTrace(operationName string) Trace
// Will finish the trace.
Finish()
// Get trace id as a string (useful for logs).
GetTraceID() string
// InjectInHTTPHeader will inject span in http header for forwarding.
InjectInHTTPHeader(header http.Header) error
}
func New(cfgManager config.Manager, logger log.Logger) (Service, error) {
return newService(cfgManager, logger)
}