Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Fields ¶
func Fields(t FieldsType) ([]string, error)
Types ¶
type Client ¶
type Client interface {
LogpullReceived(ctx context.Context, start, end time.Time) (cloudflare.LogpullReceivedIterator, error)
}
Client is a wrapper around the Cloudflare API that allow for testing and being zone/fields aware.
type FieldsType ¶
type FieldsType string
const ( FieldsTypeDefault FieldsType = "default" FieldsTypeMinimal FieldsType = "minimal" FieldsTypeExtended FieldsType = "extended" FieldsTypeAll FieldsType = "all" )
type Metrics ¶
type Metrics struct { Entries prometheus.Counter LastEnd prometheus.Gauge // contains filtered or unexported fields }
Metrics holds a set of cloudflare metrics.
func NewMetrics ¶
func NewMetrics(reg prometheus.Registerer) *Metrics
NewMetrics creates a new set of cloudflare metrics. If reg is non-nil, the metrics will be registered.
type Target ¶
type Target struct {
// contains filtered or unexported fields
}
func NewTarget ¶
func NewTarget( metrics *Metrics, logger log.Logger, handler api.EntryHandler, position positions.Positions, config *scrapeconfig.CloudflareConfig, ) (*Target, error)
func (*Target) DiscoveredLabels ¶
func (*Target) Type ¶
func (t *Target) Type() target.TargetType
type TargetManager ¶
type TargetManager struct {
// contains filtered or unexported fields
}
TargetManager manages a series of cloudflare targets.
func NewTargetManager ¶
func NewTargetManager( metrics *Metrics, logger log.Logger, positions positions.Positions, pushClient api.EntryHandler, scrapeConfigs []scrapeconfig.Config, ) (*TargetManager, error)
NewTargetManager creates a new cloudflare target managers.
func (*TargetManager) ActiveTargets ¶
func (tm *TargetManager) ActiveTargets() map[string][]target.Target
func (*TargetManager) AllTargets ¶
func (tm *TargetManager) AllTargets() map[string][]target.Target
func (*TargetManager) Ready ¶
func (tm *TargetManager) Ready() bool
Ready returns true if at least one cloudflare target is active.
func (*TargetManager) Stop ¶
func (tm *TargetManager) Stop()
Click to show internal directories.
Click to hide internal directories.