desktopexporter

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2023 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MAX_QUEUE_LENGTH = 10000
)

Variables

View Source
var ErrEmptySpansSlice = errors.New("slice of spans associated with this traceID must not be empty")
View Source
var ErrTraceIDMismatch = errors.New("traceID mismatch between TraceStore.traceMap and TraceStore.traceQueue")
View Source
var ErrTraceIDNotFound = errors.New("traceID not found")
View Source
var WarningInvalidServiceName = errors.New("warning: Resource.Attributes['service.name'] must be a string value that helps to distinguish a group of services")
View Source
var WarningMissingRootSpan = errors.New("warning: trace is incomplete - no root span found")

Functions

func NewFactory

func NewFactory() exporter.Factory

Types

type Config

type Config struct {
	// Endpoint defines where we serve our frontend app
	Endpoint string `mapstructure:"endpoint"`
}

Config defines configuration for logging exporter.

func (*Config) Validate

func (cfg *Config) Validate() error

Validate checks if the exporter configuration is valid

type EventData

type EventData struct {
	Name                   string                 `json:"name"`
	Timestamp              time.Time              `json:"timestamp"`
	Attributes             map[string]interface{} `json:"attributes"`
	DroppedAttributesCount uint32                 `json:"droppedAttributesCount"`
}

type LinkData

type LinkData struct {
	TraceID                string                 `json:"traceID"`
	SpanID                 string                 `json:"spanID"`
	TraceState             string                 `json:"traceState"`
	Attributes             map[string]interface{} `json:"attributes"`
	DroppedAttributesCount uint32                 `json:"droppedAttributesCount"`
}

type RecentSummaries

type RecentSummaries struct {
	TraceSummaries []TraceSummary `json:"traceSummaries"`
}

type ResourceData

type ResourceData struct {
	Attributes             map[string]interface{} `json:"attributes"`
	DroppedAttributesCount uint32                 `json:"droppedAttributesCount"`
}

type ScopeData

type ScopeData struct {
	Name                   string                 `json:"name"`
	Version                string                 `json:"version"`
	Attributes             map[string]interface{} `json:"attributes"`
	DroppedAttributesCount uint32                 `json:"droppedAttributesCount"`
}

type Server

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

func NewServer

func NewServer(traceStore *TraceStore, endpoint string) *Server

func (Server) Close

func (s Server) Close() error

func (Server) Start

func (s Server) Start() error

type SpanData

type SpanData struct {
	TraceID      string `json:"traceID"`
	TraceState   string `json:"traceState"`
	SpanID       string `json:"spanID"`
	ParentSpanID string `json:"parentSpanID"`

	Name      string    `json:"name"`
	Kind      string    `json:"kind"`
	StartTime time.Time `json:"startTime"`
	EndTime   time.Time `json:"endTime"`

	Attributes map[string]interface{} `json:"attributes"`
	Events     []EventData            `json:"events"`
	Links      []LinkData             `json:"links"`
	Resource   *ResourceData          `json:"resource"`
	Scope      *ScopeData             `json:"scope"`

	DroppedAttributesCount uint32 `json:"droppedAttributesCount"`
	DroppedEventsCount     uint32 `json:"droppedEventsCount"`
	DroppedLinksCount      uint32 `json:"droppedLinksCount"`

	StatusCode    string `json:"statusCode"`
	StatusMessage string `json:"statusMessage"`
}

func GenerateSampleData

func GenerateSampleData(ctx context.Context) []SpanData

func (*SpanData) GetServiceName

func (spanData *SpanData) GetServiceName() string

Get the service name of a span with respect to OTEL semanic conventions: service.name must be a string value having a meaning that helps to distinguish a group of services. Read more here: (https://opentelemetry.io/docs/reference/specification/resource/semantic_conventions/#service)

type TraceData

type TraceData struct {
	TraceID string     `json:"traceID"`
	Spans   []SpanData `json:"spans"`
}

func (*TraceData) GetTraceSummary

func (trace *TraceData) GetTraceSummary() TraceSummary

type TraceStore

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

func NewTraceStore

func NewTraceStore(maxQueueSize int) *TraceStore

func (*TraceStore) Add

func (store *TraceStore) Add(_ context.Context, spanData SpanData)

func (*TraceStore) GetRecentTraces

func (store *TraceStore) GetRecentTraces(traceCount int) []TraceData

func (*TraceStore) GetTrace

func (store *TraceStore) GetTrace(traceID string) (TraceData, error)

type TraceSummary

type TraceSummary struct {
	HasRootSpan bool `json:"hasRootSpan"`

	RootServiceName string    `json:"rootServiceName"`
	RootName        string    `json:"rootName"`
	RootStartTime   time.Time `json:"rootStartTime"`
	RootEndTime     time.Time `json:"rootEndTime"`

	SpanCount uint32 `json:"spanCount"`
	TraceID   string `json:"traceID"`
}

Jump to

Keyboard shortcuts

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