instrumentation

package module
v0.0.0-...-ce39f13 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2021 License: MIT Imports: 13 Imported by: 2

Documentation

Index

Constants

View Source
const (
	// ErrorEncounteredMetricName is the metric name
	ErrorEncounteredMetricName = "ErrorEncountered"
)

Variables

This section is empty.

Functions

func GetDimensionsString

func GetDimensionsString(dimensions []*Dimension) string

GetDimensionsString returns the dimensaion as string.

func TestMain

func TestMain(m *testing.M)

Types

type Dimension

type Dimension struct {
	// Key of the dimension.
	Key string
	// Value of the dimension.
	Value string
}

Dimension A dimension in the metric

type DimensionlessMetric

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

DimensionlessMetric implementation of Metric, for metric without dimensions

func NewDimensionlessMetric

func NewDimensionlessMetric(metricName string) *DimensionlessMetric

NewDimensionlessMetric Constructor for DimensionlessMetric

func (*DimensionlessMetric) MetricDimension

func (metric *DimensionlessMetric) MetricDimension() []*Dimension

func (*DimensionlessMetric) MetricName

func (metric *DimensionlessMetric) MetricName() string

type ErrorEncounteredMetric

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

ErrorEncounteredMetric implementation of Metric, for error encountered metric

func NewErrorEncounteredMetric

func NewErrorEncounteredMetric(errorType, context string) *ErrorEncounteredMetric

NewErrorEncounteredMetric Cto'r for ErrorEncounteredMetric

func (*ErrorEncounteredMetric) MetricDimension

func (metric *ErrorEncounteredMetric) MetricDimension() []*Dimension

func (*ErrorEncounteredMetric) MetricName

func (metric *ErrorEncounteredMetric) MetricName() string

type EventBasedMetric

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

EventBasedMetric implementation of Metric, for event based metric

func NewEventCollectedMetric

func NewEventCollectedMetric(eventType string) *EventBasedMetric

NewEventCollectedMetric Ctor for EventCollectedMetric

func NewEventEnrichedMetric

func NewEventEnrichedMetric(eventType string) *EventBasedMetric

NewEventEnrichedMetric Ctor for EventEnrichedMetric

func NewEventParsedMetric

func NewEventParsedMetric(eventType string) *EventBasedMetric

NewEventParsedMetric Ctor for EventParsedMetric

func NewEventReadMetric

func NewEventReadMetric(eventType string) *EventBasedMetric

NewEventReadMetric Ctor for EventReadMetric

func (*EventBasedMetric) MetricDimension

func (metric *EventBasedMetric) MetricDimension() []*Dimension

MetricDimension - metric dimensions

func (*EventBasedMetric) MetricName

func (metric *EventBasedMetric) MetricName() string

MetricName - metric name

type HeartbeatSender

type HeartbeatSender interface {
	// contains filtered or unexported methods
}

HeartbeatSender interface for Heartbeat sender

type HeartbeatSenderImpl

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

HeartbeatSenderImpl holds the needed data for sending heartbeat

type InstrumentationConfiguration

type InstrumentationConfiguration struct {
	ComponentName       string
	AzureResourceID     string
	Region              string
	ClusterDistribution string
	ChartVersion        string
	ImageName           string
	ImageVersion        string
	ReleaseTrain        string
	NodeName            string
	// DirPath is the path to the directory that the files will be saved.
	DirPath              string
	MdmAccount           string
	MdmNamespace         string
	PlatformMdmAccount   string
	PlatformMdmNamespace string
}

InstrumentationConfiguration for the instrumentation platform

func (*InstrumentationConfiguration) GetDefaultDimensions

func (configuration *InstrumentationConfiguration) GetDefaultDimensions() []*Dimension

GetDefaultDimensions - Get the default dimensions to be attached to each metric reports

type InstrumentationInitializationResult

type InstrumentationInitializationResult struct {
	MetricSubmitter MetricSubmitter
	Tracer          *log.Entry
}

InstrumentationInitializationResult - aggregate type for all initialization result objects

type InstrumentationInitializer

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

InstrumentationInitializer helper object to initialize the instrumentation platform

func NewInstrumentationInitializer

func NewInstrumentationInitializer(configuration *InstrumentationConfiguration) *InstrumentationInitializer

NewInstrumentationInitializer - Ctor for creating the instrumentation initializer

func (*InstrumentationInitializer) Initialize

Initialize - initialize the instrumentation framework

type Metric

type Metric interface {
	// MetricName - getter for the metric name
	MetricName() string
	// MetricDimension - getter for the metric dimensions
	MetricDimension() []*Dimension
}

Metric interface for getting the metric name and metric dimensions

type MetricSubmitter

type MetricSubmitter interface {
	// SendMetric - send metric by name with provided dimensions
	SendMetric(value int, metric Metric)

	// SendMetricToNamespace - sends metric by name with provided dimensions to specific namespace.
	SendMetricToNamespace(value int, metric Metric, accountName, namespaceName string)
}

MetricSubmitter - interface for sending metrics

type MetricSubmitterFactory

type MetricSubmitterFactory interface {
	// contains filtered or unexported methods
}

MetricSubmitterFactory is factory for metric submitter

func NewMetricSubmitterFactory

func NewMetricSubmitterFactory(tracer *logrus.Entry, configuration *InstrumentationConfiguration) (MetricSubmitterFactory, error)

NewMetricSubmitterFactory tracer factory

type MetricSubmitterFactoryImpl

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

MetricSubmitterFactoryImpl a factory for creating a metric submitter

type MetricSubmitterImpl

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

MetricSubmitterImpl a metric submitter object - can be used to send metrics easily

func (*MetricSubmitterImpl) SendMetric

func (metricSubmitter *MetricSubmitterImpl) SendMetric(value int, metric Metric)

SendMetric send metric

func (*MetricSubmitterImpl) SendMetricToNamespace

func (metricSubmitter *MetricSubmitterImpl) SendMetricToNamespace(value int, metric Metric, accountName, namespaceName string)

type MetricWriter

type MetricWriter interface {
	// Write - send metric by name with provided dimensions
	Write(metric *rawMetric)
}

MetricWriter - interface for sending metrics

type MetricWriterImpl

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

MetricWriterImpl a metric sender object - can be used to send metrics easily

func (*MetricWriterImpl) Write

func (metricWriter *MetricWriterImpl) Write(metric *rawMetric)

Write - writes the new metric or updating the value of the existing cached one

type PlatformMetricSubmitter

type PlatformMetricSubmitter interface {
	// SendMetricToPlatform - send metric by name with provided dimensions, to the platform account and namespace
	SendMetricToPlatform(value int, metric Metric)
}

PlatformMetricSubmitter - interface for sending platform metrics

func NewPlatformMetricSubmitter

func NewPlatformMetricSubmitter(metricSubmitter MetricSubmitter, mdmAccount string, namespace string) PlatformMetricSubmitter

NewPlatformMetricSubmitter creates a new metric submitter that reports metrics to the platform namespace and account

type PlatformMetricSubmitterImpl

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

PlatformMetricSubmitterImpl a metric submitter object - can be used to send metrics easily (to platform account)

func (*PlatformMetricSubmitterImpl) SendMetricToPlatform

func (platformMetricSubmitter *PlatformMetricSubmitterImpl) SendMetricToPlatform(value int, metric Metric)

SendMetricToPlatform send metric (for platform submitter)

type TraceType

type TraceType string
const (
	HEARTBEAT_TRACE_TYPE TraceType = "Heartbeat"
	MESSAGE_TRACE_TYPE   TraceType = "Trace"
)

type TracerFactory

type TracerFactory interface {
	// CreateTracer - Method for creating a tracer entry that can be used to send traces
	CreateTracer(tracerType TraceType) *log.Entry
	// DeleteTracerFile - delete the tracer's log file
	DeleteTracerFile() error
}

TracerFactory - Interface for creating tracer entry objects

func NewTracerFactory

func NewTracerFactory(instrumentationConfiguration *InstrumentationConfiguration) TracerFactory

NewTracerFactory tracer factory

type TracerFactoryImpl

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

TracerFactoryImpl a factory for creating a tracer entry

func (*TracerFactoryImpl) CreateTracer

func (tracerFactory *TracerFactoryImpl) CreateTracer(tracerType TraceType) *log.Entry

CreateTracer - Method for creating a tracer entry that can be used to send traces

func (*TracerFactoryImpl) DeleteTracerFile

func (tracerFactory *TracerFactoryImpl) DeleteTracerFile() error

DeleteTracerFile - delete the tracer's log file

func (*TracerFactoryImpl) SetRollingFileConfiguration

func (tracerFactory *TracerFactoryImpl) SetRollingFileConfiguration(rollingFileConfiguration *common.RollingFileConfiguration)

SetRollingFileConfiguration - set rolling file configuration

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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