Documentation ¶
Index ¶
- Variables
- func ScopeES2(ts opentsdb.TagSet, q elastic.Query) elastic.Query
- func ScopeES5(ts opentsdb.TagSet, q elastic.Query) elastic.Query
- func ScopeES6(ts opentsdb.TagSet, q elastic.Query) elastic.Query
- func ScopeES7(ts opentsdb.TagSet, q elastic.Query) elastic.Query
- type AlertStatusProvider
- type AzureApplicationInsightsApp
- type AzureApplicationInsightsApps
- type AzureMonitorClientCollection
- type AzureMonitorClients
- type AzureResource
- type AzureResources
- type Backends
- type BosunProviders
- type ESIndexer
- type ESQuery
- type ESVersion
- type ElasticConfig
- type ElasticHosts
- func (e ElasticHosts) InitClient(prefix string) error
- func (e ElasticHosts) InitClient2(prefix string) error
- func (e ElasticHosts) InitClient5(prefix string) error
- func (e ElasticHosts) InitClient6(prefix string) error
- func (e ElasticHosts) InitClient7(prefix string) error
- func (e ElasticHosts) Query2(r *ElasticRequest2) (*elastic.SearchResult, error)
- func (e ElasticHosts) Query5(r *ElasticRequest5) (*elastic.SearchResult, error)
- func (e ElasticHosts) Query6(r *ElasticRequest6) (*elastic.SearchResult, error)
- func (e ElasticHosts) Query7(r *ElasticRequest7) (*elastic.SearchResult, error)
- type ElasticRequest2
- type ElasticRequest5
- type ElasticRequest6
- type ElasticRequest7
- type Expr
- type Info
- type Number
- type NumberExpr
- type PromClients
- type Result
- type ResultSlice
- type ResultSliceByGroup
- type ResultSliceByValue
- type Results
- func Abs(e *State, set *Results) *Results
- func AddTags(e *State, set *Results, s string) (*Results, error)
- func Aggr(e *State, series *Results, groups string, aggregator string) (*Results, error)
- func AnCounts(e *State, filter, startDuration, endDuration string) (r *Results, err error)
- func AnDurations(e *State, filter, startDuration, endDuration string) (r *Results, err error)
- func AnTable(e *State, filter, fieldsCSV, startDuration, endDuration string) (r *Results, err error)
- func Avg(e *State, series *Results) (*Results, error)
- func AzureAIFilterApps(prefix string, e *State, apps AzureApplicationInsightsApps, filter string) (r *Results, err error)
- func AzureAIListApps(prefix string, e *State) (r *Results, err error)
- func AzureAIMetricMD(prefix string, e *State, apps AzureApplicationInsightsApps) (r *Results, err error)
- func AzureAIQuery(prefix string, e *State, metric, segmentCSV, filter string, ...) (r *Results, err error)
- func AzureFilterResources(e *State, resources AzureResources, filter string) (r *Results, err error)
- func AzureMetricDefinitions(prefix string, e *State, namespace, metric, rsg, resource string) (r *Results, err error)
- func AzureMultiQuery(prefix string, e *State, metric, tagKeysCSV string, resources AzureResources, ...) (r *Results, err error)
- func AzureQuery(prefix string, e *State, ...) (r *Results, err error)
- func AzureResourcesByType(prefix string, e *State, tp string) (r *Results, err error)
- func Band(e *State, query, duration, period string, num float64) (r *Results, err error)
- func BandQuery(e *State, query, duration, period, eduration string, num float64) (r *Results, err error)
- func CCount(e *State, series *Results) (*Results, error)
- func Change(e *State, query, sduration, eduration string) (r *Results, err error)
- func CloudWatchQuery(prefix string, e *State, ...) (*Results, error)
- func Count(e *State, query, sduration, eduration string) (r *Results, err error)
- func Crop(e *State, sSet *Results, startSet *Results, endSet *Results) (*Results, error)
- func Des(e *State, series *Results, alpha float64, beta float64) *Results
- func Dev(e *State, series *Results) (*Results, error)
- func Diff(e *State, series *Results) (r *Results, err error)
- func DropBool(e *State, target *Results, filter *Results) (*Results, error)
- func DropG(e *State, series *Results, threshold *Results) (*Results, error)
- func DropGe(e *State, series *Results, threshold *Results) (*Results, error)
- func DropL(e *State, series *Results, threshold *Results) (*Results, error)
- func DropLe(e *State, series *Results, threshold *Results) (*Results, error)
- func DropNA(e *State, series *Results) (*Results, error)
- func DropValues(e *State, series *Results, threshold *Results, ...) (*Results, error)
- func Duration(e *State, d string) (*Results, error)
- func ESAll(e *State) (*Results, error)
- func ESAnd(e *State, esqueries ...ESQuery) (*Results, error)
- func ESCount(prefix string, e *State, indexer ESIndexer, keystring string, filter ESQuery, ...) (r *Results, err error)
- func ESDaily(e *State, timeField, indexRoot, layout string) (*Results, error)
- func ESDateHistogram2(prefix string, e *State, indexer ESIndexer, keystring string, ...) (r *Results, err error)
- func ESDateHistogram5(prefix string, e *State, indexer ESIndexer, keystring string, ...) (r *Results, err error)
- func ESDateHistogram6(prefix string, e *State, indexer ESIndexer, keystring string, ...) (r *Results, err error)
- func ESDateHistogram7(prefix string, e *State, indexer ESIndexer, keystring string, ...) (r *Results, err error)
- func ESExists(e *State, field string) (*Results, error)
- func ESGT(e *State, key string, gt float64) (*Results, error)
- func ESGTE(e *State, key string, gte float64) (*Results, error)
- func ESIndicies(e *State, timeField string, literalIndices ...string) *Results
- func ESLS(e *State, indexRoot string) (*Results, error)
- func ESLT(e *State, key string, lt float64) (*Results, error)
- func ESLTE(e *State, key string, lte float64) (*Results, error)
- func ESMonthly(e *State, timeField, indexRoot, layout string) (*Results, error)
- func ESNot(e *State, query ESQuery) (*Results, error)
- func ESOr(e *State, esqueries ...ESQuery) (*Results, error)
- func ESQueryString(e *State, key string, query string) (*Results, error)
- func ESRegexp(e *State, key string, regex string) (*Results, error)
- func ESStat(prefix string, e *State, indexer ESIndexer, keystring string, filter ESQuery, ...) (r *Results, err error)
- func Epoch(e *State) (*Results, error)
- func Filter(e *State, set *Results, numberSet *Results) (*Results, error)
- func First(e *State, series *Results) (*Results, error)
- func Forecast_lr(e *State, series *Results, y *Results) (r *Results, err error)
- func GraphiteBand(e *State, query, duration, period, format string, num float64) (r *Results, err error)
- func GraphiteQuery(e *State, query string, sduration, eduration, format string) (r *Results, err error)
- func InfluxQuery(e *State, db, query, startDuration, endDuration, groupByInterval string) (*Results, error)
- func IsNaN(e *State, nSet *Results) (*Results, error)
- func Last(e *State, series *Results) (*Results, error)
- func LeftJoin(e *State, keysCSV, columnsCSV string, rowData ...*Results) (*Results, error)
- func Length(e *State, series *Results) (*Results, error)
- func Limit(e *State, set *Results, v float64) (*Results, error)
- func Line_lr(e *State, series *Results, d string) (*Results, error)
- func Map(e *State, series *Results, expr *Results) (*Results, error)
- func Max(e *State, series *Results) (r *Results, err error)
- func Median(e *State, series *Results) (r *Results, err error)
- func Merge(e *State, series ...*Results) (*Results, error)
- func Min(e *State, series *Results) (r *Results, err error)
- func Month(e *State, offset float64, startEnd string) (*Results, error)
- func NV(e *State, series *Results, v float64) (results *Results, err error)
- func Over(e *State, query, duration, period string, num float64) (r *Results, err error)
- func OverQuery(e *State, query, duration, period, eduration string, num float64) (r *Results, err error)
- func Percentile(e *State, series *Results, p *Results) (r *Results, err error)
- func PromMQuery(prefix string, e *State, ...) (r *Results, err error)
- func PromMRate(prefix string, e *State, ...) (r *Results, err error)
- func PromMRawAggSeriesQuery(prefix string, e *State, query, stepDuration, sdur, edur string) (*Results, error)
- func PromMetricList(prefix string, e *State) (r *Results, err error)
- func PromQuery(prefix string, e *State, ...) (r *Results, err error)
- func PromRate(prefix string, e *State, ...) (r *Results, err error)
- func PromRawAggSeriesQuery(prefix string, e *State, query, stepDuration, sdur, edur string) (*Results, error)
- func PromTagInfo(prefix string, e *State, metric, sdur, edur string) (r *Results, err error)
- func Query(e *State, query, sduration, eduration string) (r *Results, err error)
- func Remove(e *State, set *Results, tagKey string) (*Results, error)
- func Rename(e *State, set *Results, s string) (*Results, error)
- func SeriesFunc(e *State, tags string, pairs ...float64) (*Results, error)
- func Shift(e *State, series *Results, d string) (*Results, error)
- func ShiftBand(e *State, query, duration, period string, num float64) (r *Results, err error)
- func Since(e *State, series *Results) (*Results, error)
- func Sort(e *State, series *Results, order string) (*Results, error)
- func Streak(e *State, series *Results) (*Results, error)
- func Sum(e *State, series *Results) (*Results, error)
- func Tail(e *State, series *Results, number *Results) (*Results, error)
- func TimeDelta(e *State, series *Results) (*Results, error)
- func ToDuration(e *State, sec float64) (*Results, error)
- func Transpose(e *State, d *Results, gp string) (*Results, error)
- func Ungroup(e *State, d *Results) (*Results, error)
- func V(e *State) (*Results, error)
- func Window(e *State, query, duration, period string, num float64, rfunc string) (*Results, error)
- type Scalar
- type Series
- type SortablePoint
- type SortableSeries
- type State
- type String
- type Table
- type Union
- type Value
Constants ¶
This section is empty.
Variables ¶
var Annotate = map[string]parse.Func{ "ancounts": { Args: []models.FuncType{models.TypeString, models.TypeString, models.TypeString}, Return: models.TypeSeriesSet, Tags: tagFirst, F: AnCounts, }, "andurations": { Args: []models.FuncType{models.TypeString, models.TypeString, models.TypeString}, Return: models.TypeSeriesSet, Tags: tagFirst, F: AnDurations, }, "antable": { Args: []models.FuncType{models.TypeString, models.TypeString, models.TypeString, models.TypeString}, Return: models.TypeTable, F: AnTable, }, }
var AzureMonitor = map[string]parse.Func{ "az": { Args: []models.FuncType{models.TypeString, models.TypeString, models.TypeString, models.TypeString, models.TypeString, models.TypeString, models.TypeString, models.TypeString, models.TypeString}, Return: models.TypeSeriesSet, Tags: azTags, F: AzureQuery, PrefixEnabled: true, }, "azmulti": { Args: []models.FuncType{models.TypeString, models.TypeString, models.TypeAzureResourceList, models.TypeString, models.TypeString, models.TypeString, models.TypeString}, Return: models.TypeSeriesSet, Tags: azMultiTags, F: AzureMultiQuery, PrefixEnabled: true, }, "azmd": { Args: []models.FuncType{models.TypeString, models.TypeString, models.TypeString, models.TypeString}, Return: models.TypeSeriesSet, Tags: tagFirst, F: AzureMetricDefinitions, PrefixEnabled: true, }, "azrt": { Args: []models.FuncType{models.TypeString}, Return: models.TypeAzureResourceList, F: AzureResourcesByType, PrefixEnabled: true, }, "azrf": { Args: []models.FuncType{models.TypeAzureResourceList, models.TypeString}, Return: models.TypeAzureResourceList, F: AzureFilterResources, }, "aiapp": { Args: []models.FuncType{}, Return: models.TypeAzureAIApps, F: AzureAIListApps, PrefixEnabled: true, }, "aiappf": { Args: []models.FuncType{models.TypeAzureAIApps, models.TypeString}, Return: models.TypeAzureAIApps, F: AzureAIFilterApps, PrefixEnabled: true, }, "aimd": { Args: []models.FuncType{models.TypeAzureAIApps}, Return: models.TypeInfo, F: AzureAIMetricMD, PrefixEnabled: true, }, "ai": { Args: []models.FuncType{models.TypeString, models.TypeString, models.TypeString, models.TypeAzureAIApps, models.TypeString, models.TypeString, models.TypeString, models.TypeString}, Return: models.TypeSeriesSet, Tags: azAITags, F: AzureAIQuery, PrefixEnabled: true, }, }
AzureMonitor is the collection of functions for the Azure monitor datasource
var CloudWatch = map[string]parse.Func{ "cw": { Args: []models.FuncType{models.TypeString, models.TypeString, models.TypeString, models.TypeString, models.TypeString, models.TypeString, models.TypeString, models.TypeString}, Return: models.TypeSeriesSet, Tags: cloudwatchTagQuery, F: CloudWatchQuery, PrefixEnabled: true, }, }
cloudwatch defines functions for use with amazon cloudwatch api
var DimensionParseError = errors.New("dimensions must be in format key:value")
var Elastic = map[string]parse.Func{ "escount": { Args: []models.FuncType{models.TypeESIndexer, models.TypeString, models.TypeESQuery, models.TypeString, models.TypeString, models.TypeString}, Return: models.TypeSeriesSet, Tags: elasticTagQuery, F: ESCount, PrefixEnabled: true, }, "esstat": { Args: []models.FuncType{models.TypeESIndexer, models.TypeString, models.TypeESQuery, models.TypeString, models.TypeString, models.TypeString, models.TypeString, models.TypeString}, Return: models.TypeSeriesSet, Tags: elasticTagQuery, F: ESStat, PrefixEnabled: true, }, "esindices": { Args: []models.FuncType{models.TypeString, models.TypeString}, VArgs: true, VArgsPos: 1, Return: models.TypeESIndexer, F: ESIndicies, }, "esdaily": { Args: []models.FuncType{models.TypeString, models.TypeString, models.TypeString}, Return: models.TypeESIndexer, F: ESDaily, }, "esmonthly": { Args: []models.FuncType{models.TypeString, models.TypeString, models.TypeString}, Return: models.TypeESIndexer, F: ESMonthly, }, "esls": { Args: []models.FuncType{models.TypeString}, Return: models.TypeESIndexer, F: ESLS, }, "esall": { Args: []models.FuncType{}, Return: models.TypeESQuery, F: ESAll, }, "esregexp": { Args: []models.FuncType{models.TypeString, models.TypeString}, Return: models.TypeESQuery, F: ESRegexp, }, "esquery": { Args: []models.FuncType{models.TypeString, models.TypeString}, Return: models.TypeESQuery, F: ESQueryString, }, "esexists": { Args: []models.FuncType{models.TypeString}, Return: models.TypeESQuery, F: ESExists, }, "esand": { Args: []models.FuncType{models.TypeESQuery}, VArgs: true, Return: models.TypeESQuery, F: ESAnd, }, "esor": { Args: []models.FuncType{models.TypeESQuery}, VArgs: true, Return: models.TypeESQuery, F: ESOr, }, "esnot": { Args: []models.FuncType{models.TypeESQuery}, Return: models.TypeESQuery, F: ESNot, }, "esgt": { Args: []models.FuncType{models.TypeString, models.TypeScalar}, Return: models.TypeESQuery, F: ESGT, }, "esgte": { Args: []models.FuncType{models.TypeString, models.TypeScalar}, Return: models.TypeESQuery, F: ESGTE, }, "eslt": { Args: []models.FuncType{models.TypeString, models.TypeScalar}, Return: models.TypeESQuery, F: ESLT, }, "eslte": { Args: []models.FuncType{models.TypeString, models.TypeScalar}, Return: models.TypeESQuery, F: ESLTE, }, }
ElasticFuncs are specific functions that query an elasticsearch instance. They are only loaded when the elastic hosts are set in the config file
var EndParseError = errors.New("Could not parse the end value")
var ErrUnknownOp = fmt.Errorf("expr: unknown op type")
var Graphite = map[string]parse.Func{ "graphiteBand": { Args: []models.FuncType{models.TypeString, models.TypeString, models.TypeString, models.TypeString, models.TypeScalar}, Return: models.TypeSeriesSet, Tags: graphiteTagQuery, F: GraphiteBand, }, "graphite": { Args: []models.FuncType{models.TypeString, models.TypeString, models.TypeString, models.TypeString}, Return: models.TypeSeriesSet, Tags: graphiteTagQuery, F: GraphiteQuery, }, }
Graphite defines functions for use with a Graphite backend.
var Influx = map[string]parse.Func{ "influx": { Args: []models.FuncType{models.TypeString, models.TypeString, models.TypeString, models.TypeString, models.TypeString}, Return: models.TypeSeriesSet, Tags: influxTag, F: InfluxQuery, }, }
Influx is a map of functions to query InfluxDB.
var PeriodParseError = errors.New("Could not parse the period value")
var Prom = map[string]parse.Func{ "prom": { Args: []models.FuncType{ models.TypeString, models.TypeString, models.TypeString, models.TypeString, models.TypeString, models.TypeString, models.TypeString, }, Return: models.TypeSeriesSet, Tags: promGroupTags, F: PromQuery, PrefixEnabled: true, }, "promm": { Args: []models.FuncType{ models.TypeString, models.TypeString, models.TypeString, models.TypeString, models.TypeString, models.TypeString, models.TypeString, }, Return: models.TypeSeriesSet, Tags: promMGroupTags, F: PromMQuery, PrefixEnabled: true, }, "promrate": { Args: []models.FuncType{ models.TypeString, models.TypeString, models.TypeString, models.TypeString, models.TypeString, models.TypeString, models.TypeString, models.TypeString, }, Return: models.TypeSeriesSet, Tags: promGroupTags, F: PromRate, PrefixEnabled: true, }, "promratem": { Args: []models.FuncType{ models.TypeString, models.TypeString, models.TypeString, models.TypeString, models.TypeString, models.TypeString, models.TypeString, models.TypeString, }, Return: models.TypeSeriesSet, Tags: promMGroupTags, F: PromMRate, PrefixEnabled: true, }, "promras": { Args: []models.FuncType{ models.TypeString, models.TypeString, models.TypeString, models.TypeString, }, Return: models.TypeSeriesSet, Tags: promAggRawTags, F: PromRawAggSeriesQuery, PrefixEnabled: true, }, "prommras": { Args: []models.FuncType{ models.TypeString, models.TypeString, models.TypeString, models.TypeString, }, Return: models.TypeSeriesSet, Tags: promMAggRawTags, F: PromMRawAggSeriesQuery, PrefixEnabled: true, }, "prommetrics": { Args: []models.FuncType{}, Return: models.TypeInfo, F: PromMetricList, PrefixEnabled: true, }, "promtags": { Args: []models.FuncType{ models.TypeString, models.TypeString, models.TypeString, }, Return: models.TypeInfo, F: PromTagInfo, PrefixEnabled: true, }, }
Prom is a map of functions to query Prometheus.
var StartParseError = errors.New("Could not parse the start value")
var TSDB = map[string]parse.Func{ "band": { Args: []models.FuncType{models.TypeString, models.TypeString, models.TypeString, models.TypeScalar}, Return: models.TypeSeriesSet, Tags: tagQuery, F: Band, }, "bandQuery": { Args: []models.FuncType{models.TypeString, models.TypeString, models.TypeString, models.TypeString, models.TypeScalar}, Return: models.TypeSeriesSet, Tags: tagQuery, F: BandQuery, }, "shiftBand": { Args: []models.FuncType{models.TypeString, models.TypeString, models.TypeString, models.TypeScalar}, Return: models.TypeSeriesSet, Tags: tagQuery, F: ShiftBand, }, "over": { Args: []models.FuncType{models.TypeString, models.TypeString, models.TypeString, models.TypeScalar}, Return: models.TypeSeriesSet, Tags: tagQuery, F: Over, }, "overQuery": { Args: []models.FuncType{models.TypeString, models.TypeString, models.TypeString, models.TypeString, models.TypeScalar}, Return: models.TypeSeriesSet, Tags: tagQuery, F: OverQuery, }, "change": { Args: []models.FuncType{models.TypeString, models.TypeString, models.TypeString}, Return: models.TypeNumberSet, Tags: tagQuery, F: Change, }, "count": { Args: []models.FuncType{models.TypeString, models.TypeString, models.TypeString}, Return: models.TypeScalar, F: Count, }, "q": { Args: []models.FuncType{models.TypeString, models.TypeString, models.TypeString}, Return: models.TypeSeriesSet, Tags: tagQuery, F: Query, }, "window": { Args: []models.FuncType{models.TypeString, models.TypeString, models.TypeString, models.TypeScalar, models.TypeString}, Return: models.TypeSeriesSet, Tags: tagQuery, F: Window, Check: windowCheck, }, }
TSDB defines functions for use with an OpenTSDB backend.
Functions ¶
Types ¶
type AlertStatusProvider ¶
type AlertStatusProvider interface {
GetUnknownAndUnevaluatedAlertKeys(alertName string) (unknown, unevaluated []models.AlertKey)
}
Alert Status Provider is used to provide information about alert results. This facilitates alerts referencing other alerts, even when they go unknown or unevaluated.
type AzureApplicationInsightsApp ¶
type AzureApplicationInsightsApp struct { ApplicationName string AppId string Tags map[string]string }
AzureApplicationInsightsApp in collection of properties for each Azure Application Insights Resource
type AzureApplicationInsightsApps ¶
type AzureApplicationInsightsApps struct { Applications []AzureApplicationInsightsApp Prefix string }
AzureApplicationInsightsApps is a container for a list of AzureApplicationInsightsApp objects It is a bosun type since it passed to Azure Insights query functions
func (AzureApplicationInsightsApps) Type ¶
func (a AzureApplicationInsightsApps) Type() models.FuncType
func (AzureApplicationInsightsApps) Value ¶
func (a AzureApplicationInsightsApps) Value() interface{}
type AzureMonitorClientCollection ¶
type AzureMonitorClientCollection struct { MetricsClient insights.MetricsClient MetricDefinitionsClient insights.MetricDefinitionsClient ResourcesClient resources.Client AIComponentsClient ainsightsmgmt.ComponentsClient AIMetricsClient ainsights.MetricsClient Concurrency int TenantId string }
AzureMonitorClientCollection is a collection of Azure SDK clients since the SDK provides different clients to access different sorts of resources
type AzureMonitorClients ¶
type AzureMonitorClients map[string]AzureMonitorClientCollection
AzureMonitorClients is map of all the AzureMonitorClientCollections that have been configured. This is so multiple subscription/tenant/clients can be queries from the same Bosun instance using the prefix syntax
type AzureResource ¶
type AzureResource struct { Name string Type string ResourceGroup string Tags map[string]string ID string }
AzureResource is a container for Azure resource information that Bosun can interact with
type AzureResources ¶
type AzureResources struct { Resources []AzureResource Prefix string }
AzureResources is a slice of AzureResource type AzureResources []AzureResource
func (AzureResources) Get ¶
func (resources AzureResources) Get(rType, rsg, name string) (az AzureResource, found bool)
Get Returns an AzureResource from AzureResources based on the resource type, group, and name If no matching resource is found, an AzureResource object will be returned but found will be false.
func (AzureResources) Type ¶
func (a AzureResources) Type() models.FuncType
func (AzureResources) Value ¶
func (a AzureResources) Value() interface{}
type Backends ¶
type Backends struct { TSDBContext opentsdb.Context GraphiteContext graphite.Context ElasticHosts ElasticHosts InfluxConfig client.HTTPConfig ElasticConfig ElasticConfig AzureMonitor AzureMonitorClients CloudWatchContext cloudwatch.Context PromConfig PromClients }
type BosunProviders ¶
type ESIndexer ¶
type ESIndexer struct { TimeField string Generate func(startDuration, endDuration *time.Time) []string }
func (ESIndexer) MarshalJSON ¶
type ESQuery ¶
type ESQuery struct {
Query func(ver ESVersion) interface{}
}
func (ESQuery) MarshalJSON ¶
type ElasticConfig ¶
type ElasticHosts ¶
type ElasticHosts struct {
Hosts map[string]ElasticConfig
}
ElasticHosts is an array of Logstash hosts and exists as a type for something to attach methods to. The elasticsearch library will use the listed to hosts to discover all of the hosts in the config type ElasticHosts []string
func (ElasticHosts) InitClient ¶
func (e ElasticHosts) InitClient(prefix string) error
InitClient sets up the elastic client. If the client has already been initialized it is a noop
func (ElasticHosts) InitClient2 ¶
func (e ElasticHosts) InitClient2(prefix string) error
InitClient sets up the elastic client. If the client has already been initialized it is a noop
func (ElasticHosts) InitClient5 ¶
func (e ElasticHosts) InitClient5(prefix string) error
InitClient sets up the elastic client. If the client has already been initialized it is a noop
func (ElasticHosts) InitClient6 ¶
func (e ElasticHosts) InitClient6(prefix string) error
InitClient sets up the elastic client. If the client has already been initialized it is a noop
func (ElasticHosts) InitClient7 ¶
func (e ElasticHosts) InitClient7(prefix string) error
InitClient sets up the elastic client. If the client has already been initialized it is a noop
func (ElasticHosts) Query2 ¶
func (e ElasticHosts) Query2(r *ElasticRequest2) (*elastic.SearchResult, error)
Query takes a Logstash request, applies it a search service, and then queries elasticsearch.
func (ElasticHosts) Query5 ¶
func (e ElasticHosts) Query5(r *ElasticRequest5) (*elastic.SearchResult, error)
Query takes a Logstash request, applies it a search service, and then queries elasticsearch.
func (ElasticHosts) Query6 ¶
func (e ElasticHosts) Query6(r *ElasticRequest6) (*elastic.SearchResult, error)
Query takes a Logstash request, applies it a search service, and then queries elasticsearch.
func (ElasticHosts) Query7 ¶
func (e ElasticHosts) Query7(r *ElasticRequest7) (*elastic.SearchResult, error)
Query takes a Logstash request, applies it a search service, and then queries elasticsearch.
type ElasticRequest2 ¶
type ElasticRequest2 struct { Indices []string HostKey string Start *time.Time End *time.Time Source *elastic.SearchSource // This the object that we build queries in }
ElasticRequest is a container for the information needed to query elasticsearch or a date histogram.
func ESBaseQuery2 ¶
func ESBaseQuery2(now time.Time, indexer ESIndexer, filter elastic.Query, sduration, eduration string, size int, prefix string) (*ElasticRequest2, error)
ESBaseQuery builds the base query that both ESCount and ESStat share
func (*ElasticRequest2) CacheKey ¶
func (r *ElasticRequest2) CacheKey() (string, error)
CacheKey returns the text of the elastic query. That text is the indentifer for the query in the cache. It is a combination of the host key, indices queries and the json query content
type ElasticRequest5 ¶
type ElasticRequest5 struct { Indices []string HostKey string Start *time.Time End *time.Time Source *elastic.SearchSource // This the object that we build queries in }
ElasticRequest5 is a container for the information needed to query elasticsearch or a date histogram.
func ESBaseQuery5 ¶
func ESBaseQuery5(now time.Time, indexer ESIndexer, filter elastic.Query, sduration, eduration string, size int, prefix string) (*ElasticRequest5, error)
ESBaseQuery builds the base query that both ESCount and ESStat share
func (*ElasticRequest5) CacheKey ¶
func (r *ElasticRequest5) CacheKey() (string, error)
CacheKey returns the text of the elastic query. That text is the indentifer for the query in the cache. It is a combination of the host key, indices queries and the json query content
type ElasticRequest6 ¶
type ElasticRequest6 struct { Indices []string HostKey string Start *time.Time End *time.Time Source *elastic.SearchSource // This the object that we build queries in }
ElasticRequest6 is a container for the information needed to query elasticsearch or a date histogram.
func ESBaseQuery6 ¶
func ESBaseQuery6(now time.Time, indexer ESIndexer, filter elastic.Query, sduration, eduration string, size int, prefix string) (*ElasticRequest6, error)
ESBaseQuery builds the base query that both ESCount and ESStat share
func (*ElasticRequest6) CacheKey ¶
func (r *ElasticRequest6) CacheKey() (string, error)
CacheKey returns the text of the elastic query. That text is the indentifer for the query in the cache. It is a combination of the host key, indices queries and the json query content
type ElasticRequest7 ¶
type ElasticRequest7 struct { Indices []string HostKey string Start *time.Time End *time.Time Source *elastic.SearchSource // This the object that we build queries in }
ElasticRequest7 is a container for the information needed to query elasticsearch or a date histogram.
func ESBaseQuery7 ¶
func ESBaseQuery7(now time.Time, indexer ESIndexer, filter elastic.Query, sduration, eduration string, size int, prefix string) (*ElasticRequest7, error)
ESBaseQuery builds the base query that both ESCount and ESStat share
func (*ElasticRequest7) CacheKey ¶
func (r *ElasticRequest7) CacheKey() (string, error)
CacheKey returns the text of the elastic query. That text is the indentifer for the query in the cache. It is a combination of the host key, indices queries and the json query content
type Expr ¶
func (*Expr) Execute ¶
func (e *Expr) Execute(backends *Backends, providers *BosunProviders, T miniprofiler.Timer, now time.Time, autods int, unjoinedOk bool, origin string) (r *Results, queries []opentsdb.Request, err error)
Execute applies a parse expression to the specified OpenTSDB context, and returns one result per group. T may be nil to ignore timings.
func (*Expr) ExecuteState ¶
func (*Expr) MarshalJSON ¶
type NumberExpr ¶
type NumberExpr Expr
func (NumberExpr) Type ¶
func (s NumberExpr) Type() models.FuncType
func (NumberExpr) Value ¶
func (s NumberExpr) Value() interface{}
type PromClients ¶
PromClients is a collection of Prometheus API v1 client APIs (connections)
type ResultSlice ¶
type ResultSlice []*Result
func (ResultSlice) DescByValue ¶
func (r ResultSlice) DescByValue() ResultSlice
func (ResultSlice) Filter ¶
func (r ResultSlice) Filter(filter opentsdb.TagSet) ResultSlice
Filter returns a slice with only the results that have a tagset that conforms to the given key/value pair restrictions
type ResultSliceByGroup ¶
type ResultSliceByGroup ResultSlice
func (ResultSliceByGroup) Len ¶
func (r ResultSliceByGroup) Len() int
func (ResultSliceByGroup) Less ¶
func (r ResultSliceByGroup) Less(i, j int) bool
func (ResultSliceByGroup) Swap ¶
func (r ResultSliceByGroup) Swap(i, j int)
type ResultSliceByValue ¶
type ResultSliceByValue ResultSlice
func (ResultSliceByValue) Len ¶
func (r ResultSliceByValue) Len() int
func (ResultSliceByValue) Less ¶
func (r ResultSliceByValue) Less(i, j int) bool
func (ResultSliceByValue) Swap ¶
func (r ResultSliceByValue) Swap(i, j int)
type Results ¶
type Results struct { Results ResultSlice // If true, ungrouped joins from this set will be ignored. IgnoreUnjoined bool // If true, ungrouped joins from the other set will be ignored. IgnoreOtherUnjoined bool // If non nil, will set any NaN value to it. NaNValue *float64 }
func Aggr ¶
Aggr combines multiple series matching the specified groups using an aggregator function. If group is empty, all given series are combined, regardless of existing groups. Available aggregator functions include: avg, min, max, sum, and pN, where N is a float between 0 and 1 inclusive, e.g. p.50 represents the 50th percentile. p0 and p1 are equal to min and max, respectively, but min and max are preferred for readability.
func AnDurations ¶
func AnTable ¶
func AnTable(e *State, filter, fieldsCSV, startDuration, endDuration string) (r *Results, err error)
AnTable returns a table response (meant for Grafana) of matching annotations based on the requested fields
func AzureAIFilterApps ¶
func AzureAIFilterApps(prefix string, e *State, apps AzureApplicationInsightsApps, filter string) (r *Results, err error)
AzureAIFilterApps filters a list of applications based on the name of the app, or the Azure tags associated with the application resource
func AzureAIListApps ¶
AzureAIListApps get a list of all applications on the subscription and returns those apps in a AzureApplicationInsightsApps within the result
func AzureAIMetricMD ¶
func AzureAIMetricMD(prefix string, e *State, apps AzureApplicationInsightsApps) (r *Results, err error)
AzureAIMetricMD returns metric metadata for the listed AzureApplicationInsightsApps. This is not meant as core expression function, but rather one for interactive inspection through the expression UI.
func AzureAIQuery ¶
func AzureAIQuery(prefix string, e *State, metric, segmentCSV, filter string, apps AzureApplicationInsightsApps, agtype, interval, sdur, edur string) (r *Results, err error)
AzureAIQuery queries the Azure Application Insights API for metrics data and transforms the response into a series set
func AzureFilterResources ¶
func AzureFilterResources(e *State, resources AzureResources, filter string) (r *Results, err error)
AzureFilterResources filters a list of resources based on the value of the name, resource group or tags associated with that resource
func AzureMetricDefinitions ¶
func AzureMetricDefinitions(prefix string, e *State, namespace, metric, rsg, resource string) (r *Results, err error)
AzureMetricDefinitions fetches metric information for a specific resource and metric tuple TODO make this return and not fmt.Printf
func AzureMultiQuery ¶
func AzureMultiQuery(prefix string, e *State, metric, tagKeysCSV string, resources AzureResources, agtype string, interval, sdur, edur string) (r *Results, err error)
AzureMultiQuery queries multiple Azure resources and returns them as a single result set It makes one HTTP request per resource and parallelizes the requests
func AzureQuery ¶
func AzureQuery(prefix string, e *State, namespace, metric, tagKeysCSV, rsg, resName, agtype, interval, sdur, edur string) (r *Results, err error)
AzureQuery queries an Azure monitor metric for the given resource and returns a series set tagged by rsg (resource group), name (resource name), and any tag keys parsed from the tagKeysCSV argument
func AzureResourcesByType ¶
AzureResourcesByType returns all resources of the specified type It fetches the complete list resources and then filters them relying on a Cache of that resource list
func CloudWatchQuery ¶
func DropValues ¶
func ESDateHistogram2 ¶
func ESDateHistogram5 ¶
func ESDateHistogram6 ¶
func ESDateHistogram7 ¶
func ESStat ¶
func ESStat(prefix string, e *State, indexer ESIndexer, keystring string, filter ESQuery, field, rstat, interval, sduration, eduration string) (r *Results, err error)
ESStat returns a bucketed statistical reduction for the specified field.
func GraphiteBand ¶
func GraphiteQuery ¶
func InfluxQuery ¶
func PromMQuery ¶
func PromMQuery(prefix string, e *State, metric, groupBy, filter, agType, stepDuration, sdur, edur string) (r *Results, err error)
PromMQuery is a wrapper from promMQuery in the way that PromQuery is a wrapper from promQuery.
func PromMRate ¶
func PromMRate(prefix string, e *State, metric, groupBy, filter, agType, rateDuration, stepDuration, sdur, edur string) (r *Results, err error)
PromMRate is a wrapper from promMQuery in the way that PromRate is a wrapper from promQuery. It has a stepDuration argument for rate calculation.
func PromMRawAggSeriesQuery ¶
func PromMRawAggSeriesQuery(prefix string, e *State, query, stepDuration, sdur, edur string) (*Results, error)
PromMRawAggSeriesQuery is wrapper for promRawAggSeriesQuery setting the multi argument to true.
func PromMetricList ¶
PromMetricList returns a list of available metrics for the prometheus backend by using querying the Prometheus Label Values API for "__name__"
func PromQuery ¶
func PromQuery(prefix string, e *State, metric, groupBy, filter, agType, stepDuration, sdur, edur string) (r *Results, err error)
PromQuery is a wrapper for promQuery so there is a function signature that doesn't require the rate argument in the expr language. It also sets promQuery's addPrefixTag argument to false since this only queries one backend.
func PromRate ¶
func PromRate(prefix string, e *State, metric, groupBy, filter, agType, rateDuration, stepDuration, sdur, edur string) (r *Results, err error)
PromRate is a wrapper for promQuery like PromQuery except that it has a rateDuration argument for the step of the rate calculation. This enables rate calculation for counters.
func PromRawAggSeriesQuery ¶
func PromRawAggSeriesQuery(prefix string, e *State, query, stepDuration, sdur, edur string) (*Results, error)
PromRawAggSeriesQuery is wrapper for promRawAggSeriesQuery setting the multi argument to false.
func PromTagInfo ¶
PromTagInfo does a range query for the given metric and returns info about the tags and labels for the metric based on the data from the queried timeframe
type Series ¶
Series is the standard form within bosun to represent timeseries data.
func (Series) MarshalJSON ¶
type SortablePoint ¶
type SortableSeries ¶
type SortableSeries []SortablePoint
SortableSeries is an alternative datastructure for timeseries data, which stores points in a time-ordered fashion instead of a map. see discussion at https://github.com/bosun-monitor/bosun/pull/699
func NewSortedSeries ¶
func NewSortedSeries(dps Series) SortableSeries
func (SortableSeries) Len ¶
func (s SortableSeries) Len() int
func (SortableSeries) Less ¶
func (s SortableSeries) Less(i, j int) bool
func (SortableSeries) Swap ¶
func (s SortableSeries) Swap(i, j int)
type State ¶
type State struct { *Expr // Origin allows the source of the expression to be identified for logging and debugging Origin string Timer miniprofiler.Timer *Backends // Bosun Internal *BosunProviders // contains filtered or unexported fields }
func (*State) AddComputation ¶
type Union ¶
type Union struct { models.Computations A, B Value Group opentsdb.TagSet }