Documentation
¶
Index ¶
- func NewGzipReaderWithClose(r io.ReadCloser) (*gzipReaderWithClose, error)
- type ClientOpts
- type LogCollectorOpts
- type MetricsClient
- type MetricsHandlerOpts
- type OtlpMetricsHandlerOpts
- type PrometheusRemoteWriteHandlerOpts
- type ScrapeTarget
- type Scraper
- type ScraperOpts
- type Service
- type ServiceOpts
- type StoreRemoteClient
- type StoreRequestWriter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewGzipReaderWithClose ¶
func NewGzipReaderWithClose(r io.ReadCloser) (*gzipReaderWithClose, error)
NewGzipReaderWithClose creates a new gzipReaderWithClose
Types ¶
type ClientOpts ¶
type ClientOpts struct {
DialTimeout time.Duration
TLSHandshakeTimeout time.Duration
ScrapeTimeOut time.Duration
NodeName string
}
func (ClientOpts) WithDefaults ¶
func (c ClientOpts) WithDefaults() ClientOpts
type LogCollectorOpts ¶
type LogCollectorOpts struct {
Create createFunc
}
type MetricsClient ¶
type MetricsClient struct {
NodeName string
// contains filtered or unexported fields
}
func NewMetricsClient ¶
func NewMetricsClient(opts ClientOpts) (*MetricsClient, error)
func (*MetricsClient) Close ¶
func (c *MetricsClient) Close() error
func (*MetricsClient) FetchMetrics ¶
func (c *MetricsClient) FetchMetrics(target string) (map[string]*prom_model.MetricFamily, error)
func (*MetricsClient) FetchMetricsIterator ¶
func (c *MetricsClient) FetchMetricsIterator(target string) (*prompb.Iterator, error)
type MetricsHandlerOpts ¶
type MetricsHandlerOpts struct {
AddLabels map[string]string
// DropLabels is a map of metric names regexes to label name regexes. When both match, the label will be dropped.
DropLabels map[*regexp.Regexp]*regexp.Regexp
// DropMetrics is a slice of regexes that drops metrics when the metric name matches. The metric name format
// should match the Prometheus naming style before the metric is translated to a Kusto table name.
DropMetrics []*regexp.Regexp
KeepMetrics []*regexp.Regexp
KeepMetricsLabelValues map[*regexp.Regexp]*regexp.Regexp
// DisableMetricsForwarding disables the forwarding of metrics to the remote write endpoint.
DisableMetricsForwarding bool
DefaultDropMetrics bool
RemoteWriteClients []remote.RemoteWriteClient
}
func (MetricsHandlerOpts) RequestTransformer ¶
func (o MetricsHandlerOpts) RequestTransformer() *transform.RequestTransformer
type OtlpMetricsHandlerOpts ¶
type OtlpMetricsHandlerOpts struct {
// Optional. Path is the path where the OTLP/HTTP handler will be registered.
Path string
// Optional. GrpcPort is the port where the metrics OTLP/GRPC handler will listen.
GrpcPort int
MetricOpts MetricsHandlerOpts
}
type PrometheusRemoteWriteHandlerOpts ¶
type PrometheusRemoteWriteHandlerOpts struct {
// Path is the path where the handler will be registered.
Path string
MetricOpts MetricsHandlerOpts
}
type ScrapeTarget ¶
func (ScrapeTarget) Equals ¶
func (t ScrapeTarget) Equals(other ScrapeTarget) bool
func (ScrapeTarget) String ¶
func (t ScrapeTarget) String() string
type Scraper ¶
type Scraper struct {
// contains filtered or unexported fields
}
func NewScraper ¶
func NewScraper(opts *ScraperOpts) *Scraper
func (*Scraper) Targets ¶
func (s *Scraper) Targets() []ScrapeTarget
type ScraperOpts ¶
type ScraperOpts struct {
NodeName string
DefaultDropMetrics bool
// AddLabels is a map of key/value pairs that will be added to all metrics.
AddLabels map[string]string
// DropLabels is a map of metric names regexes to label name regexes. When both match, the label will be dropped.
DropLabels map[*regexp.Regexp]*regexp.Regexp
// DropMetrics is a slice of regexes that drops metrics when the metric name matches. The metric name format
// should match the Prometheus naming style before the metric is translated to a Kusto table name.
DropMetrics []*regexp.Regexp
KeepMetricsWithLabelValue map[*regexp.Regexp]*regexp.Regexp
KeepMetrics []*regexp.Regexp
// Database is the name of the database to write metrics to.
Database string
// ScrapeInterval is the interval at which to scrape metrics from the targets.
ScrapeInterval time.Duration
// ScrapeTimeout is the timeout for scraping metrics from a target.
ScrapeTimeout time.Duration
// DisableMetricsForwarding disables the forwarding of metrics to the remote write endpoint.
DisableMetricsForwarding bool
// DisableDiscovery disables the discovery of scrape targets.
DisableDiscovery bool
PodInformer *k8s.PodInformer
// Targets is a list of static scrape targets.
Targets []ScrapeTarget
// MaxBatchSize is the maximum number of samples to send in a single batch.
MaxBatchSize int
RemoteClients []remote.RemoteWriteClient
}
func (*ScraperOpts) RequestTransformer ¶
func (s *ScraperOpts) RequestTransformer() *transform.RequestTransformer
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func NewService ¶
func NewService(opts *ServiceOpts) (*Service, error)
type ServiceOpts ¶
type ServiceOpts struct {
ListenAddr string
NodeName string
Endpoint string
// LogCollectionHandlers is the list of log collection handlers
LogCollectionHandlers []LogCollectorOpts
// PromMetricsHandlers is the list of prom-remote handlers
PromMetricsHandlers []PrometheusRemoteWriteHandlerOpts
// OtlpMetricsHandlers is the list of oltp metrics handlers
OtlpMetricsHandlers []OtlpMetricsHandlerOpts
// Scraper is the options for the prom scraper
Scraper *ScraperOpts
// Labels to lift to columns
LiftLabels []string
AddAttributes map[string]string
LiftAttributes []string
LiftResources []string
// InsecureSkipVerify skips the verification of the remote write endpoint certificate chain and host name.
InsecureSkipVerify bool
TLSCertFile string
TLSKeyFile string
// MaxBatchSize is the maximum number of samples to send in a single batch.
MaxBatchSize int
// MaxSegmentAge is the maximum time allowed before a segment is rolled over.
MaxSegmentAge time.Duration
// MaxSegmentSize is the maximum size allowed for a segment before it is rolled over.
MaxSegmentSize int64
// MaxDiskUsage is the max size in bytes to use for segment store. If this value is exceeded, writes
// will be rejected until space is freed. A value of 0 means no max usage.
MaxDiskUsage int64
// StorageDir is the directory where the WAL will be stored
StorageDir string
// EnablePprof enables pprof endpoints.
EnablePprof bool
// Region is a location identifier
Region string
MaxConnections int
// WALFlushInterval is the interval at which the WAL segment is flushed to disk. A higher value results in
// better disk IO and less CPU usage but has a greater risk of data loss in the event of a crash. A lower
// value results in more frequent disk IO and higher CPU usage but less data loss in the event of a crash.
// The default is 100ms and the value must be greater than 0.
WALFlushInterval time.Duration
}
type StoreRemoteClient ¶
type StoreRemoteClient struct {
// contains filtered or unexported fields
}
func (*StoreRemoteClient) CloseIdleConnections ¶
func (s *StoreRemoteClient) CloseIdleConnections()
func (*StoreRemoteClient) Write ¶
func (s *StoreRemoteClient) Write(ctx context.Context, wr *prompb.WriteRequest) error
type StoreRequestWriter ¶
type StoreRequestWriter struct {
// contains filtered or unexported fields
}
func (*StoreRequestWriter) CloseIdleConnections ¶
func (s *StoreRequestWriter) CloseIdleConnections()
func (*StoreRequestWriter) Write ¶
func (s *StoreRequestWriter) Write(ctx context.Context, req *prompb.WriteRequest) error
Click to show internal directories.
Click to hide internal directories.