router

package
v6.0.0-ga.4.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2023 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	CounterSampleTotal = prometheus.NewCounterVec(prometheus.CounterOpts{
		Namespace: "n9e",
		Subsystem: "pushgw",
		Name:      "samples_received_total",
		Help:      "Total number samples received.",
	}, []string{"channel"})
)

Functions

func DecodeWriteRequest

func DecodeWriteRequest(r io.Reader) (*prompb.WriteRequest, error)

DecodeWriteRequest from an io.Reader into a prompb.WriteRequest, handling snappy decompression.

Types

type DatadogMetric

type DatadogMetric struct {
	Metric string         `json:"metric"`
	Points []DatadogPoint `json:"points"`
	Host   string         `json:"host"`
	Tags   []string       `json:"tags,omitempty"`
}

func (*DatadogMetric) Clean

func (m *DatadogMetric) Clean() error

func (DatadogMetric) MarshalEasyJSON

func (v DatadogMetric) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (DatadogMetric) MarshalJSON

func (v DatadogMetric) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*DatadogMetric) ToProm

func (m *DatadogMetric) ToProm() (*prompb.TimeSeries, string, error)

func (*DatadogMetric) UnmarshalEasyJSON

func (v *DatadogMetric) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*DatadogMetric) UnmarshalJSON

func (v *DatadogMetric) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type DatadogPoint

type DatadogPoint [2]float64

func (DatadogPoint) MarshalEasyJSON

func (v DatadogPoint) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (DatadogPoint) MarshalJSON

func (v DatadogPoint) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*DatadogPoint) UnmarshalEasyJSON

func (v *DatadogPoint) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*DatadogPoint) UnmarshalJSON

func (v *DatadogPoint) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type EnrichLabelsFunc

type EnrichLabelsFunc func(pt *prompb.TimeSeries)

type FalconMetric

type FalconMetric struct {
	Metric       string      `json:"metric"`
	Endpoint     string      `json:"endpoint"`
	Timestamp    int64       `json:"timestamp"`
	ValueUnTyped interface{} `json:"value"`
	Value        float64     `json:"-"`
	Tags         string      `json:"tags"`
}

func (*FalconMetric) Clean

func (m *FalconMetric) Clean(ts int64) error

func (FalconMetric) MarshalEasyJSON

func (v FalconMetric) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (FalconMetric) MarshalJSON

func (v FalconMetric) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*FalconMetric) ToProm

func (m *FalconMetric) ToProm() (*prompb.TimeSeries, string, error)

func (*FalconMetric) UnmarshalEasyJSON

func (v *FalconMetric) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*FalconMetric) UnmarshalJSON

func (v *FalconMetric) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type FalconMetricArr

type FalconMetricArr []FalconMetric

func (FalconMetricArr) MarshalEasyJSON

func (v FalconMetricArr) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (FalconMetricArr) MarshalJSON

func (v FalconMetricArr) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*FalconMetricArr) UnmarshalEasyJSON

func (v *FalconMetricArr) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*FalconMetricArr) UnmarshalJSON

func (v *FalconMetricArr) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type HTTPMetric

type HTTPMetric struct {
	Metric       string            `json:"metric"`
	Timestamp    int64             `json:"timestamp"`
	ValueUnTyped interface{}       `json:"value"`
	Value        float64           `json:"-"`
	Tags         map[string]string `json:"tags"`
}

easyjson:json

func (*HTTPMetric) Clean

func (m *HTTPMetric) Clean(ts int64) error

func (HTTPMetric) MarshalEasyJSON

func (v HTTPMetric) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (HTTPMetric) MarshalJSON

func (v HTTPMetric) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*HTTPMetric) ToProm

func (m *HTTPMetric) ToProm() (*prompb.TimeSeries, error)

func (*HTTPMetric) UnmarshalEasyJSON

func (v *HTTPMetric) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*HTTPMetric) UnmarshalJSON

func (v *HTTPMetric) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type HTTPMetricArr

type HTTPMetricArr []HTTPMetric

func (HTTPMetricArr) MarshalEasyJSON

func (v HTTPMetricArr) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (HTTPMetricArr) MarshalJSON

func (v HTTPMetricArr) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*HTTPMetricArr) UnmarshalEasyJSON

func (v *HTTPMetricArr) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*HTTPMetricArr) UnmarshalJSON

func (v *HTTPMetricArr) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type Router

type Router struct {
	HTTP           httpx.Config
	Pushgw         pconf.Pushgw
	TargetCache    *memsto.TargetCacheType
	BusiGroupCache *memsto.BusiGroupCacheType
	IdentSet       *idents.Set
	Writers        *writer.WritersType
	Ctx            *ctx.Context
	EnrichLabels   EnrichLabelsFunc
}

func New

func New(httpConfig httpx.Config, pushgw pconf.Pushgw, tc *memsto.TargetCacheType, bg *memsto.BusiGroupCacheType, idents *idents.Set, writers *writer.WritersType, ctx *ctx.Context) *Router

func (*Router) AppendLabels

func (rt *Router) AppendLabels(pt *prompb.TimeSeries, target *models.Target, bgCache *memsto.BusiGroupCacheType)

func (*Router) Config

func (rt *Router) Config(r *gin.Engine)

type TimeSeries

type TimeSeries struct {
	Series []*DatadogMetric `json:"series"`
}

func (TimeSeries) MarshalEasyJSON

func (v TimeSeries) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (TimeSeries) MarshalJSON

func (v TimeSeries) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*TimeSeries) UnmarshalEasyJSON

func (v *TimeSeries) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*TimeSeries) UnmarshalJSON

func (v *TimeSeries) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

Jump to

Keyboard shortcuts

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