Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type JobsMap ¶
JobsMap maps from a job instance to a map of timeseries instances for the job.
func NewJobsMap ¶
NewJobsMap creates a new (empty) JobsMap.
type MetadataCache ¶
type MetadataCache interface { Metadata(metricName string) (scrape.MetricMetadata, bool) }
MetadataCache is an adapter to prometheus' scrape.Target and provide only the functionality which is needed
type MetadataService ¶
type MetadataService interface {
Get(job, instance string) (MetadataCache, error)
}
MetadataService is an adapter to ScrapeManager and provide only the functionality which is needed
type MetricFamily ¶
type MetricFamily interface { Add(metricName string, ls labels.Labels, t int64, v float64) error IsSameFamily(metricName string) bool ToMetric() (*metricspb.Metric, int, int) }
MetricFamily is unit which is corresponding to the metrics items which shared the same TYPE/UNIT/... metadata from a single scrape.
type MetricsAdjuster ¶
type MetricsAdjuster struct {
// contains filtered or unexported fields
}
MetricsAdjuster takes a map from a metric instance to the initial point in the metrics instance and provides AdjustMetrics, which takes a sequence of metrics and adjust their values based on the initial points.
func NewMetricsAdjuster ¶
func NewMetricsAdjuster(tsm *timeseriesMap, logger *zap.Logger) *MetricsAdjuster
NewMetricsAdjuster is a constructor for MetricsAdjuster.
func (*MetricsAdjuster) AdjustMetrics ¶
AdjustMetrics takes a sequence of metrics and adjust their values based on the initial and previous points in the timeseriesMap. If the metric is the first point in the timeseries, or the timeseries has been reset, it is removed from the sequence and added to the timeseriesMap. Additionally returns the total number of timeseries dropped from the metrics.