observability

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2024 License: MIT Imports: 2 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Analytics

type Analytics interface {
	TrackScan(bool, ScanMetrics)
}

Analytics exposes different metric tracking functions.

type ErrorReporter added in v0.3.0

type ErrorReporter interface {
	FlushErrorReporting()
	CaptureError(err error) bool
	CaptureErrorAndReportAsIssue(path string, err error) bool
}

type Instrumentor

type Instrumentor interface {
	StartSpan(ctx context.Context, operation string) Span
	NewTransaction(
		ctx context.Context,
		txName string,
		operation string,
	) Span
	Finish(span Span)
}

Instrumentor exposes functions used for adding instrumentation context to functions.

type ScanMetrics

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

ScanMetrics contains various metrics about the Snyk Code scan.

func NewScanMetrics

func NewScanMetrics(lastScanStartTime time.Time, lastScanFileCount int) ScanMetrics

NewScanMetrics is used to create a ScanMetrics object.

func (ScanMetrics) GetDuration

func (s ScanMetrics) GetDuration() time.Duration

GetDuration computes the duration since the last time a scan starter.

func (ScanMetrics) GetLastScanFileCount

func (s ScanMetrics) GetLastScanFileCount() int

GetLastScanFileCount returns the count of files since the last scan.

func (*ScanMetrics) SetLastScanFileCount

func (s *ScanMetrics) SetLastScanFileCount(lastScanFileCount int)

SetLastScanFileCount sets the count of files since the last scan.

type Span

type Span interface {
	SetTransactionName(name string)
	StartSpan(ctx context.Context)
	Finish()
	GetOperation() string
	GetTxName() string

	// GetTraceId Returns UUID of the trace
	GetTraceId() string
	Context() context.Context

	GetDurationMs() int64
}

Span exposes functions that have context about functions.

Directories

Path Synopsis
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

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