Documentation ¶
Index ¶
- func MarshalTSOrVectorWriter(ts timeseries.Timeseries, rlo *timeseries.RequestOptions, status int, ...) error
- func MarshalTimeseries(ts timeseries.Timeseries, rlo *timeseries.RequestOptions, status int) ([]byte, error)
- func MarshalTimeseriesWriter(ts timeseries.Timeseries, rlo *timeseries.RequestOptions, status int, ...) error
- func MergeAndWriteAlerts(w http.ResponseWriter, r *http.Request, rgs merge.ResponseGates)
- func MergeAndWriteLabelData(w http.ResponseWriter, r *http.Request, rgs merge.ResponseGates)
- func MergeAndWriteSeries(w http.ResponseWriter, r *http.Request, rgs merge.ResponseGates)
- func MergeAndWriteVector(w http.ResponseWriter, r *http.Request, rgs merge.ResponseGates)
- func NewModeler() *timeseries.Modeler
- func UnmarshalTimeseries(data []byte, trq *timeseries.TimeRangeQuery) (timeseries.Timeseries, error)
- func UnmarshalTimeseriesReader(reader io.Reader, trq *timeseries.TimeRangeQuery) (timeseries.Timeseries, error)
- type Envelope
- type WFAlert
- type WFAlertData
- type WFAlerts
- type WFLabelData
- type WFMatrixData
- type WFMatrixDocument
- type WFResult
- type WFSeries
- type WFSeriesData
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MarshalTSOrVectorWriter ¶
func MarshalTSOrVectorWriter(ts timeseries.Timeseries, rlo *timeseries.RequestOptions, status int, w io.Writer, isVector bool) error
marshalTSOrVectorWriter writes matrix and vector outputs to the provided io.Writer
func MarshalTimeseries ¶
func MarshalTimeseries(ts timeseries.Timeseries, rlo *timeseries.RequestOptions, status int) ([]byte, error)
MarshalTimeseries converts a Timeseries into a JSON blob
func MarshalTimeseriesWriter ¶
func MarshalTimeseriesWriter(ts timeseries.Timeseries, rlo *timeseries.RequestOptions, status int, w io.Writer) error
MarshalTimeseriesWriter converts a Timeseries into a JSON blob via an io.Writer
func MergeAndWriteAlerts ¶
func MergeAndWriteAlerts(w http.ResponseWriter, r *http.Request, rgs merge.ResponseGates)
MergeAndWriteAlerts merges the provided Responses into a single prometheus Alerts data object, and writes it to the provided ResponseWriter
func MergeAndWriteLabelData ¶
func MergeAndWriteLabelData(w http.ResponseWriter, r *http.Request, rgs merge.ResponseGates)
MergeAndWriteLabelData merges the provided Responses into a single prometheus basic data object, and writes it to the provided ResponseWriter
func MergeAndWriteSeries ¶
func MergeAndWriteSeries(w http.ResponseWriter, r *http.Request, rgs merge.ResponseGates)
MergeAndWriteSeries merges the provided Responses into a single prometheus Series data object, and writes it to the provided ResponseWriter
func MergeAndWriteVector ¶
func MergeAndWriteVector(w http.ResponseWriter, r *http.Request, rgs merge.ResponseGates)
MergeAndWriteVector merges the provided Responses into a single prometheus Vector data object, and writes it to the provided ResponseWriter
func NewModeler ¶
func NewModeler() *timeseries.Modeler
NewModeler returns a collection of modeling functions for prometheus interoperability
func UnmarshalTimeseries ¶
func UnmarshalTimeseries(data []byte, trq *timeseries.TimeRangeQuery) (timeseries.Timeseries, error)
UnmarshalTimeseries converts a JSON blob into a Timeseries
func UnmarshalTimeseriesReader ¶
func UnmarshalTimeseriesReader(reader io.Reader, trq *timeseries.TimeRangeQuery) (timeseries.Timeseries, error)
UnmarshalTimeseriesReader converts a JSON blob into a Timeseries via io.Reader
Types ¶
type Envelope ¶
type Envelope struct { Status string `json:"status"` ErrorType string `json:"errorType,omitempty"` Error string `json:"error,omitempty"` Warnings []string `json:"warnings,omitempty"` }
Envelope represents a Proemtheus Response Envelope Root Type
type WFAlert ¶
type WFAlert struct { ActiveAt string `json:"activeAt,omitempty"` Annotations map[string]string `json:"annotations"` Labels map[string]string `json:"labels"` State string `json:"state"` Value string `json:"value,omitempty"` }
WFAlert is the Wire Format Document for the alert object in /alerts responses
func (*WFAlert) CalculateHash ¶
CalculateHash sums the FNV64a hash for the Header and stores it to the Hash member
type WFAlertData ¶
type WFAlertData struct {
Alerts []WFAlert `json:"alerts"`
}
WFAlertData is the Wire Format Document for the alerts list in /alerts responses
type WFAlerts ¶
type WFAlerts struct { *Envelope Data *WFAlertData `json:"data"` }
WFAlerts is the Wire Format Document for the /alerts endpoint
type WFLabelData ¶
WFLabelData is the Wire Format Document for the /labels and /label/<name>/values endpoints and will work for any other response where Data is a string slice
func (*WFLabelData) Merge ¶
func (ld *WFLabelData) Merge(results ...*WFLabelData)
Merge merges the passed WFSeries into the subject WFSeries
type WFMatrixData ¶
type WFMatrixData struct { ResultType string `json:"resultType"` Results []*WFResult `json:"result"` }
WFMatrixData is the data section of the WFD for timeseries responses
type WFMatrixDocument ¶
type WFMatrixDocument struct { *Envelope Data WFMatrixData `json:"data"` }
WFMatrixDocument is the Wire Format Document for prometheus range / timeseries
type WFResult ¶
type WFResult struct { Metric dataset.Tags `json:"metric"` Values [][]interface{} `json:"values"` Value []interface{} `json:"value"` }
WFResult is the Result section of the WFD
type WFSeries ¶
type WFSeries struct { *Envelope Data []WFSeriesData `json:"data"` }
WFSeries is the Wire Format Document for the /series endpoint
type WFSeriesData ¶
type WFSeriesData struct { Name string `json:"__name__"` Instance string `json:"instance"` Job string `json:"job"` }
WFSeriesData describes the wire format document for series data elements