Documentation
¶
Index ¶
- func Context(ctx context.Context, traceID, spanID string, traceTrue bool) (context.Context, error)
- func Must(f func() error, err error) func() error
- func MustSetup(projectID, serviceName, revision string, timeout time.Duration) func() error
- func Setup(projectID, serviceName, revision string, timeout time.Duration) (func() error, error)
- type XCloudTraceContext
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type XCloudTraceContext ¶
https://cloud.google.com/trace/docs/setup#force-trace
func Parse ¶
func Parse(xCloudTraceContext string) (*XCloudTraceContext, error)
Example ¶
package main import ( "fmt" "github.com/itsubaki/tracer" ) func main() { // TRACE_ID/SPAN_ID;o=TRACE_TRUE xc, err := tracer.Parse("105445aa7843bc8bf206b12000100000/0000000000000001;o=1") if err != nil { panic(err) } fmt.Println(xc.TraceID) fmt.Println(xc.SpanID) fmt.Println(xc.TraceTrue) }
Output: 105445aa7843bc8bf206b12000100000 0000000000000001 true
Click to show internal directories.
Click to hide internal directories.