Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SendRemoteWrite ¶
func SendRemoteWrite(ctx context.Context, cfg *ConfigWrite, gatherer prometheus.Gatherer) error
SendRemoteWrite initializes a http client and sends metrics to a prometheus compatible remote endpoint.
func ToTimeSeriesSlice ¶
func ToTimeSeriesSlice(metricFamilies []*dto.MetricFamily) []prompb.TimeSeries
ToTimeSeriesSlice converts a slice of metricFamilies containing samples into a slice of TimeSeries
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client for the remote write requests.
type Collector ¶ added in v0.6.0
type Collector struct {
// contains filtered or unexported fields
}
func NewCollector ¶ added in v0.6.0
NewCollector returns Prometheus collector that can be registered in registry that handles metric creation and changes, based on the given configuration.
func (*Collector) Collect ¶ added in v0.6.0
func (c *Collector) Collect(metricCh chan<- prometheus.Metric)
func (*Collector) Describe ¶ added in v0.6.0
func (c *Collector) Describe(chan<- *prometheus.Desc)
Describe is used when registering metrics. It's noop avoiding us to have an easier dynamicity. No descriptors allow this collector to be "unchecked", but more efficient with what we try to do here.
func (*Collector) Run ¶ added in v0.6.0
Run creates a set of Prometheus test series that update over time. NOTE: Only one execution of RunMetrics is currently expected.
func (*Collector) UpdateNotifyCh ¶ added in v0.6.0
func (c *Collector) UpdateNotifyCh() chan struct{}
type Config ¶ added in v0.6.0
type Config struct {
GaugeMetricCount, CounterMetricCount, HistogramMetricCount, NativeHistogramMetricCount, SummaryMetricCount int
HistogramBuckets, SummaryObjectives int
LabelCount, SeriesCount int
MaxSeriesCount, MinSeriesCount int
MetricLength, LabelLength int
ValueInterval, SeriesInterval, MetricInterval, SeriesChangeInterval, SeriesChangeRate int
SpikeMultiplier float64
SeriesOperationMode opMode
ConstLabels []string
}
func NewConfigFromFlags ¶ added in v0.6.0
type ConfigWrite ¶
type ConfigWrite struct { URL *url.URL RequestInterval time.Duration BatchSize, RequestCount int UpdateNotify chan struct{} PprofURLs []*url.URL Tenant string TLSClientConfig tls.Config TenantHeader string OutOfOrder bool Concurrency int }
ConfigWrite for the remote write requests.
func NewWriteConfigFromFlags ¶ added in v0.7.0
func NewWriteConfigFromFlags(flagReg func(name, help string) *kingpin.FlagClause) *ConfigWrite
func (*ConfigWrite) Validate ¶ added in v0.7.0
func (c *ConfigWrite) Validate() error