Documentation
¶
Index ¶
- Constants
- func AppendCHExpr(b []byte, key string) []byte
- func CHExpr(key string) ch.Safe
- func DatapointTableForGrouping(f *org.TimeFilter, groupingIntervalFn func(time.Time, time.Time) time.Duration) (string, time.Duration)
- func DatapointTableForWhere(f *org.TimeFilter) string
- func DecodeAttrFilter(app *bunapp.App, req bunrouter.Request, f *AttrFilter) error
- func DecodeDashFilter(req bunrouter.Request, f *DashFilter) error
- func DecodeMetricFilter(req bunrouter.Request, f *MetricFilter) error
- func DecodeQueryFilter(req bunrouter.Request, f *QueryFilter) error
- func DeleteDashboard(ctx context.Context, db bun.IDB, id uint64) error
- func Init(ctx context.Context, app *bunapp.App)
- func InsertDashboard(ctx context.Context, db bun.IDB, dash *Dashboard) error
- func InsertDatapoints(ctx context.Context, app *bunapp.App, datapoints []*Datapoint) error
- func InsertGridItems(ctx context.Context, db bun.IDB, gridItems []GridItem) error
- func InsertGridRow(ctx context.Context, db bun.IDB, gridRow *GridRow) error
- func SelectMetricMap(ctx context.Context, app *bunapp.App, projectID uint32) (map[string]*Metric, error)
- func UpsertMetric(ctx context.Context, app *bunapp.App, m *Metric) error
- func UpsertMetrics(ctx context.Context, app *bunapp.App, metrics []Metric) error
- type AttrFilter
- type AttrHandler
- type AttrKeyItem
- type AttrMap
- type AttrName
- type AttrValueItem
- type BaseGridItem
- type BaseGridItemTpl
- type BaseMonitorTpl
- type CHStorage
- type CHStorageConfig
- type ChartGridItem
- type ChartGridItemParams
- type ChartGridItemTpl
- type ChartKind
- type ChartLegend
- type CloudwatchDatapoint
- type ColumnInfo
- type CumToDeltaConv
- type DashBuilder
- type DashFilter
- type DashHandler
- func (h *DashHandler) Clone(w http.ResponseWriter, req bunrouter.Request) error
- func (h *DashHandler) Create(w http.ResponseWriter, req bunrouter.Request) error
- func (h *DashHandler) CreateFromYAML(w http.ResponseWriter, req bunrouter.Request) error
- func (h *DashHandler) Delete(w http.ResponseWriter, req bunrouter.Request) error
- func (h *DashHandler) List(w http.ResponseWriter, req bunrouter.Request) error
- func (h *DashHandler) Pin(w http.ResponseWriter, req bunrouter.Request) error
- func (h *DashHandler) Reset(w http.ResponseWriter, req bunrouter.Request) error
- func (h *DashHandler) Show(w http.ResponseWriter, req bunrouter.Request) error
- func (h *DashHandler) ShowYAML(w http.ResponseWriter, req bunrouter.Request) error
- func (h *DashHandler) Unpin(w http.ResponseWriter, req bunrouter.Request) error
- func (h *DashHandler) Update(w http.ResponseWriter, req bunrouter.Request) error
- func (h *DashHandler) UpdateGrid(w http.ResponseWriter, req bunrouter.Request) error
- func (h *DashHandler) UpdateTable(w http.ResponseWriter, req bunrouter.Request) error
- func (h *DashHandler) UpdateYAML(w http.ResponseWriter, req bunrouter.Request) error
- type DashKind
- type DashSyncer
- type DashTableTpl
- type Dashboard
- type DashboardIn
- type DashboardTpl
- type Datapoint
- type DatapointKey
- type DatapointProcessor
- type DatapointValue
- type ErrorMonitorTpl
- type ExpHistogramPoint
- type GaugeColumn
- type GaugeGridItem
- type GaugeGridItemParams
- type GaugeGridItemTpl
- type GridItem
- type GridItemHandler
- func (h *GridItemHandler) Create(w http.ResponseWriter, req bunrouter.Request) error
- func (h *GridItemHandler) Delete(w http.ResponseWriter, req bunrouter.Request) error
- func (h *GridItemHandler) GridItemMiddleware(next bunrouter.HandlerFunc) bunrouter.HandlerFunc
- func (h *GridItemHandler) Update(w http.ResponseWriter, req bunrouter.Request) error
- func (h *GridItemHandler) UpdateLayout(w http.ResponseWriter, req bunrouter.Request) error
- type GridItemIn
- type GridItemPos
- type GridItemTpl
- type GridItemType
- type GridRow
- type GridRowHandler
- func (h *GridRowHandler) Create(w http.ResponseWriter, req bunrouter.Request) error
- func (h *GridRowHandler) Delete(w http.ResponseWriter, req bunrouter.Request) error
- func (h *GridRowHandler) GridRowMiddleware(next bunrouter.HandlerFunc) bunrouter.HandlerFunc
- func (h *GridRowHandler) MoveDown(w http.ResponseWriter, req bunrouter.Request) error
- func (h *GridRowHandler) MoveUp(w http.ResponseWriter, req bunrouter.Request) error
- func (h *GridRowHandler) Show(w http.ResponseWriter, req bunrouter.Request) error
- func (h *GridRowHandler) Update(w http.ResponseWriter, req bunrouter.Request) error
- type GridRowIn
- type GridRowTpl
- type HeatmapGridItem
- type HeatmapGridItemParams
- type HeatmapGridItemTpl
- type HistogramPoint
- type Instrument
- type KinesisEvent
- type KinesisEventRecord
- type KinesisHandler
- type LegendPlacement
- type LegendType
- type LegendValue
- type MappingOp
- type Metric
- type MetricColumn
- type MetricFilter
- type MetricHandler
- type MetricKey
- type MetricMatcher
- type MetricMonitorTpl
- type MetricsServiceServer
- type Middleware
- type MonitorTpl
- type NumberPoint
- type PromDatapoint
- type PrometheusHandler
- type QueryFilter
- type QueryHandler
- func (h *QueryHandler) Gauge(w http.ResponseWriter, req bunrouter.Request) error
- func (h *QueryHandler) Heatmap(w http.ResponseWriter, req bunrouter.Request) error
- func (h *QueryHandler) Table(w http.ResponseWriter, req bunrouter.Request) error
- func (h *QueryHandler) Timeseries(w http.ResponseWriter, req bunrouter.Request) error
- type TableColumn
- type TableGridItem
- type TableGridItemParams
- type TableGridItemTpl
- type Timeseries
- type TimeseriesStyle
- type ValueMapping
Constants ¶
View Source
const ( TableDatapointMinutes = "datapoint_minutes" TableDatapointHours = "datapoint_hours" )
View Source
const ( MappingAny = "any" MappingEqual = "eq" MappingLT = "lt" MappingLTE = "lte" MappingGT = "gt" MappingGTE = "gte" )
Variables ¶
This section is empty.
Functions ¶
func AppendCHExpr ¶
func DatapointTableForWhere ¶
func DatapointTableForWhere(f *org.TimeFilter) string
func DecodeAttrFilter ¶
func DecodeDashFilter ¶ added in v1.7.0
func DecodeDashFilter(req bunrouter.Request, f *DashFilter) error
func DecodeMetricFilter ¶
func DecodeMetricFilter(req bunrouter.Request, f *MetricFilter) error
func DecodeQueryFilter ¶
func DecodeQueryFilter(req bunrouter.Request, f *QueryFilter) error
func InsertDatapoints ¶
func InsertGridItems ¶
func SelectMetricMap ¶
Types ¶
type AttrFilter ¶
type AttrFilter struct {
org.TimeFilter
App *bunapp.App
ProjectID uint32
Metric []string
AttrKey []string
Instrument []string
OtelLibraryName []string
SearchInput string
}
func (*AttrFilter) UnmarshalValues ¶
type AttrHandler ¶
func NewAttrHandler ¶
func NewAttrHandler(app *bunapp.App) *AttrHandler
func (*AttrHandler) AttrKeys ¶
func (h *AttrHandler) AttrKeys(w http.ResponseWriter, req bunrouter.Request) error
func (*AttrHandler) AttrValues ¶
func (h *AttrHandler) AttrValues(w http.ResponseWriter, req bunrouter.Request) error
type AttrKeyItem ¶
type AttrValueItem ¶
type BaseGridItem ¶
type BaseGridItem struct {
bun.BaseModel `bun:"grid_items,alias:g"`
ID uint64 `json:"id" bun:",pk,autoincrement"`
DashID uint64 `json:"dashId"`
DashKind DashKind `json:"dashKind"`
RowID uint64 `json:"rowId" bun:",nullzero"`
Title string `json:"title"`
Description string `json:"description" bun:",nullzero"`
Width int `json:"width"`
Height int `json:"height"`
XAxis int `json:"xAxis"`
YAxis int `json:"yAxis"`
Type GridItemType `json:"type"`
Params bunutil.Params `json:"params"`
CreatedAt time.Time `json:"createdAt" bun:",nullzero"`
UpdatedAt time.Time `json:"updatedAt" bun:",nullzero"`
}
func SelectBaseGridItems ¶
func (*BaseGridItem) Validate ¶
func (item *BaseGridItem) Validate() error
type BaseGridItemTpl ¶
type BaseGridItemTpl struct {
Title string `yaml:"title"`
Description string `yaml:"description,omitempty"`
Width int `yaml:"width,omitempty"`
Height int `yaml:"height,omitempty"`
XAxis int `yaml:"x_axis,omitempty"`
YAxis int `yaml:"y_axis,omitempty"`
Type GridItemType `yaml:"type"`
}
func (*BaseGridItemTpl) From ¶
func (c *BaseGridItemTpl) From(gridItemType GridItemType, baseItem *BaseGridItem)
func (*BaseGridItemTpl) Populate ¶
func (tpl *BaseGridItemTpl) Populate(item *BaseGridItem)
type BaseMonitorTpl ¶ added in v1.6.2
type BaseMonitorTpl struct {
Name string `yaml:"name"`
Type org.MonitorType `yaml:"type,omitempty"`
NotifyEveryoneByEmail bool `yaml:"notify_everyone_by_email"`
}
func (*BaseMonitorTpl) Populate ¶ added in v1.6.2
func (tpl *BaseMonitorTpl) Populate(monitor *org.BaseMonitor) error
type CHStorage ¶
type CHStorage struct {
// contains filtered or unexported fields
}
func NewCHStorage ¶
func (*CHStorage) SelectTimeseries ¶
func (s *CHStorage) SelectTimeseries(f *mql.TimeseriesFilter) ([]*mql.Timeseries, error)
type CHStorageConfig ¶
type ChartGridItem ¶
type ChartGridItem struct {
*BaseGridItem `bun:",inherit"`
Params ChartGridItemParams `json:"params"`
}
func NewChartGridItem ¶
func NewChartGridItem() *ChartGridItem
func (*ChartGridItem) Base ¶
func (c *ChartGridItem) Base() *BaseGridItem
func (*ChartGridItem) Metrics ¶
func (c *ChartGridItem) Metrics() []string
func (*ChartGridItem) Validate ¶
func (c *ChartGridItem) Validate() error
type ChartGridItemParams ¶
type ChartGridItemParams struct {
ChartKind ChartKind `json:"chartKind"`
Metrics []mql.MetricAlias `json:"metrics"`
Query string `json:"query"`
// Use ColumnMap instead of MetricMap for compatibility with TableGridItem.
ColumnMap map[string]*MetricColumn `json:"columnMap"`
TimeseriesMap map[string]*TimeseriesStyle `json:"timeseriesMap"`
Legend *ChartLegend `json:"legend"`
}
type ChartGridItemTpl ¶
type ChartGridItemTpl struct {
BaseGridItemTpl `yaml:",inline"`
ChartKind ChartKind `yaml:"chart"`
Metrics []string `yaml:"metrics"`
Query []string `yaml:"query"`
Columns map[string]*MetricColumn `yaml:"columns,omitempty"`
Styles map[string]*TimeseriesStyle `yaml:"styles,omitempty"`
Legend *ChartLegend `yaml:"legend,omitempty"`
}
func NewChartGridItemTpl ¶
func NewChartGridItemTpl(item *ChartGridItem) *ChartGridItemTpl
func (*ChartGridItemTpl) Populate ¶
func (tpl *ChartGridItemTpl) Populate(item *ChartGridItem) error
type ChartLegend ¶
type ChartLegend struct {
Type LegendType `json:"type" yaml:"type"`
Placement LegendPlacement `json:"placement" yaml:"placement"`
Values []LegendValue `json:"values" yaml:"values"`
}
type CloudwatchDatapoint ¶
type CloudwatchDatapoint struct {
MetricStreamName string `json:"metric_stream_name"`
AccountID string `json:"account_id"`
Region string `json:"region"`
Namespace string `json:"namespace"`
MetricName string `json:"metric_name"`
Dimensions map[string]string `json:"dimensions"`
Timestamp int64 `json:"timestamp"`
Value struct {
Min float64 `json:"min"`
Max float64 `json:"max"`
Sum float64 `json:"sum"`
Count float64 `json:"count"`
} `json:"value"`
Unit string `json:"unit"`
}
type ColumnInfo ¶
type CumToDeltaConv ¶
type CumToDeltaConv struct {
// contains filtered or unexported fields
}
func NewCumToDeltaConv ¶
func NewCumToDeltaConv(n int) *CumToDeltaConv
func (*CumToDeltaConv) Len ¶
func (c *CumToDeltaConv) Len() int
func (*CumToDeltaConv) SwapPoint ¶
func (c *CumToDeltaConv) SwapPoint(key DatapointKey, point any, time time.Time) any
type DashBuilder ¶
type DashBuilder struct {
// contains filtered or unexported fields
}
func NewDashBuilder ¶
func NewDashBuilder( tpl *DashboardTpl, projectID uint32, metricMap map[string]*Metric, ) *DashBuilder
func (*DashBuilder) Build ¶
func (b *DashBuilder) Build() error
func (*DashBuilder) IsEmpty ¶
func (b *DashBuilder) IsEmpty() bool
func (*DashBuilder) Validate ¶
func (b *DashBuilder) Validate() error
type DashFilter ¶ added in v1.7.0
type DashFilter struct {
ProjectID uint32 `urlstruct:"-"`
org.OrderByMixin
Q string
Pinned bool
}
func (*DashFilter) PGOrder ¶ added in v1.7.0
func (f *DashFilter) PGOrder(q *bun.SelectQuery) *bun.SelectQuery
func (*DashFilter) UnmarshalValues ¶ added in v1.7.0
func (*DashFilter) WhereClause ¶ added in v1.7.0
func (f *DashFilter) WhereClause(q *bun.SelectQuery) *bun.SelectQuery
type DashHandler ¶
func NewDashHandler ¶
func NewDashHandler(app *bunapp.App) *DashHandler
func (*DashHandler) Clone ¶
func (h *DashHandler) Clone(w http.ResponseWriter, req bunrouter.Request) error
func (*DashHandler) Create ¶
func (h *DashHandler) Create(w http.ResponseWriter, req bunrouter.Request) error
func (*DashHandler) CreateFromYAML ¶ added in v1.6.2
func (h *DashHandler) CreateFromYAML(w http.ResponseWriter, req bunrouter.Request) error
func (*DashHandler) Delete ¶
func (h *DashHandler) Delete(w http.ResponseWriter, req bunrouter.Request) error
func (*DashHandler) List ¶
func (h *DashHandler) List(w http.ResponseWriter, req bunrouter.Request) error
func (*DashHandler) Pin ¶
func (h *DashHandler) Pin(w http.ResponseWriter, req bunrouter.Request) error
func (*DashHandler) Reset ¶
func (h *DashHandler) Reset(w http.ResponseWriter, req bunrouter.Request) error
func (*DashHandler) Show ¶
func (h *DashHandler) Show(w http.ResponseWriter, req bunrouter.Request) error
func (*DashHandler) ShowYAML ¶
func (h *DashHandler) ShowYAML(w http.ResponseWriter, req bunrouter.Request) error
func (*DashHandler) Unpin ¶
func (h *DashHandler) Unpin(w http.ResponseWriter, req bunrouter.Request) error
func (*DashHandler) Update ¶
func (h *DashHandler) Update(w http.ResponseWriter, req bunrouter.Request) error
func (*DashHandler) UpdateGrid ¶
func (h *DashHandler) UpdateGrid(w http.ResponseWriter, req bunrouter.Request) error
func (*DashHandler) UpdateTable ¶
func (h *DashHandler) UpdateTable(w http.ResponseWriter, req bunrouter.Request) error
func (*DashHandler) UpdateYAML ¶ added in v1.7.0
func (h *DashHandler) UpdateYAML(w http.ResponseWriter, req bunrouter.Request) error
type DashSyncer ¶
type DashSyncer struct {
// contains filtered or unexported fields
}
func NewDashSyncer ¶
func NewDashSyncer(app *bunapp.App) *DashSyncer
func (*DashSyncer) CreateDashboardsHandler ¶
func (s *DashSyncer) CreateDashboardsHandler(ctx context.Context, projectID uint32) error
type DashTableTpl ¶ added in v1.7.0
type DashTableTpl struct {
If []MetricMatcher `yaml:"if,omitempty"`
Metrics []string `yaml:"metrics"`
Query []string `yaml:"query"`
Columns map[string]*TableColumn `yaml:"columns,omitempty"`
}
func (*DashTableTpl) Populate ¶ added in v1.7.0
func (tpl *DashTableTpl) Populate(dash *Dashboard) error
type Dashboard ¶
type Dashboard struct {
bun.BaseModel `bun:"dashboards,alias:d"`
ID uint64 `json:"id" bun:",pk,autoincrement"`
ProjectID uint32 `json:"projectId"`
TemplateID string `json:"templateId" bun:",nullzero"`
Name string `json:"name"`
Pinned bool `json:"pinned"`
MinInterval unixtime.Millis `json:"minInterval"`
TimeOffset unixtime.Millis `json:"timeOffset"`
TooltipsConnected bool `json:"tooltipsConnected"`
GridQuery string `json:"gridQuery" bun:",nullzero"`
GridMaxWidth int `json:"gridMaxWidth" bun:",nullzero"`
TableMetrics []mql.MetricAlias `json:"tableMetrics" bun:",type:jsonb,nullzero"`
TableQuery string `json:"tableQuery" bun:",nullzero"`
TableGrouping []string `json:"tableGrouping" bun:",type:jsonb,nullzero"`
TableColumnMap map[string]*TableColumn `json:"tableColumnMap" bun:",type:jsonb,nullzero"`
CreatedAt time.Time `json:"createdAt" bun:",nullzero"`
UpdatedAt time.Time `json:"updatedAt" bun:",nullzero"`
}
func SelectDashboard ¶
type DashboardIn ¶
type DashboardIn struct {
Name string `json:"name"`
MinInterval unixtime.Millis `json:"minInterval"`
TimeOffset unixtime.Millis `json:"timeOffset"`
GridMaxWidth int `json:"gridMaxWidth"`
}
func (*DashboardIn) Populate ¶
func (in *DashboardIn) Populate(dash *Dashboard) error
type DashboardTpl ¶
type DashboardTpl struct {
Schema string `yaml:"schema"`
ID string `yaml:"id"`
If []MetricMatcher `yaml:"if,omitempty"`
Name string `yaml:"name"`
MinInterval unixtime.Millis `yaml:"min_interval,omitempty"`
TimeOffset unixtime.Millis `yaml:"time_offset,omitempty"`
GridQuery string `yaml:"grid_query,omitempty"`
TableGridItems []*GridItemTpl `yaml:"table_grid_items,omitempty"`
Table []DashTableTpl `yaml:"table"`
IncludeGridRows []string `yaml:"include_grid_rows,omitempty"`
GridRows []*GridRowTpl `yaml:"grid_rows"`
Monitors []*MetricMonitorTpl `yaml:"monitors,omitempty"`
}
func NewDashboardTpl ¶
func NewDashboardTpl( dash *Dashboard, tableItems []GridItem, gridRows []*GridRow, ) (*DashboardTpl, error)
func (*DashboardTpl) Populate ¶
func (tpl *DashboardTpl) Populate(dash *Dashboard) error
type Datapoint ¶
type Datapoint struct {
ch.CHModel `ch:"datapoint_minutes,insert:datapoint_minutes_buffer,alias:m"`
ProjectID uint32
Metric string `ch:"metric,lc"`
Description string `ch:"-"`
Unit string `ch:"-"`
Instrument Instrument `ch:",lc"`
Time time.Time `ch:"type:DateTime"`
AttrsHash uint64
Min float64
Max float64
Sum float64
Count uint64
Gauge float64
Histogram map[bfloat16.T]uint64 `ch:"type:AggregateFunction(quantilesBFloat16(0.5), Float32)"`
Attrs AttrMap `ch:"-"`
StringKeys []string `ch:"type:Array(LowCardinality(String))"`
StringValues []string
OtelLibraryName string `ch:",lc"`
OtelLibraryVersion string `ch:",lc"`
StartTimeUnixNano uint64 `ch:"-"`
CumPoint any `ch:"-"`
}
type DatapointKey ¶
type DatapointProcessor ¶
func NewDatapointProcessor ¶
func NewDatapointProcessor(app *bunapp.App) *DatapointProcessor
func (*DatapointProcessor) AddDatapoint ¶
func (p *DatapointProcessor) AddDatapoint(ctx context.Context, datapoint *Datapoint)
type DatapointValue ¶
type DatapointValue struct {
Key DatapointKey
Point any
Time time.Time
}
type ErrorMonitorTpl ¶ added in v1.6.2
type ErrorMonitorTpl struct {
BaseMonitorTpl `yaml:",inline"`
NotifyOnNewErrors bool `yaml:"notify_on_new_errors"`
NotifyOnRecurringErrors bool `yaml:"notify_on_recurring_errors"`
Matchers []org.AttrMatcher `yaml:"matchers"`
}
func NewErrorMonitorTpl ¶ added in v1.6.2
func NewErrorMonitorTpl(monitor *org.ErrorMonitor) *ErrorMonitorTpl
func (*ErrorMonitorTpl) Populate ¶ added in v1.6.2
func (tpl *ErrorMonitorTpl) Populate(monitor *org.ErrorMonitor) error
type ExpHistogramPoint ¶
type GaugeColumn ¶
type GaugeColumn struct {
Unit string `json:"unit" yaml:"unit,omitempty"`
AggFunc string `json:"aggFunc" yaml:"agg_func,omitempty"`
}
func (*GaugeColumn) Validate ¶
func (c *GaugeColumn) Validate() error
type GaugeGridItem ¶
type GaugeGridItem struct {
*BaseGridItem `bun:",inherit"`
Params GaugeGridItemParams `json:"params"`
}
func NewGaugeGridItem ¶
func NewGaugeGridItem() *GaugeGridItem
func (*GaugeGridItem) Base ¶
func (c *GaugeGridItem) Base() *BaseGridItem
func (*GaugeGridItem) Metrics ¶
func (c *GaugeGridItem) Metrics() []string
func (*GaugeGridItem) Validate ¶
func (c *GaugeGridItem) Validate() error
type GaugeGridItemParams ¶
type GaugeGridItemParams struct {
Metrics []mql.MetricAlias `json:"metrics"`
Query string `json:"query"`
ColumnMap map[string]*GaugeColumn `json:"columnMap" bun:",nullzero"`
Template string `json:"template" bun:",nullzero"`
ValueMappings []ValueMapping `json:"valueMappings" bun:",nullzero"`
}
type GaugeGridItemTpl ¶
type GaugeGridItemTpl struct {
BaseGridItemTpl `yaml:",inline"`
Metrics []string `yaml:"metrics"`
Query []string `yaml:"query"`
Columns map[string]*GaugeColumn `yaml:"columns,omitempty"`
Template string `yaml:"template,omitempty"`
ValueMappings []ValueMapping `yaml:"value_mappings,omitempty"`
}
func NewGaugeGridItemTpl ¶
func NewGaugeGridItemTpl(item *GaugeGridItem) *GaugeGridItemTpl
func (*GaugeGridItemTpl) Populate ¶
func (tpl *GaugeGridItemTpl) Populate(item *GaugeGridItem) error
type GridItem ¶
type GridItem interface {
Base() *BaseGridItem
Validate() error
Metrics() []string
}
func SelectGridItem ¶
type GridItemHandler ¶
func NewGridItemHandler ¶
func NewGridItemHandler(app *bunapp.App) *GridItemHandler
func (*GridItemHandler) Create ¶
func (h *GridItemHandler) Create(w http.ResponseWriter, req bunrouter.Request) error
func (*GridItemHandler) Delete ¶
func (h *GridItemHandler) Delete(w http.ResponseWriter, req bunrouter.Request) error
func (*GridItemHandler) GridItemMiddleware ¶
func (h *GridItemHandler) GridItemMiddleware(next bunrouter.HandlerFunc) bunrouter.HandlerFunc
func (*GridItemHandler) Update ¶
func (h *GridItemHandler) Update(w http.ResponseWriter, req bunrouter.Request) error
func (*GridItemHandler) UpdateLayout ¶
func (h *GridItemHandler) UpdateLayout(w http.ResponseWriter, req bunrouter.Request) error
type GridItemIn ¶
type GridItemIn struct {
DashKind DashKind `json:"dashKind"`
Title string `json:"title"`
Description string `json:"description"`
Width int `json:"width"`
Height int `json:"height"`
Type GridItemType `json:"type"`
Params json.RawMessage `json:"params"`
}
func (*GridItemIn) Populate ¶
func (in *GridItemIn) Populate(baseItem *BaseGridItem) error
type GridItemPos ¶
type GridItemTpl ¶
type GridItemTpl struct {
Value any
}
func NewGridItemTpl ¶
func NewGridItemTpl(item GridItem) *GridItemTpl
func (*GridItemTpl) MarshalYAML ¶
func (tpl *GridItemTpl) MarshalYAML() (interface{}, error)
func (*GridItemTpl) UnmarshalYAML ¶
func (item *GridItemTpl) UnmarshalYAML(node *yaml.Node) error
type GridItemType ¶
type GridItemType string
const ( GridItemChart GridItemType = "chart" GridItemTable GridItemType = "table" GridItemHeatmap GridItemType = "heatmap" GridItemGauge GridItemType = "gauge" )
type GridRow ¶
type GridRow struct {
bun.BaseModel `bun:"grid_rows,alias:r"`
ID uint64 `json:"id" bun:",pk,autoincrement"`
DashID uint64 `json:"dashId"`
Title string `json:"title"`
Description string `json:"description" bun:",nullzero"`
Expanded bool `json:"expanded"`
Index int `json:"index"`
Items []GridItem `json:"items" bun:"-"`
CreatedAt time.Time `json:"createdAt" bun:",nullzero"`
UpdatedAt time.Time `json:"updatedAt" bun:",nullzero"`
}
func SelectGridRow ¶
func SelectGridRows ¶
func SelectOrCreateGridRow ¶
type GridRowHandler ¶
func NewGridRowHandler ¶
func NewGridRowHandler(app *bunapp.App) *GridRowHandler
func (*GridRowHandler) Create ¶
func (h *GridRowHandler) Create(w http.ResponseWriter, req bunrouter.Request) error
func (*GridRowHandler) Delete ¶
func (h *GridRowHandler) Delete(w http.ResponseWriter, req bunrouter.Request) error
func (*GridRowHandler) GridRowMiddleware ¶
func (h *GridRowHandler) GridRowMiddleware(next bunrouter.HandlerFunc) bunrouter.HandlerFunc
func (*GridRowHandler) MoveDown ¶
func (h *GridRowHandler) MoveDown(w http.ResponseWriter, req bunrouter.Request) error
func (*GridRowHandler) MoveUp ¶
func (h *GridRowHandler) MoveUp(w http.ResponseWriter, req bunrouter.Request) error
func (*GridRowHandler) Show ¶
func (h *GridRowHandler) Show(w http.ResponseWriter, req bunrouter.Request) error
func (*GridRowHandler) Update ¶
func (h *GridRowHandler) Update(w http.ResponseWriter, req bunrouter.Request) error
type GridRowIn ¶
type GridRowTpl ¶
type GridRowTpl struct {
Title string `yaml:"title"`
Items []*GridItemTpl `yaml:"items"`
}
func NewGridRowTpl ¶
func NewGridRowTpl(row *GridRow) *GridRowTpl
func (*GridRowTpl) Populate ¶
func (tpl *GridRowTpl) Populate(row *GridRow) error
type HeatmapGridItem ¶
type HeatmapGridItem struct {
*BaseGridItem `bun:",inherit"`
Params HeatmapGridItemParams `json:"params"`
}
func NewHeatmapGridItem ¶
func NewHeatmapGridItem() *HeatmapGridItem
func (*HeatmapGridItem) Base ¶
func (c *HeatmapGridItem) Base() *BaseGridItem
func (*HeatmapGridItem) Metrics ¶
func (c *HeatmapGridItem) Metrics() []string
func (*HeatmapGridItem) Validate ¶
func (c *HeatmapGridItem) Validate() error
type HeatmapGridItemParams ¶
type HeatmapGridItemTpl ¶
type HeatmapGridItemTpl struct {
BaseGridItemTpl `yaml:",inline"`
Metric string `yaml:"metric"`
Unit string `yaml:"unit,omitempty"`
Query []string `yaml:"query"`
}
func NewHeatmapGridItemTpl ¶
func NewHeatmapGridItemTpl(col *HeatmapGridItem) *HeatmapGridItemTpl
func (*HeatmapGridItemTpl) Populate ¶
func (tpl *HeatmapGridItemTpl) Populate(item *HeatmapGridItem) error
type HistogramPoint ¶
type Instrument ¶
type Instrument string
const ( InstrumentDeleted Instrument = "deleted" InstrumentGauge Instrument = "gauge" InstrumentAdditive Instrument = "additive" InstrumentHistogram Instrument = "histogram" InstrumentCounter Instrument = "counter" InstrumentSummary Instrument = "summary" )
type KinesisEvent ¶
type KinesisEvent struct {
RequestID string `json:"requestId"`
Records []KinesisEventRecord `json:"records"`
}
type KinesisEventRecord ¶
type KinesisEventRecord struct {
Data []byte `json:"data"`
}
type KinesisHandler ¶
func NewKinesisHandler ¶
func NewKinesisHandler(app *bunapp.App, mp *DatapointProcessor) *KinesisHandler
func (*KinesisHandler) Metrics ¶
func (h *KinesisHandler) Metrics(w http.ResponseWriter, req bunrouter.Request) error
type LegendPlacement ¶
type LegendPlacement string
const ( LegendBottom LegendPlacement = "bottom" LegendRight LegendPlacement = "right" )
type LegendType ¶
type LegendType string
const ( LegendNone LegendType = "none" LegendList LegendType = "list" LegendTable LegendType = "table" )
type LegendValue ¶
type LegendValue string
const ( LegendAvg LegendValue = "avg" LegendMin LegendValue = "min" LegendMax LegendValue = "max" LegenLast LegendValue = "last" )
type Metric ¶
type Metric struct {
bun.BaseModel `bun:"metrics,alias:m"`
ID uint64 `json:"id,string" bun:",pk,autoincrement"`
ProjectID uint32 `json:"projectId"`
Name string `json:"name"`
Description string `json:"description"`
Instrument Instrument `json:"instrument"`
Unit string `json:"unit" bun:",nullzero"`
AttrKeys []string `json:"attrKeys" bun:",array"`
OtelLibraryName string `json:"otelLibraryName" bun:",nullzero"`
OtelLibraryVersion string `json:"otelLibraryVersion" bun:",nullzero"`
CreatedAt time.Time `json:"createdAt" bun:",nullzero"`
UpdatedAt time.Time `json:"updatedAt" bun:",nullzero"`
// Payload
NumTimeseries uint64 `json:"numTimeseries" bun:",scanonly"`
}
func SelectMetric ¶
type MetricColumn ¶
type MetricColumn struct {
Unit string `json:"unit" yaml:"unit,omitempty"`
Color string `json:"color" yaml:"color,omitempty"`
}
func (*MetricColumn) Validate ¶
func (c *MetricColumn) Validate() error
type MetricFilter ¶
type MetricFilter struct {
org.TimeFilter
ProjectID uint32
AttrKey []string
Instrument []string
OtelLibraryName []string
SearchInput string
Query string
}
func (*MetricFilter) UnmarshalValues ¶
type MetricHandler ¶
func NewMetricHandler ¶
func NewMetricHandler(app *bunapp.App) *MetricHandler
func (*MetricHandler) Describe ¶
func (h *MetricHandler) Describe(w http.ResponseWriter, req bunrouter.Request) error
func (*MetricHandler) List ¶
func (h *MetricHandler) List(w http.ResponseWriter, req bunrouter.Request) error
func (*MetricHandler) Stats ¶
func (h *MetricHandler) Stats(w http.ResponseWriter, req bunrouter.Request) error
type MetricMatcher ¶ added in v1.7.0
type MetricMonitorTpl ¶ added in v1.6.2
type MetricMonitorTpl struct {
BaseMonitorTpl `yaml:",inline"`
Metrics []string `yaml:"metrics"`
Query []string `yaml:"query"`
Column string `yaml:"column"`
ColumnUnit string `yaml:"column_unit,omitempty"`
MinAllowedValue bunutil.NullFloat64 `yaml:"min_allowed_value,omitempty"`
MaxAllowedValue bunutil.NullFloat64 `yaml:"max_allowed_value,omitempty"`
CheckNumPoint int `yaml:"check_num_point"`
TimeOffset unixtime.Millis `yaml:"time_offset,omitempty"`
}
func NewMetricMonitorTpl ¶ added in v1.6.2
func NewMetricMonitorTpl(monitor *org.MetricMonitor) *MetricMonitorTpl
func (*MetricMonitorTpl) Populate ¶ added in v1.6.2
func (tpl *MetricMonitorTpl) Populate(monitor *org.MetricMonitor) error
type MetricsServiceServer ¶
type MetricsServiceServer struct {
collectormetricspb.UnimplementedMetricsServiceServer
*bunapp.App
// contains filtered or unexported fields
}
func NewMetricsServiceServer ¶
func NewMetricsServiceServer(app *bunapp.App, mp *DatapointProcessor) *MetricsServiceServer
func (*MetricsServiceServer) Export ¶
func (s *MetricsServiceServer) Export( ctx context.Context, req *collectormetricspb.ExportMetricsServiceRequest, ) (*collectormetricspb.ExportMetricsServiceResponse, error)
func (*MetricsServiceServer) ExportHTTP ¶
func (s *MetricsServiceServer) ExportHTTP(w http.ResponseWriter, req bunrouter.Request) error
type Middleware ¶
type Middleware struct {
*org.Middleware
App *bunapp.App
}
func NewMiddleware ¶
func NewMiddleware(app *bunapp.App) Middleware
func (Middleware) Dashboard ¶
func (m Middleware) Dashboard(next bunrouter.HandlerFunc) bunrouter.HandlerFunc
type MonitorTpl ¶
type MonitorTpl struct {
Value any // *MetricMonitorTpl | *ErrorMonitorTpl
}
func NewMonitorTpl ¶ added in v1.6.2
func NewMonitorTpl(monitor org.Monitor) *MonitorTpl
func (*MonitorTpl) MarshalYAML ¶ added in v1.6.2
func (tpl *MonitorTpl) MarshalYAML() (interface{}, error)
func (*MonitorTpl) UnmarshalYAML ¶ added in v1.6.2
func (tpl *MonitorTpl) UnmarshalYAML(node *yaml.Node) error
type NumberPoint ¶
func NewDoublePoint ¶
func NewDoublePoint(n float64) *NumberPoint
func NewIntPoint ¶
func NewIntPoint(n int64) *NumberPoint
type PromDatapoint ¶
type PrometheusHandler ¶
func NewPrometheusHandler ¶
func NewPrometheusHandler(app *bunapp.App, mp *DatapointProcessor) *PrometheusHandler
func (*PrometheusHandler) Read ¶
func (h *PrometheusHandler) Read( w http.ResponseWriter, req bunrouter.Request, ) error
func (*PrometheusHandler) Write ¶
func (h *PrometheusHandler) Write( w http.ResponseWriter, req bunrouter.Request, ) error
type QueryFilter ¶
type QueryFilter struct {
org.TimeFilter
org.OrderByMixin
urlstruct.Pager
Project *org.Project `urlstruct:"-"`
Metric []string
Alias []string
Query string
Search string
TableAgg map[string]string
// contains filtered or unexported fields
}
func (*QueryFilter) Clone ¶
func (f *QueryFilter) Clone() *QueryFilter
func (*QueryFilter) UnmarshalValues ¶
type QueryHandler ¶
func NewQueryHandler ¶
func NewQueryHandler(app *bunapp.App) *QueryHandler
func (*QueryHandler) Gauge ¶
func (h *QueryHandler) Gauge(w http.ResponseWriter, req bunrouter.Request) error
func (*QueryHandler) Heatmap ¶
func (h *QueryHandler) Heatmap(w http.ResponseWriter, req bunrouter.Request) error
func (*QueryHandler) Table ¶
func (h *QueryHandler) Table(w http.ResponseWriter, req bunrouter.Request) error
func (*QueryHandler) Timeseries ¶
func (h *QueryHandler) Timeseries(w http.ResponseWriter, req bunrouter.Request) error
type TableColumn ¶
type TableColumn struct {
MetricColumn `yaml:",inline"`
AggFunc string `json:"aggFunc" yaml:"agg_func,omitempty"`
SparklineDisabled bool `json:"sparklineDisabled" yaml:"sparkline_disabled,omitempty"`
}
func (*TableColumn) Validate ¶
func (c *TableColumn) Validate() error
type TableGridItem ¶
type TableGridItem struct {
*BaseGridItem `bun:",inherit"`
Params TableGridItemParams `json:"params"`
}
func NewTableGridItem ¶
func NewTableGridItem() *TableGridItem
func (*TableGridItem) Base ¶
func (c *TableGridItem) Base() *BaseGridItem
func (*TableGridItem) Metrics ¶
func (item *TableGridItem) Metrics() []string
func (*TableGridItem) Validate ¶
func (item *TableGridItem) Validate() error
type TableGridItemParams ¶
type TableGridItemParams struct {
Metrics []mql.MetricAlias `json:"metrics"`
Query string `json:"query"`
ColumnMap map[string]*MetricColumn `json:"columnMap"`
ItemsPerPage int `json:"itemsPerPage"`
DenseTable bool `json:"denseTable"`
}
type TableGridItemTpl ¶
type TableGridItemTpl struct {
BaseGridItemTpl `yaml:",inline"`
Metrics []string `yaml:"metrics"`
Query []string `yaml:"query"`
Columns map[string]*MetricColumn `yaml:"columns,omitempty"`
}
func NewTableGridItemTpl ¶
func NewTableGridItemTpl(item *TableGridItem) *TableGridItemTpl
func (*TableGridItemTpl) Populate ¶
func (tpl *TableGridItemTpl) Populate(item *TableGridItem) error
type Timeseries ¶
type TimeseriesStyle ¶
Source Files
¶
- attr_handler.go
- cloudwatch_handler.go
- const.go
- cumtodelta.go
- dash_filter.go
- dash_handler.go
- dash_syncer.go
- dash_tpl.go
- dashboard.go
- datapoint.go
- datapoint_processor.go
- grid_item.go
- grid_item_handler.go
- grid_row.go
- grid_row_handler.go
- init.go
- metric.go
- metric_handler.go
- otlp.go
- prom_remote_storage.go
- query_filter.go
- query_handler.go
- span_metric.go
- upql_storage.go
- util.go
Click to show internal directories.
Click to hide internal directories.