Documentation ¶
Index ¶
Constants ¶
View Source
const (
MetricsSubject = "metrics"
)
nats subjects
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MetricType ¶
type MetricType int
MetricType is prometheus metrics type.
const ( MetricTypeCounter MetricType = iota MetricTypeGauge MetricTypeSummary MetricTypeUntyped MetricTypeHistogrm )
the set of metric types
func (MetricType) String ¶
func (x MetricType) String() string
String returns the string value of MetricType.
func (*MetricType) UnmarshalJSON ¶
func (x *MetricType) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the unmarshaler interface.
type Metrics ¶
type Metrics struct { Name string `json:"name"` Tags map[string]string `json:"tags"` Fields map[string]interface{} `json:"fields"` Timestamp int64 `json:"timestamp"` Type MetricType `json:"type"` }
Metrics is the default influx based metrics.
type Scheduler ¶
type Scheduler struct { Targets platform.ScraperTargetStoreService // Interval is between each metrics gathering event. Interval time.Duration // Timeout is the maxisium time duration allowed by each TCP request Timeout time.Duration // Publisher will send the gather requests and gathered metrics to the queue. Publisher nats.Publisher Logger *zap.Logger // contains filtered or unexported fields }
Scheduler is struct to run scrape jobs.
type Scraper ¶
type Scraper interface {
Gather(ctx context.Context, target platform.ScraperTarget) (ms []Metrics, err error)
}
Scraper gathers metrics from a scraper target.
type StorageHandler ¶
StorageHandler implements nats.Handler interface.
func (*StorageHandler) Process ¶
func (h *StorageHandler) Process(s nats.Subscription, m nats.Message)
Process consumes job queue, and use storage to record.
Click to show internal directories.
Click to hide internal directories.