Versions in this module Expand all Collapse all v2 v2.0.0 Feb 21, 2025 Changes in this version + const Header + const LambdaTaskRootKey + const LambdaTraceHeaderKey + const SDKInitializedFileFolder + const SDKInitializedFileName + const SDKType + const SDKVersion + const TraceIDHeaderKey + var ContextKey = new(ContextKeytype) + var ErrRetrieveSegment = errors.New("unable to retrieve segment") + func AddAnnotation(ctx context.Context, key string, value interface{}) error + func AddError(ctx context.Context, err error) error + func AddMetadata(ctx context.Context, key string, value interface{}) error + func AddMetadataToNamespace(ctx context.Context, namespace string, key string, value interface{}) error + func Capture(ctx context.Context, name string, fn func(context.Context) error) (err error) + func CaptureAsync(ctx context.Context, name string, fn func(context.Context) error) + func Client(c *http.Client) *http.Client + func Configure(c Config) error + func ContextWithConfig(ctx context.Context, c Config) (context.Context, error) + func DetachContext(ctx context.Context) context.Context + func Handler(sn SegmentNamer, h http.Handler) http.Handler + func HandlerWithContext(ctx context.Context, sn SegmentNamer, h http.Handler) http.Handler + func HttpCaptureResponse(seg *Segment, statusCode int) + func HttpTrace(seg *Segment, h http.Handler, w http.ResponseWriter, r *http.Request, ...) + func NewSegmentID() string + func NewTraceID() string + func RequestWasTraced(ctx context.Context) bool + func RoundTripper(rt http.RoundTripper) http.RoundTripper + func SQLConnector(dsn string, connector driver.Connector) driver.Connector + func SQLContext(driver, dsn string) (*sql.DB, error) + func SdkDisabled() bool + func SetLogger(l xraylog.Logger) + func TraceID(ctx context.Context) string + func UnaryClientInterceptor(clientInterceptorOptions ...GrpcOption) grpc.UnaryClientInterceptor + func UnaryServerInterceptor(serverInterceptorOptions ...GrpcOption) grpc.UnaryServerInterceptor + type CauseData struct + Exceptions []exception.Exception + Paths []string + WorkingDirectory string + type ClientTrace struct + func NewClientTrace(opCtx context.Context) (ct *ClientTrace, err error) + type Config struct + ContextMissingStrategy ctxmissing.Strategy + DaemonAddr string + Emitter Emitter + ExceptionFormattingStrategy exception.FormattingStrategy + LogFormat string + LogLevel string + SamplingStrategy sampling.Strategy + ServiceVersion string + StreamingStrategy StreamingStrategy + func GetRecorder(ctx context.Context) *Config + type ContextKeytype int + type DefaultEmitter struct + func NewDefaultEmitter(raddr *net.UDPAddr) (*DefaultEmitter, error) + func (de *DefaultEmitter) Emit(seg *Segment) + func (de *DefaultEmitter) RefreshEmitterWithAddress(raddr *net.UDPAddr) + type DefaultStreamingStrategy struct + MaxSubsegmentCount uint32 + func NewDefaultStreamingStrategy() (*DefaultStreamingStrategy, error) + func NewDefaultStreamingStrategyWithMaxSubsegmentCount(maxSubsegmentCount int) (*DefaultStreamingStrategy, error) + func (dSS *DefaultStreamingStrategy) RequiresStreaming(seg *Segment) bool + func (dSS *DefaultStreamingStrategy) StreamCompletedSubsegments(seg *Segment) [][]byte + type DynamicSegmentNamer struct + FallbackName string + RecognizedHosts string + func NewDynamicSegmentNamer(fallback string, recognized string) *DynamicSegmentNamer + func (dSN *DynamicSegmentNamer) Name(host string) string + type Emitter interface + Emit func(seg *Segment) + RefreshEmitterWithAddress func(raddr *net.UDPAddr) + type FastHTTPHandler interface + Handler func(SegmentNamer, fasthttp.RequestHandler) fasthttp.RequestHandler + func NewFastHTTPInstrumentor(cfg *Config) FastHTTPHandler + type FixedSegmentNamer struct + FixedName string + func NewFixedSegmentNamer(name string) *FixedSegmentNamer + func (fSN *FixedSegmentNamer) Name(host string) string + type GrpcOption interface + func WithRecorder(cfg *Config) GrpcOption + func WithSegmentNamer(sn SegmentNamer) GrpcOption + type HTTPData struct + Request *RequestData + Response *ResponseData + func (d *HTTPData) GetRequest() *RequestData + func (d *HTTPData) GetResponse() *ResponseData + type HTTPSubsegments struct + func NewHTTPSubsegments(opCtx context.Context) *HTTPSubsegments + func (xt *HTTPSubsegments) ConnectDone(network, addr string, err error) + func (xt *HTTPSubsegments) ConnectStart(network, addr string) + func (xt *HTTPSubsegments) DNSDone(info httptrace.DNSDoneInfo) + func (xt *HTTPSubsegments) DNSStart(info httptrace.DNSStartInfo) + func (xt *HTTPSubsegments) GetConn(hostPort string) + func (xt *HTTPSubsegments) GotConn(info *httptrace.GotConnInfo, err error) + func (xt *HTTPSubsegments) GotFirstResponseByte() + func (xt *HTTPSubsegments) TLSHandshakeDone(connState tls.ConnectionState, err error) + func (xt *HTTPSubsegments) TLSHandshakeStart() + func (xt *HTTPSubsegments) WroteRequest(info httptrace.WroteRequestInfo) + type RecorderContextKey struct + type RequestData struct + ClientIP string + Method string + Traced bool + URL string + UserAgent string + XForwardedFor bool + type ResponseData struct + ContentLength int + Status int + type SDK struct + RuleName string + Type string + Version string + type SQLData struct + ConnectionString string + DatabaseType string + DatabaseVersion string + DriverVersion string + Preparation string + SanitizedQuery string + URL string + User string + type Segment struct + AWS map[string]interface{} + Annotations map[string]interface{} + Cause *CauseData + Configuration *Config + ContextDone bool + Dummy bool + Emitted bool + EndTime float64 + Error bool + Facade bool + Fault bool + HTTP *HTTPData + ID string + InProgress bool + IncomingHeader *header.Header + Metadata map[string]map[string]interface{} + Name string + Namespace string + Origin string + ParentID string + ParentSegment *Segment + PrecursorIDs []string + RequestWasTraced bool + ResourceARN string + SQL *SQLData + Sampled bool + Service *ServiceData + StartTime float64 + Subsegments []json.RawMessage + Throttle bool + TraceID string + Type string + User string + func BeginFacadeSegment(ctx context.Context, name string, h *header.Header) (context.Context, *Segment) + func BeginSegment(ctx context.Context, name string) (context.Context, *Segment) + func BeginSegmentWithSampling(ctx context.Context, name string, r *http.Request, traceHeader *header.Header) (context.Context, *Segment) + func BeginSubsegment(ctx context.Context, name string) (context.Context, *Segment) + func BeginSubsegmentWithoutSampling(ctx context.Context, name string) (context.Context, *Segment) + func GetSegment(ctx context.Context) *Segment + func NewSegmentFromHeader(ctx context.Context, name string, r *http.Request, h *header.Header) (context.Context, *Segment) + func (s *Segment) AddRuleName(sd *sampling.Decision) + func (s *Segment) DownstreamHeader() *header.Header + func (s *Segment) GetAWS() map[string]interface{} + func (s *Segment) GetCause() *CauseData + func (s *Segment) GetConfiguration() *Config + func (s *Segment) GetHTTP() *HTTPData + func (s *Segment) GetSQL() *SQLData + func (s *Segment) GetService() *ServiceData + func (seg *Segment) AddAnnotation(key string, value interface{}) error + func (seg *Segment) AddError(err error) error + func (seg *Segment) AddMetadata(key string, value interface{}) error + func (seg *Segment) AddMetadataToNamespace(namespace string, key string, value interface{}) error + func (seg *Segment) Close(err error) + func (seg *Segment) CloseAndStream(err error) + func (seg *Segment) RemoveSubsegment(remove *Segment) bool + type SegmentNamer interface + Name func(host string) string + type ServiceData struct + Runtime string + RuntimeVersion string + Version string + type StreamingStrategy interface + RequiresStreaming func(seg *Segment) bool + StreamCompletedSubsegments func(seg *Segment) [][]byte Other modules containing this package github.com/jj22ee/aws-xray-sdk-go