Documentation
¶
Index ¶
- func NewTimeSeriesMetrics(descriptor *monitoring.MetricDescriptor, ch chan<- prometheus.Metric, ...) (*timeSeriesMetrics, error)
- type CollectedHistogram
- type CollectedMetric
- type ConstMetric
- type DeltaCounterStore
- type DeltaDistributionStore
- type DescriptorCache
- type HistogramMetric
- type MetricFilter
- type MonitoringCollector
- type MonitoringCollectorOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewTimeSeriesMetrics ¶ added in v0.13.0
func NewTimeSeriesMetrics(descriptor *monitoring.MetricDescriptor, ch chan<- prometheus.Metric, fillMissingLabels bool, deltaCounterStore DeltaCounterStore, deltaDistributionStore DeltaDistributionStore, aggregateDeltas bool) (*timeSeriesMetrics, error)
Types ¶
type CollectedHistogram ¶ added in v0.13.0
type CollectedHistogram struct {
// contains filtered or unexported fields
}
type CollectedMetric ¶ added in v0.13.0
type CollectedMetric struct {
// contains filtered or unexported fields
}
type ConstMetric ¶ added in v0.6.0
type ConstMetric struct {
// contains filtered or unexported fields
}
type DeltaCounterStore ¶ added in v0.13.0
type DeltaCounterStore interface {
// Increment will use the incoming metricDescriptor and currentValue to either create a new entry or add the incoming
// value to an existing entry in the underlying store
Increment(metricDescriptor *monitoring.MetricDescriptor, currentValue *ConstMetric)
// ListMetrics will return all known entries in the store for a metricDescriptorName
ListMetrics(metricDescriptorName string) map[string][]*CollectedMetric
}
DeltaCounterStore defines a set of functions which must be implemented in order to be used as a DeltaCounterStore which accumulates DELTA Counter metrics over time
func NewInMemoryDeltaCounterStore ¶ added in v0.13.0
func NewInMemoryDeltaCounterStore(logger log.Logger, ttl time.Duration) DeltaCounterStore
NewInMemoryDeltaCounterStore returns an implementation of DeltaCounterStore which is persisted in-memory
type DeltaDistributionStore ¶ added in v0.13.0
type DeltaDistributionStore interface {
// Increment will use the incoming metricDescriptor and currentValue to either create a new entry or add the incoming
// value to an existing entry in the underlying store
Increment(metricDescriptor *monitoring.MetricDescriptor, currentValue *HistogramMetric)
// ListMetrics will return all known entries in the store for a metricDescriptorName
ListMetrics(metricDescriptorName string) map[string][]*CollectedHistogram
}
DeltaDistributionStore defines a set of functions which must be implemented in order to be used as a DeltaDistributionStore which accumulates DELTA histogram metrics over time
func NewInMemoryDeltaDistributionStore ¶ added in v0.13.0
func NewInMemoryDeltaDistributionStore(logger log.Logger, ttl time.Duration) DeltaDistributionStore
NewInMemoryDeltaDistributionStore returns an implementation of DeltaDistributionStore which is persisted in-memory
type DescriptorCache ¶ added in v0.14.0
type HistogramMetric ¶ added in v0.6.0
type HistogramMetric struct {
// contains filtered or unexported fields
}
type MetricFilter ¶ added in v0.12.0
type MonitoringCollector ¶
type MonitoringCollector struct {
// contains filtered or unexported fields
}
func NewMonitoringCollector ¶
func NewMonitoringCollector(projectID string, monitoringService *monitoring.Service, opts MonitoringCollectorOptions, logger log.Logger, counterStore DeltaCounterStore, distributionStore DeltaDistributionStore) (*MonitoringCollector, error)
func (*MonitoringCollector) Collect ¶
func (c *MonitoringCollector) Collect(ch chan<- prometheus.Metric)
func (*MonitoringCollector) Describe ¶
func (c *MonitoringCollector) Describe(ch chan<- *prometheus.Desc)
type MonitoringCollectorOptions ¶ added in v0.13.0
type MonitoringCollectorOptions struct {
// MetricTypePrefixes are the Google Monitoring (ex-Stackdriver) metric type prefixes that the collector
// will be querying.
MetricTypePrefixes []string
// ExtraFilters is a list of criteria to apply to each corresponding metric prefix query. If one or more are
// applicable to a given metric type prefix, they will be 'AND' concatenated.
ExtraFilters []MetricFilter
// RequestInterval is the time interval used in each request to get metrics. If there are many data points returned
// during this interval, only the latest will be reported.
RequestInterval time.Duration
// RequestOffset is used to offset the requested interval into the past.
RequestOffset time.Duration
// IngestDelay decides if the ingestion delay specified in the metrics metadata is used when calculating the
// request time interval.
IngestDelay bool
// FillMissingLabels decides if metric labels should be added with empty string to prevent failures due to label inconsistency on metrics.
FillMissingLabels bool
// DropDelegatedProjects decides if only metrics matching the collector's projectID should be retrieved.
DropDelegatedProjects bool
// AggregateDeltas decides if DELTA metrics should be treated as a counter using the provided counterStore/distributionStore or a gauge
AggregateDeltas bool
// DescriptorCacheTTL is the TTL on the items in the descriptorCache which caches the MetricDescriptors for a MetricTypePrefix
DescriptorCacheTTL time.Duration
// DescriptorCacheOnlyGoogle decides whether only google specific descriptors should be cached or all
DescriptorCacheOnlyGoogle bool
}
Click to show internal directories.
Click to hide internal directories.