tracing

package
v1.7.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 23, 2024 License: AGPL-3.0 Imports: 66 Imported by: 1

Documentation

Index

Constants

View Source
const (
	SpanTypeFuncs      = "funcs"
	SpanTypeHTTPServer = "httpserver"
	SpanTypeHTTPClient = "httpclient"
	SpanTypeDB         = "db"
	SpanTypeRPC        = "rpc"
	SpanTypeMessaging  = "messaging"
	SpanTypeFAAS       = "faas"

	EventTypeLog     = "log"
	EventTypeMessage = "message"
	EventTypeOther   = "other-events"
)
View Source
const (
	SystemUnknown = "unknown"

	SystemAll       = "all"
	SystemEventsAll = "events:all"
	SystemSpansAll  = "spans:all"

	SystemLogAll   = "log:all"
	SystemLogError = "log:error"
	SystemLogFatal = "log:fatal"
	SystemLogPanic = "log:panic"
)
View Source
const (
	StatusCodeUnset = "unset"
	StatusCodeError = "error"
	StatusCodeOK    = "ok"
)
View Source
const (
	SpanKindInternal = "internal"
	SpanKindServer   = "server"
	SpanKindClient   = "client"
	SpanKindProducer = "producer"
	SpanKindConsumer = "consumer"
)
View Source
const (
	InternalSpanKind = "internal"
	ServerSpanKind   = "server"
	ClientSpanKind   = "client"
	ProducerSpanKind = "producer"
	ConsumerSpanKind = "consumer"
)
View Source
const (
	OKStatusCode    = "ok"
	ErrorStatusCode = "error"
)

Variables

Functions

func AppendCHAttr

func AppendCHAttr(b []byte, attr tql.Attr) []byte

func AppendCHColumn

func AppendCHColumn(b []byte, expr *tql.Column, dur time.Duration) ([]byte, error)

func AppendCHExpr

func AppendCHExpr(b []byte, expr tql.Expr, dur time.Duration) ([]byte, error)

func AppendFilter

func AppendFilter(filter tql.Filter, dur time.Duration) ([]byte, error)

func AppendWhereHaving

func AppendWhereHaving(ast *tql.Where, dur time.Duration) ([]byte, []byte, error)

func BuildSpanIndexQuery added in v1.7.0

func BuildSpanIndexQuery(
	db *ch.DB, f *SpanFilter, dur time.Duration,
) (*ch.SelectQuery, *orderedmap.OrderedMap[string, *ColumnInfo])

func DecodeSpanFilter

func DecodeSpanFilter(req bunrouter.Request, f *SpanFilter) error

func Init

func Init(ctx context.Context, app *bunapp.App)

func IsIndexedAttr

func IsIndexedAttr(attrKey string) bool

func NewSpanIndexQuery

func NewSpanIndexQuery(db *ch.DB) *ch.SelectQuery

func SelectAttrKeys added in v1.7.0

func SelectAttrKeys(ctx context.Context, app *bunapp.App, f *SpanFilter) ([]string, error)

func SelectSpan

func SelectSpan(ctx context.Context, app *bunapp.App, span *Span) error

func SplitTypeSystem

func SplitTypeSystem(s string) (string, string)

Types

type AttrHandler

type AttrHandler struct {
	*bunapp.App
}

func NewAttrHandler

func NewAttrHandler(app *bunapp.App) *AttrHandler

func (*AttrHandler) AttrKeys

func (h *AttrHandler) AttrKeys(w http.ResponseWriter, req bunrouter.Request) error

func (*AttrHandler) AttrValues

func (h *AttrHandler) AttrValues(w http.ResponseWriter, req bunrouter.Request) error

type AttrKeyItem

type AttrKeyItem struct {
	Value  string `json:"value"`
	Pinned bool   `json:"pinned"`
}

type AttrMap

type AttrMap map[string]any

func (AttrMap) Clone

func (m AttrMap) Clone() AttrMap

func (AttrMap) Delete added in v1.7.2

func (m AttrMap) Delete(key string)

func (AttrMap) Duration

func (m AttrMap) Duration(key string) time.Duration

func (AttrMap) Exists added in v1.7.2

func (m AttrMap) Exists(key string) bool

func (AttrMap) Get added in v1.7.2

func (m AttrMap) Get(key string) (any, bool)

func (AttrMap) GetAsLCString added in v1.7.2

func (m AttrMap) GetAsLCString(key string) string

func (AttrMap) GetString added in v1.7.2

func (m AttrMap) GetString(key string) string

func (AttrMap) HostName

func (m AttrMap) HostName() string

func (AttrMap) Int64

func (m AttrMap) Int64(key string) int64

func (AttrMap) Merge

func (m AttrMap) Merge(other AttrMap)

func (AttrMap) PutString added in v1.7.2

func (m AttrMap) PutString(key, val string)

func (AttrMap) ServiceName

func (m AttrMap) ServiceName() string

func (AttrMap) ServiceNameOrUnknown

func (m AttrMap) ServiceNameOrUnknown() string

func (AttrMap) SetClashingKeys

func (m AttrMap) SetClashingKeys(key string, value any)

func (AttrMap) SetDefault

func (m AttrMap) SetDefault(key string, value any)

func (AttrMap) Text

func (m AttrMap) Text(key string) string

func (AttrMap) Time

func (m AttrMap) Time(key string) time.Time

func (AttrMap) Uint64

func (m AttrMap) Uint64(key string) uint64

type AttrName

type AttrName struct {
	Canonical string
	Alts      []string
}

type AttrValueItem

type AttrValueItem struct {
	Value string `json:"value"`
	Count uint64 `json:"count"`
	Hint  string `json:"hint"`
}

func SelectAttrValues added in v1.7.0

func SelectAttrValues(
	ctx context.Context, app *bunapp.App, f *SpanFilter, attrKey string,
) ([]*AttrValueItem, bool, error)

type CloudwatchLog

type CloudwatchLog struct {
	MessageType         string               `json:"messageType"`
	Owner               string               `json:"owner"`
	LogGroup            string               `json:"logGroup"`
	LogStream           string               `json:"logStream"`
	SubscriptionFilters []string             `json:"subscriptionFilters"`
	LogEvents           []CloudwatchLogEvent `json:"logEvents"`
}

type CloudwatchLogEvent

type CloudwatchLogEvent struct {
	ID        string `json:"id"`
	Timestamp int64  `json:"timestamp"`
	Message   string `json:"message"`
}

type ColumnInfo

type ColumnInfo struct {
	Name    string `json:"name"`
	Unit    string `json:"unit"`
	IsNum   bool   `json:"isNum"`
	IsGroup bool   `json:"isGroup"`
}

type EdgeType

type EdgeType string
const (
	EdgeTypeUnset     EdgeType = "unset"
	EdgeTypeHTTP      EdgeType = "http"
	EdgeTypeDB        EdgeType = "db"
	EdgeTypeMessaging EdgeType = "messaging"
)

type GroupHandler

type GroupHandler struct {
	*bunapp.App
}

func NewGroupHandler

func NewGroupHandler(app *bunapp.App) *GroupHandler

func (*GroupHandler) ShowSummary

func (h *GroupHandler) ShowSummary(w http.ResponseWriter, req bunrouter.Request) error

type Int64OrString

type Int64OrString int64

func (*Int64OrString) UnmarshalJSON

func (n *Int64OrString) UnmarshalJSON(b []byte) error

type KinesisEvent

type KinesisEvent struct {
	RequestID string               `json:"requestId"`
	Records   []KinesisEventRecord `json:"records"`
}

type KinesisEventRecord

type KinesisEventRecord struct {
	Data []byte `json:"data"`
}

type KinesisHandler

type KinesisHandler struct {
	*bunapp.App
	// contains filtered or unexported fields
}

func NewKinesisHandler

func NewKinesisHandler(app *bunapp.App, sp *SpanProcessor) *KinesisHandler

func (*KinesisHandler) Logs

type LogsServiceServer

type LogsServiceServer struct {
	collectorlogspb.UnimplementedLogsServiceServer

	*bunapp.App
	// contains filtered or unexported fields
}

func NewLogsServiceServer

func NewLogsServiceServer(app *bunapp.App, sp *SpanProcessor) *LogsServiceServer

func (*LogsServiceServer) ExportHTTP

type PublicHandler added in v1.7.0

type PublicHandler struct {
	*bunapp.App
}

func NewPublicHandler added in v1.7.0

func NewPublicHandler(app *bunapp.App) *PublicHandler

func (*PublicHandler) Groups added in v1.7.0

func (*PublicHandler) Spans added in v1.7.0

type PublicSpan added in v1.7.0

type PublicSpan struct {
	ID         idgen.SpanID  `json:"id"`
	ParentID   idgen.SpanID  `json:"parentId"`
	TraceID    idgen.TraceID `json:"traceId"`
	Standalone bool          `json:"standalone,omitempty"`

	Type      string `json:"type"`
	System    string `json:"system"`
	Operation string `json:"-"`
	GroupID   uint64 `json:"groupId,string"`
	Kind      string `json:"kind"`

	Name        string `json:"name"`
	EventName   string `json:"eventName,omitempty"`
	DisplayName string `json:"displayName"`

	Time     time.Time `json:"time"`
	Duration int64     `json:"duration"`

	StatusCode    string `json:"statusCode"`
	StatusMessage string `json:"statusMessage,omitempty"`

	Attrs  AttrMap      `json:"attrs"`
	Events []*SpanEvent `json:"events"`
	Links  []*SpanLink  `json:"links"`
}

type PublicSpanFilter added in v1.7.0

type PublicSpanFilter struct {
	urlstruct.Pager
	org.TimeFilter

	ProjectID uint32 `urlstruct:"-"`
	TraceID   idgen.TraceID
	ID        uint64
	ParentID  uint64
}

type SavedView

type SavedView struct {
	bun.BaseModel `bun:"saved_views,alias:v"`

	ID uint64 `json:"id" bun:",pk,autoincrement"`

	UserID    uint64 `json:"userId"`
	ProjectID uint32 `json:"projectId"`

	Name   string         `json:"name"`
	Route  string         `json:"route"`
	Params map[string]any `json:"params"`
	Query  map[string]any `json:"query"`
	Pinned bool           `json:"pinned"`

	CreatedAt time.Time `json:"createdAt" bun:",nullzero,notnull,default:now()"`
}

type SavedViewDetails

type SavedViewDetails struct {
	SavedView `bun:",inherit"`

	User *org.User `json:"user" bun:"-"`
}

type SavedViewHandler

type SavedViewHandler struct {
	*bunapp.App
}

func NewSavedViewHandler

func NewSavedViewHandler(app *bunapp.App) *SavedViewHandler

func (*SavedViewHandler) Create

func (*SavedViewHandler) Delete

func (*SavedViewHandler) List

func (*SavedViewHandler) Pin

func (*SavedViewHandler) Unpin

type SentryBreadcrumb

type SentryBreadcrumb struct {
	Type      string         `json:"type"`
	Category  string         `json:"category"`
	Message   string         `json:"message"`
	Data      map[string]any `json:"data"`
	Level     string         `json:"level"`
	Timestamp SentryTime     `json:"timestamp"`
}

type SentryEnvelopeHeader

type SentryEnvelopeHeader struct {
	DSN string `json:"dsn"`
}

type SentryEvent

type SentryEvent struct {
	Breadcrumbs json.RawMessage           `json:"breadcrumbs"`
	Contexts    map[string]map[string]any `json:"contexts"`
	Dist        string                    `json:"dist"`
	Environment string                    `json:"environment"`
	EventID     string                    `json:"event_id"`
	Extra       map[string]any            `json:"extra"`
	Fingerprint []string                  `json:"fingerprint"`
	Level       string                    `json:"level"`
	Message     string                    `json:"message"`
	Platform    string                    `json:"platform"`
	Release     string                    `json:"release"`
	SDK         struct {
		Name         string          `json:"name"`
		Version      string          `json:"version"`
		Integrations []string        `json:"integrations"`
		Packages     []SentryPackage `json:"packages"`
	} `json:"sdk"`
	ServerName  string            `json:"server_name"`
	Threads     []SentryThread    `json:"threads"`
	Tags        map[string]string `json:"tags"`
	Timestamp   SentryTime        `json:"timestamp"`
	Transaction string            `json:"transaction"`
	User        struct {
		ID        string            `json:"id"`
		Email     string            `json:"email"`
		IPAddress string            `json:"ip_address"`
		Username  string            `json:"username"`
		Name      string            `json:"name"`
		Segment   string            `json:"segment"`
		Data      map[string]string `json:"data"`
	} `json:"user"`
	Logger    string            `json:"logger"`
	Modules   map[string]string `json:"modules"`
	Request   *SentryRequest    `json:"request"`
	Exception json.RawMessage   `json:"exception"`

	Type            string       `json:"type"`
	StartTime       SentryTime   `json:"start_timestamp"`
	Spans           []SentrySpan `json:"spans"`
	TransactionInfo struct {
		Source string `json:"source"`
	} `json:"transaction_info"`
}

type SentryException

type SentryException struct {
	Type       string            `json:"type"`  // used as the main issue title
	Value      string            `json:"value"` // used as the main issue subtitle
	Module     string            `json:"module"`
	ThreadID   string            `json:"thread_id"`
	Stacktrace *SentryStacktrace `json:"stacktrace"`
	Mechanism  *SentryMechanism  `json:"mechanism"`
}

type SentryFrame

type SentryFrame struct {
	Function string `json:"function"`
	Symbol   string `json:"symbol"`
	// Module is, despite the name, the Sentry protocol equivalent of a Go
	// package's import path.
	Module      string         `json:"module"`
	Filename    string         `json:"filename"`
	AbsPath     string         `json:"abs_path"`
	Lineno      int            `json:"lineno"`
	Colno       int            `json:"colno"`
	PreContext  []string       `json:"pre_context"`
	ContextLine string         `json:"context_line"`
	PostContext []string       `json:"post_context"`
	InApp       bool           `json:"in_app"`
	Vars        map[string]any `json:"vars"`
	// Package and the below are not used for Go stack trace frames.  In
	// other platforms it refers to a container where the Module can be
	// found.  For example, a Java JAR, a .NET Assembly, or a native
	// dynamic library.  They exists for completeness, allowing the
	// construction and reporting of custom event payloads.
	Package         string `json:"package"`
	InstructionAddr string `json:"instruction_addr"`
	AddrMode        string `json:"addr_mode"`
	SymbolAddr      string `json:"symbol_addr"`
	ImageAddr       string `json:"image_addr"`
	Platform        string `json:"platform"`
	StackStart      bool   `json:"stack_start"`
}

func (*SentryFrame) AppendString

func (f *SentryFrame) AppendString(b []byte) []byte

type SentryHandler

type SentryHandler struct {
	*bunapp.App
	// contains filtered or unexported fields
}

func NewSentryHandler

func NewSentryHandler(app *bunapp.App, sp *SpanProcessor) *SentryHandler

func (*SentryHandler) Envelope

func (*SentryHandler) Store

type SentryItemHeader

type SentryItemHeader struct {
	Type   string `json:"type"`
	Length int64  `json:"length"`
}

type SentryMechanism

type SentryMechanism struct {
	Type        string         `json:"type"`
	Description string         `json:"description"`
	HelpLink    string         `json:"help_link"`
	Handled     *bool          `json:"handled"`
	Data        map[string]any `json:"data"`
}

type SentryPackage

type SentryPackage struct {
	Name    string `json:"name"`
	Version string `json:"version"`
}

type SentryRequest

type SentryRequest struct {
	URL         string            `json:"url"`
	Method      string            `json:"method"`
	Data        string            `json:"data"`
	QueryString string            `json:"query_string"`
	Cookies     string            `json:"cookies"`
	Headers     map[string]string `json:"headers"`
	Env         map[string]string `json:"env"`
}

type SentrySpan

type SentrySpan struct {
	TraceID      string            `json:"trace_id"`
	SpanID       string            `json:"span_id"`
	ParentSpanID string            `json:"parent_span_id"`
	Name         string            `json:"name"`
	Op           string            `json:"op"`
	Description  string            `json:"description"`
	Status       uint8             `json:"status"`
	Tags         map[string]string `json:"tags"`
	StartTime    SentryTime        `json:"start_timestamp"`
	EndTime      SentryTime        `json:"timestamp"`
	Data         map[string]any    `json:"data"`
}

type SentryStacktrace

type SentryStacktrace struct {
	Frames        []SentryFrame `json:"frames"`
	FramesOmitted []uint        `json:"frames_omitted"`
}

func (*SentryStacktrace) String

func (s *SentryStacktrace) String() string

type SentryThread

type SentryThread struct {
	ID         string            `json:"id"`
	Name       string            `json:"name"`
	Stacktrace *SentryStacktrace `json:"stacktrace"`
	Crashed    bool              `json:"crashed"`
	Current    bool              `json:"current"`
}

type SentryTime

type SentryTime struct {
	time.Time
}

func (*SentryTime) UnmarshalJSON

func (t *SentryTime) UnmarshalJSON(b []byte) error

type ServiceGraphEdge

type ServiceGraphEdge struct {
	ch.CHModel `ch:"service_graph_edges,insert:service_graph_edges_buffer,alias:e"`

	ProjectID uint32
	Type      EdgeType
	Time      time.Time `ch:"type:DateTime"`

	ClientName            string `ch:",lc"`
	ServerName            string `ch:",lc"`
	ServerAttr            string `ch:",lc"`
	DeploymentEnvironment string `ch:",lc"`
	ServiceNamespace      string `ch:",lc"`

	ClientDurationMin float32
	ClientDurationMax float32
	ClientDurationSum float32

	ServerDurationMin float32
	ServerDurationMax float32
	ServerDurationSum float32

	Count      uint32
	ErrorCount uint32
}

func (*ServiceGraphEdge) SetClientDuration

func (e *ServiceGraphEdge) SetClientDuration(span *SpanIndex)

func (*ServiceGraphEdge) SetServerDuration

func (e *ServiceGraphEdge) SetServerDuration(span *SpanIndex)

type ServiceGraphEdgeKey

type ServiceGraphEdgeKey struct {
	TraceID idgen.TraceID
	SpanID  idgen.SpanID
}

type ServiceGraphEdgeNode

type ServiceGraphEdgeNode struct {
	ServiceGraphEdge
	// contains filtered or unexported fields
}

func (*ServiceGraphEdgeNode) Expired

func (e *ServiceGraphEdgeNode) Expired() bool

func (*ServiceGraphEdgeNode) IsComplete

func (e *ServiceGraphEdgeNode) IsComplete() bool

type ServiceGraphHandler

type ServiceGraphHandler struct {
	*bunapp.App
}

func NewServiceGraphHandler

func NewServiceGraphHandler(app *bunapp.App) *ServiceGraphHandler

func (*ServiceGraphHandler) List

type ServiceGraphLink struct {
	Type       string `json:"type"`
	ClientName string `json:"clientName"`
	ServerName string `json:"serverName"`
	ServerAttr string `json:"serverAttr"`
	ServiceGraphStats
}

type ServiceGraphProcessor

type ServiceGraphProcessor struct {
	// contains filtered or unexported fields
}

func NewServiceGraphProcessor

func NewServiceGraphProcessor(app *bunapp.App) *ServiceGraphProcessor

func (*ServiceGraphProcessor) ProcessSpan

func (p *ServiceGraphProcessor) ProcessSpan(
	ctx context.Context, span *SpanIndex,
) error

type ServiceGraphStats

type ServiceGraphStats struct {
	DurationMin float32 `json:"durationMin"`
	DurationMax float32 `json:"durationMax"`
	DurationSum float64 `json:"durationSum"`
	DurationAvg float64 `json:"durationAvg"`
	Count       uint64  `json:"count"`
	Rate        float64 `json:"rate"`
	ErrorCount  uint64  `json:"errorCount"`
	ErrorRate   float64 `json:"errorRate"`
}

type ServiceGraphStore

type ServiceGraphStore struct {
	// contains filtered or unexported fields
}

func NewServiceGraphStore

func NewServiceGraphStore(
	size int,
	ttl time.Duration,
	onComplete func(ctx context.Context, edge *ServiceGraphEdge),
	onExpired func(ctx context.Context, edge *ServiceGraphEdge),
) *ServiceGraphStore

func (*ServiceGraphStore) WithEdge

func (s *ServiceGraphStore) WithEdge(
	ctx context.Context, key ServiceGraphEdgeKey, update func(edge *ServiceGraphEdge),
) (isNew bool, err error)

type Span

type Span struct {
	ID         idgen.SpanID  `json:"id" msgpack:"-" ch:"id"`
	ParentID   idgen.SpanID  `json:"parentId,omitempty" msgpack:"-"`
	TraceID    idgen.TraceID `json:"traceId" msgpack:"-" ch:"type:UUID"`
	Standalone bool          `json:"standalone,omitempty" ch:"-"`

	ProjectID uint32 `json:"projectId" msgpack:"-"`
	Type      string `json:"-" msgpack:"-" ch:",lc"`
	System    string `json:"system" ch:",lc"`
	GroupID   uint64 `json:"groupId,string"`
	Kind      string `json:"kind" ch:",lc"`

	Name        string `json:"name" ch:",lc"`
	EventName   string `json:"eventName,omitempty" ch:",lc"`
	DisplayName string `json:"displayName"`

	Time         time.Time     `json:"time" msgpack:"-"`
	Duration     time.Duration `json:"duration"`
	DurationSelf time.Duration `json:"durationSelf" msgpack:"-" ch:"-"`

	StartPct float32 `json:"startPct" msgpack:"-" ch:"-"`
	EndPct   float32 `json:"endPct" msgpack:"-" ch:"-"`

	StatusCode    string `json:"statusCode" ch:",lc"`
	StatusMessage string `json:"statusMessage"`

	Attrs  AttrMap      `json:"attrs" ch:"-"`
	Events []*SpanEvent `json:"events,omitempty" ch:"-"`
	Links  []*SpanLink  `json:"links,omitempty" ch:"-"`

	Children []*Span `json:"children,omitempty" msgpack:"-" ch:"-"`
	// contains filtered or unexported fields
}

func SelectTraceSpans

func SelectTraceSpans(
	ctx context.Context, app *bunapp.App, traceID idgen.TraceID,
) ([]*Span, bool, error)

func (*Span) AddChild

func (s *Span) AddChild(child *Span)

func (*Span) AddEvent

func (s *Span) AddEvent(event *SpanEvent)

func (*Span) EndTime

func (s *Span) EndTime() time.Time

func (*Span) Event

func (s *Span) Event() *SpanEvent

func (*Span) EventOrSpanName

func (s *Span) EventOrSpanName() string

func (*Span) IsError

func (s *Span) IsError() bool

func (*Span) IsEvent

func (s *Span) IsEvent() bool

func (*Span) TreeEndTime

func (s *Span) TreeEndTime() time.Time

func (*Span) TreeStartEndTime

func (s *Span) TreeStartEndTime() (time.Time, time.Time)

func (*Span) UpdateDurationSelf

func (s *Span) UpdateDurationSelf(child *Span, prevEndTime time.Time)

func (*Span) Walk

func (s *Span) Walk(fn func(child, parent *Span) error) error

type SpanData

type SpanData struct {
	ch.CHModel `ch:"table:spans_data_buffer,insert:spans_data_buffer,alias:s"`

	Type      string `ch:",lc"`
	ProjectID uint32
	TraceID   idgen.TraceID
	ID        idgen.SpanID
	ParentID  idgen.SpanID
	Time      time.Time `ch:"type:DateTime64(6)"`
	Data      []byte
}

func (*SpanData) Decode

func (sd *SpanData) Decode(span *Span) error

func (*SpanData) Span added in v1.7.0

func (sd *SpanData) Span() (*Span, error)

type SpanEvent

type SpanEvent struct {
	Name  string    `json:"name"`
	Time  time.Time `json:"time"`
	Attrs AttrMap   `json:"attrs"`

	System  string `json:"system,omitempty"`
	GroupID uint64 `json:"groupId,omitempty"`
}

type SpanFilter

type SpanFilter struct {
	org.OrderByMixin
	urlstruct.Pager
	TypeFilter

	Query string

	Search       string
	SearchTokens []chquery.Token `urlstruct:"-"`

	Column []string

	AttrKey     string
	SearchInput string

	QueryParts []*tql.QueryPart `urlstruct:"-"`
}

func (*SpanFilter) UnmarshalValues

func (f *SpanFilter) UnmarshalValues(ctx context.Context, values url.Values) error

type SpanHandler

type SpanHandler struct {
	*bunapp.App
}

func NewSpanHandler

func NewSpanHandler(app *bunapp.App) *SpanHandler

func (*SpanHandler) GroupStats

func (h *SpanHandler) GroupStats(w http.ResponseWriter, req bunrouter.Request) error

func (*SpanHandler) ListGroups

func (h *SpanHandler) ListGroups(w http.ResponseWriter, req bunrouter.Request) error

func (*SpanHandler) ListSpans

func (h *SpanHandler) ListSpans(w http.ResponseWriter, req bunrouter.Request) error

func (*SpanHandler) Percentiles

func (h *SpanHandler) Percentiles(w http.ResponseWriter, req bunrouter.Request) error

func (*SpanHandler) Timeseries

func (h *SpanHandler) Timeseries(w http.ResponseWriter, req bunrouter.Request) error

type SpanIndex

type SpanIndex struct {
	ch.CHModel `ch:"table:spans_index,insert:spans_index_buffer,alias:s"`

	*Span

	DisplayName string

	Count           float32
	LinkCount       uint8
	EventCount      uint8
	EventErrorCount uint8
	EventLogCount   uint8

	AllKeys      []string `ch:"type:Array(LowCardinality(String))"`
	StringKeys   []string `ch:"type:Array(LowCardinality(String))"`
	StringValues []string

	TelemetrySDKName     string `ch:",lc"`
	TelemetrySDKLanguage string `ch:",lc"`
	TelemetrySDKVersion  string `ch:",lc"`
	TelemetryAutoVersion string `ch:",lc"`

	OtelLibraryName    string `ch:",lc"`
	OtelLibraryVersion string `ch:",lc"`

	DeploymentEnvironment string `ch:",lc"`

	ServiceName      string `ch:",lc"`
	ServiceVersion   string `ch:",lc"`
	ServiceNamespace string `ch:",lc"`
	HostName         string `ch:",lc"`

	ClientAddress       string `ch:",lc"`
	ClientSocketAddress string `ch:",lc"`
	ClientSocketPort    int32

	URLScheme string `attr:"url.scheme" ch:",lc"`
	URLFull   string `attr:"url.full"`
	URLPath   string `attr:"url.path" ch:",lc"`

	HTTPRequestMethod      string `ch:",lc"`
	HTTPResponseStatusCode uint16
	HTTPRoute              string `ch:",lc"`

	RPCMethod  string `ch:",lc"`
	RPCService string `ch:",lc"`

	DBSystem    string `ch:",lc"`
	DBName      string `ch:",lc"`
	DBStatement string
	DBOperation string `ch:",lc"`
	DBSqlTable  string `ch:",lc"`

	LogSeverity   string `ch:",lc"`
	ExceptionType string `ch:",lc"`
}
type SpanLink struct {
	TraceID idgen.TraceID `json:"traceId"`
	SpanID  idgen.SpanID  `json:"spanId"`
	Attrs   AttrMap       `json:"attrs"`
}

type SpanProcessor

type SpanProcessor struct {
	*bunapp.App
	// contains filtered or unexported fields
}

func NewSpanProcessor

func NewSpanProcessor(app *bunapp.App) *SpanProcessor

func (*SpanProcessor) AddSpan

func (p *SpanProcessor) AddSpan(ctx context.Context, span *Span)

type SystemHandler

type SystemHandler struct {
	*bunapp.App
}

func NewSystemHandler

func NewSystemHandler(app *bunapp.App) *SystemHandler

func (*SystemHandler) ListSystems

func (h *SystemHandler) ListSystems(w http.ResponseWriter, req bunrouter.Request) error

type TraceHandler

type TraceHandler struct {
	*bunapp.App
}

func NewTraceHandler

func NewTraceHandler(app *bunapp.App) *TraceHandler

func (*TraceHandler) FindTrace

func (h *TraceHandler) FindTrace(w http.ResponseWriter, req bunrouter.Request) error

func (*TraceHandler) ShowSpan

func (h *TraceHandler) ShowSpan(w http.ResponseWriter, req bunrouter.Request) error

func (*TraceHandler) ShowTrace

func (h *TraceHandler) ShowTrace(w http.ResponseWriter, req bunrouter.Request) error

type TraceInfo

type TraceInfo struct {
	ID       idgen.TraceID `json:"id"`
	Time     time.Time     `json:"time"`
	Duration time.Duration `json:"duration"`
}

func NewTraceInfo

func NewTraceInfo(root *Span) *TraceInfo

type TraceServiceServer

type TraceServiceServer struct {
	collectortrace.UnimplementedTraceServiceServer

	*bunapp.App
	// contains filtered or unexported fields
}

func NewTraceServiceServer

func NewTraceServiceServer(app *bunapp.App, sp *SpanProcessor) *TraceServiceServer

func (*TraceServiceServer) ExportHTTP

type TypeFilter added in v1.7.0

type TypeFilter struct {
	org.TimeFilter
	ProjectID uint32

	System  []string
	GroupID uint64
}

func DecodeTypeFilter added in v1.7.0

func DecodeTypeFilter(app *bunapp.App, req bunrouter.Request) (*TypeFilter, error)

func (*TypeFilter) UnmarshalValues added in v1.7.0

func (f *TypeFilter) UnmarshalValues(ctx context.Context, values url.Values) error

type VectorHandler

type VectorHandler struct {
	*bunapp.App
	// contains filtered or unexported fields
}

func NewVectorHandler

func NewVectorHandler(app *bunapp.App, sp *SpanProcessor) *VectorHandler

func (*VectorHandler) Create

type ZipkinAnnotation

type ZipkinAnnotation struct {
	Timestamp int64  `json:"timestamp"`
	Value     string `json:"value"`
}

type ZipkinEndpoint

type ZipkinEndpoint struct {
	ServiceName string `json:"serviceName"`
	IPV4        string `json:"ipv4"`
	IPV6        string `json:"ipv6"`
	Port        int    `json:"port"`
}

type ZipkinHandler

type ZipkinHandler struct {
	*bunapp.App
	// contains filtered or unexported fields
}

func NewZipkinHandler

func NewZipkinHandler(app *bunapp.App, sp *SpanProcessor) *ZipkinHandler

func (*ZipkinHandler) PostSpans

func (h *ZipkinHandler) PostSpans(w http.ResponseWriter, req bunrouter.Request) error

type ZipkinSpan

type ZipkinSpan struct {
	ID             string             `json:"id"`
	ParentID       string             `json:"parentId"`
	TraceID        string             `json:"traceId"`
	Name           string             `json:"name"`
	Timestamp      Int64OrString      `json:"timestamp"`
	Duration       Int64OrString      `json:"duration"`
	Kind           string             `json:"kind"`
	LocalEndpoint  ZipkinEndpoint     `json:"localEndpoint"`
	RemoteEndpoint ZipkinEndpoint     `json:"remoteEndpoint"`
	Tags           AttrMap            `json:"tags"`
	Annotations    []ZipkinAnnotation `json:"annotations"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL