Documentation ¶
Index ¶
Constants ¶
View Source
const ( // Package name used as instrumentation ID PackageName = "goctopus.sdk.spot.websocket" // Package version PackageVersion = "0.0.0" // Span & events namespace TracesNamespace = "goctopus.spot.websocket" )
Variables ¶
This section is empty.
Functions ¶
func HandleAndTraLogError ¶
A helper function to trace and log an error (if any), set the provided span status accordingly and return the input error.
The function is meant to replace code blocks like this:
if err != nil { logger.Println(err) span.RecordError(err) span.SetStatus(codes.Error, codes.Error.String()) return err } span.SetStatus(codes.Ok, codes.Ok.String()) return nil
By this:
return HandleAndTraLogError(span, err)
func HandleAndTraceError ¶
A helper function to trace an error (if any), set the provided span status accordingly and return the input error.
The function is meant to replace code blocks like this:
if err != nil { span.RecordError(err) span.SetStatus(codes.Error, codes.Error.String()) return err } span.SetStatus(codes.Ok, codes.Ok.String()) return nil
By this:
return HandleAndTraceError(span, err)
func TraceErrorAndSetStatus ¶
A helper function to trace an error (if any) and set the provided span status accordingly.
The function is meant to replace code blocks like this:
if err != nil { span.RecordError(err) span.SetStatus(codes.Error, codes.Error.String()) } else { span.SetStatus(codes.Ok, codes.Ok.String()) }
By this:
TraceErrorAndSetStatus(span, err)
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.