metrics

package
v0.4.66 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2024 License: MIT Imports: 11 Imported by: 1

Documentation

Index

Constants

View Source
const (
	AccountIdLabel     = "neosyncAccountId"
	JobIdLabel         = "neosyncJobId"
	TemporalWorkflowId = "temporalWorkflowId"
	TemporalRunId      = "temporalRunId"

	TableSchemaLabel    = "tableSchema"
	TableNameLabel      = "tableName"
	JobTypeLabel        = "jobType"
	IsUpdateConfigLabel = "isUpdateConfig"
)

Variables

This section is empty.

Functions

func GetDailyUsageFromProm added in v0.4.65

func GetDailyUsageFromProm(ctx context.Context, api promv1.API, query string, start, end time.Time, logger *slog.Logger) ([]*mgmtv1alpha1.DayResult, float64, error)

func GetPromQueryFromMetric added in v0.4.65

func GetPromQueryFromMetric(
	metric mgmtv1alpha1.RangedMetricName,
	labels MetricLabels,
	timeWindow string,
) (string, error)

func GetTotalUsageFromProm added in v0.4.65

func GetTotalUsageFromProm(ctx context.Context, api promv1.API, query string, dayEnd time.Time, logger *slog.Logger) (float64, error)

Types

type MetricLabel

type MetricLabel struct {
	Key   string
	Value string
	Sign  string
}

func NewEqLabel

func NewEqLabel(key, value string) MetricLabel

func NewNotEqLabel

func NewNotEqLabel(key, value string) MetricLabel

note: this has only been tested with prometheus and using it with benthos is not currently supported

func (*MetricLabel) ToBenthosMeta

func (m *MetricLabel) ToBenthosMeta() string

func (*MetricLabel) ToPromQueryString

func (m *MetricLabel) ToPromQueryString() string

type MetricLabels

type MetricLabels []MetricLabel

func (MetricLabels) ToBenthosMeta

func (m MetricLabels) ToBenthosMeta() string

func (MetricLabels) ToPromQueryString

func (m MetricLabels) ToPromQueryString() string

Jump to

Keyboard shortcuts

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