observability

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2024 License: MIT Imports: 2 Imported by: 2 modules, 2 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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, options ErrorReporterOptions) bool
}

type ErrorReporterOptions added in v0.3.1

type ErrorReporterOptions struct {
	ErrorDiagnosticPath string
}

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