Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
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 Config ¶
type Config struct { APIToken string ZoneID string Labels model.LabelSet Workers int PullRange model.Duration FieldsType string AdditionalFields []string }
Config defines how to connect to Cloudflare's Logpull API.
type FieldsType ¶
type FieldsType string
FieldsType defines the set of fields to fetch alongside logs.
const ( FieldsTypeDefault FieldsType = "default" FieldsTypeMinimal FieldsType = "minimal" FieldsTypeExtended FieldsType = "extended" FieldsTypeAll FieldsType = "all" FieldsTypeCustom FieldsType = "custom" )
Valid FieldsType values.
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
}
Target enables pulling HTTP log messages from Cloudflare using the Logpull API.
func NewTarget ¶
func NewTarget(metrics *Metrics, logger log.Logger, handler loki.EntryHandler, position positions.Positions, config *Config) (*Target, error)
NewTarget creates and runs a Cloudflare target.
Click to show internal directories.
Click to hide internal directories.