kusto

package
v0.0.0-...-4fed4f1 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2026 License: MIT Imports: 10 Imported by: 3

Documentation

Index

Constants

View Source
const (
	MetricFieldTypeExpand  = "expand"
	MetricFieldTypeIgnore  = "ignore"
	MetricFieldTypeId      = "id"
	MetricFieldTypeValue   = "value"
	MetricFieldTypeDefault = "string"
	MetricFieldTypeBool    = "bool"
	MetricFieldTypeBoolean = "boolean"

	MetricFieldFilterToLower    = "tolower"
	MetricFieldFilterToUpper    = "toupper"
	MetricFieldFilterToTitle    = "totitle"
	MetricFieldFilterToRegexp   = "regexp"
	MetricFieldFilterToUnixtime = "tounixtime"
)

Variables

This section is empty.

Functions

func BuildPrometheusMetricList

func BuildPrometheusMetricList(name string, metricConfig QueryMetric, row map[string]interface{}) (list map[string][]MetricRow)

Types

type Config

type Config struct {
	Queries []Query `json:"queries"`
}

func NewConfig

func NewConfig(path string) (config Config)

func (*Config) Validate

func (c *Config) Validate() error

type MetricField

type MetricField struct {
	Name    string              `json:"name"`
	Metric  string              `json:"metric"`
	Source  string              `json:"source"`
	Target  string              `json:"target"`
	Type    string              `json:"type"`
	Labels  map[string]string   `json:"labels"`
	Filters []MetricFieldFilter `json:"filters"`
	Expand  *QueryMetric        `json:"expand"`
}

func (*MetricField) GetSourceField

func (f *MetricField) GetSourceField() (ret string)

func (*MetricField) GetTargetFieldName

func (f *MetricField) GetTargetFieldName(sourceName string) (ret string)

func (*MetricField) GetType

func (c *MetricField) GetType() (ret string)

func (*MetricField) IsExpand

func (f *MetricField) IsExpand() bool

func (*MetricField) IsSourceField

func (f *MetricField) IsSourceField() bool

func (*MetricField) IsTypeId

func (f *MetricField) IsTypeId() bool

func (*MetricField) IsTypeIgnore

func (f *MetricField) IsTypeIgnore() bool

func (*MetricField) IsTypeValue

func (f *MetricField) IsTypeValue() bool

func (*MetricField) TransformBool

func (f *MetricField) TransformBool(value bool) (ret string)

func (*MetricField) TransformFloat64

func (f *MetricField) TransformFloat64(value float64) (ret string)

func (*MetricField) TransformString

func (f *MetricField) TransformString(value string) (ret string)

func (*MetricField) Validate

func (c *MetricField) Validate() error

type MetricFieldFilter

type MetricFieldFilter struct {
	Type        string `json:"type"`
	RegExp      string `json:"regexp"`
	Replacement string `json:"replacement"`
	// contains filtered or unexported fields
}

func (*MetricFieldFilter) UnmarshalJSON

func (f *MetricFieldFilter) UnmarshalJSON(c []byte) error

func (*MetricFieldFilter) Validate

func (c *MetricFieldFilter) Validate() error

type MetricFieldFilterParser

type MetricFieldFilterParser struct {
	Type        string `json:"type"`
	RegExp      string `json:"regexp"`
	Replacement string `json:"replacement"`
}

type MetricList

type MetricList struct {
	List map[string][]MetricRow
}

func (*MetricList) Add

func (l *MetricList) Add(name string, metric ...MetricRow)

func (*MetricList) GetMetricLabelNames

func (l *MetricList) GetMetricLabelNames(name string) []string

func (*MetricList) GetMetricList

func (l *MetricList) GetMetricList(name string) []MetricRow

func (*MetricList) GetMetricNames

func (l *MetricList) GetMetricNames() []string

func (*MetricList) Init

func (l *MetricList) Init()

type MetricRow

type MetricRow struct {
	Labels prometheus.Labels
	Value  *float64
}

func NewMetricRow

func NewMetricRow() *MetricRow

type Query

type Query struct {
	*QueryMetric
	QueryMode     string    `json:"queryMode"`
	Workspaces    *[]string `json:"workspaces"`
	Metric        string    `json:"metric"`
	Module        string    `json:"module"`
	Query         string    `json:"query"`
	Timespan      *string   `json:"timespan"`
	Subscriptions *[]string `json:"subscriptions"`
}

func (*Query) Validate

func (c *Query) Validate() error

type QueryMetric

type QueryMetric struct {
	Value        *float64          `json:"value"`
	Fields       []MetricField     `json:"fields"`
	Labels       map[string]string `json:"labels"`
	DefaultField MetricField       `json:"defaultField"`
	Publish      *bool             `json:"publish"`
}

func (*QueryMetric) GetFieldConfigMap

func (m *QueryMetric) GetFieldConfigMap() (list map[string][]MetricField)

func (*QueryMetric) IsExpand

func (m *QueryMetric) IsExpand(field string) bool

func (*QueryMetric) IsPublished

func (c *QueryMetric) IsPublished() bool

func (*QueryMetric) Validate

func (c *QueryMetric) Validate() error

Jump to

Keyboard shortcuts

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