Documentation
¶
Overview ¶
Package monitoring provides monitoring and metrics collection functionality for O² Control components.
Index ¶
- func AddEnvAndRunType(ctx context.Context, envId, runType string) context.Context
- func Format(writer io.Writer, metrics []Metric) error
- func IsRunning() bool
- func Run(port uint16, endpointName string) error
- func Send(metric *Metric)
- func SendHistogrammable(metric *Metric)
- func SetupStreamClientInterceptor(metricName string, convert NameConvertType) grpc.StreamClientInterceptor
- func SetupUnaryClientInterceptor(name string, convert NameConvertType) grpc.UnaryClientInterceptor
- func Stop()
- func Timer(metric *Metric, unit TimeResolution) func()
- func TimerSendHist(metric *Metric, unit TimeResolution) func()
- func TimerSendSingle(metric *Metric, unit TimeResolution) func()
- type EnvIDKey
- type FieldsType
- type Metric
- func (metric *Metric) AddTag(tagName string, value string)
- func (metric *Metric) MergeFields(other *Metric)
- func (metric *Metric) SetFieldFloat64(fieldName string, field float64)
- func (metric *Metric) SetFieldInt64(fieldName string, field int64)
- func (metric *Metric) SetFieldUInt64(fieldName string, field uint64)
- type MetricsAggregate
- type MetricsReservoirSampling
- type NameConvertType
- type RunTypeKey
- type Tag
- type TagsType
- type TimeResolution
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddEnvAndRunType ¶ added in v1.43.0
func Run ¶ added in v1.27.0
\param port port where the scraping endpoint will be created \param endpointName name of the endpoint, which must start with a slash eg. "/internalmetrics"
If we attempt send more messages than the size of the buffer, these overflowing messages will be ignored and warning will be logged.
func SendHistogrammable ¶ added in v1.35.0
func SendHistogrammable(metric *Metric)
func SetupStreamClientInterceptor ¶ added in v1.41.0
func SetupStreamClientInterceptor(metricName string, convert NameConvertType) grpc.StreamClientInterceptor
func SetupUnaryClientInterceptor ¶ added in v1.41.0
func SetupUnaryClientInterceptor(name string, convert NameConvertType) grpc.UnaryClientInterceptor
func Timer ¶ added in v1.41.0
func Timer(metric *Metric, unit TimeResolution) func()
Timer function is meant to be used with defer statement to measure runtime of given function: defer Timer(&metric, Milliseconds)()
func TimerSendHist ¶ added in v1.41.0
func TimerSendHist(metric *Metric, unit TimeResolution) func()
Timer function is meant to be used with defer statement to measure runtime of given function: defer Timer(&metric, Milliseconds)() sends measured value as SendHistogrammable(metric)
func TimerSendSingle ¶ added in v1.41.0
func TimerSendSingle(metric *Metric, unit TimeResolution) func()
Timer function is meant to be used with defer statement to measure runtime of given function: defer Timer(&metric, Milliseconds)() sends measured value as Send(metric)
Types ¶
type FieldsType ¶ added in v1.35.0
type Metric ¶
type Metric struct {
// contains filtered or unexported fields
}
func NewDefaultMetric ¶ added in v1.35.0
Return empty metric, it is used right now mostly in string to report metrics correctly to influxdb use NewECSMetric
func NewMetric ¶ added in v1.35.0
creates empty metric with tag subsystem=ECS, which is used by Telegraf to send metrics from ECS to correct bucket
func (*Metric) MergeFields ¶ added in v1.35.0
func (*Metric) SetFieldFloat64 ¶ added in v1.35.0
func (*Metric) SetFieldInt64 ¶ added in v1.35.0
func (*Metric) SetFieldUInt64 ¶ added in v1.35.0
type MetricsAggregate ¶ added in v1.35.0
type MetricsAggregate struct {
// contains filtered or unexported fields
}
func NewMetricsAggregate ¶ added in v1.35.0
func NewMetricsAggregate() *MetricsAggregate
func (*MetricsAggregate) AddMetric ¶ added in v1.35.0
func (this *MetricsAggregate) AddMetric(metric *Metric)
func (*MetricsAggregate) Clear ¶ added in v1.35.0
func (this *MetricsAggregate) Clear()
func (*MetricsAggregate) GetMetrics ¶ added in v1.35.0
func (this *MetricsAggregate) GetMetrics() []Metric
type MetricsReservoirSampling ¶ added in v1.35.0
type MetricsReservoirSampling struct {
// contains filtered or unexported fields
}
func NewMetricsReservoirSampling ¶ added in v1.35.0
func NewMetricsReservoirSampling() *MetricsReservoirSampling
func (*MetricsReservoirSampling) AddMetric ¶ added in v1.35.0
func (this *MetricsReservoirSampling) AddMetric(metric *Metric)
func (*MetricsReservoirSampling) Clear ¶ added in v1.35.0
func (this *MetricsReservoirSampling) Clear()
func (*MetricsReservoirSampling) GetMetrics ¶ added in v1.35.0
func (this *MetricsReservoirSampling) GetMetrics() []Metric
type NameConvertType ¶ added in v1.41.0
type RunTypeKey ¶ added in v1.43.0
type RunTypeKey struct{}
type TimeResolution ¶ added in v1.41.0
type TimeResolution int
const ( Millisecond TimeResolution = iota Nanosecond )