cloudflare-log-collector

collector

import "github.com/afreidah/cloudflare-log-collector/internal/collector"

Index

type CollectorConfig

CollectorConfig holds the shared parameters for constructing a collector.

type CollectorConfig struct {
    CF             *cloudflare.Client
    Loki           *loki.Client
    ZoneID         string
    ZoneName       string
    PollInterval   time.Duration
    BackfillWindow time.Duration
    BatchSize      int
}

type FirewallCollector

FirewallCollector polls Cloudflare for firewall events and ships them to Loki.

type FirewallCollector struct {
    // contains filtered or unexported fields
}

func NewFirewallCollector

func NewFirewallCollector(cfg CollectorConfig) *FirewallCollector

NewFirewallCollector creates a firewall event collector for the given zone with the backfill window applied to the initial poll.

func (*FirewallCollector) Run

func (c *FirewallCollector) Run(ctx context.Context) error

Run starts the polling loop and blocks until ctx is cancelled. Implements the lifecycle.Service interface.

type HTTPCollector

HTTPCollector polls Cloudflare for HTTP traffic stats, updates Prometheus gauges, and ships raw traffic data to Loki.

type HTTPCollector struct {
    // contains filtered or unexported fields
}

func NewHTTPCollector

func NewHTTPCollector(cfg CollectorConfig) *HTTPCollector

NewHTTPCollector creates an HTTP traffic collector for the given zone with the backfill window applied to the initial poll.

func (*HTTPCollector) Run

func (c *HTTPCollector) Run(ctx context.Context) error

Run starts the polling loop and blocks until ctx is cancelled. Implements the lifecycle.Service interface.

Generated by gomarkdoc