cloudflare-log-collector

metrics

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

Index

Variables

BuildInfo exposes version and Go runtime metadata.

var BuildInfo = promauto.NewGaugeVec(prometheus.GaugeOpts{
    Name: "cflog_build_info",
    Help: "Build information",
}, []string{"version", "go_version"})

FirewallEventsTotal counts firewall events by action and zone.

var FirewallEventsTotal = promauto.NewCounterVec(prometheus.CounterOpts{
    Name: "cflog_firewall_events_total",
    Help: "Cloudflare firewall events by action",
}, []string{"action", "zone"})

HTTPBytes tracks byte counts by type and zone from the last poll window.

var HTTPBytes = promauto.NewGaugeVec(prometheus.GaugeOpts{
    Name: "cflog_http_bytes",
    Help: "HTTP bytes by type from last poll window",
}, []string{"type", "zone"})

HTTPRequests tracks HTTP request counts from the last poll window.

var HTTPRequests = promauto.NewGaugeVec(prometheus.GaugeOpts{
    Name: "cflog_http_requests",
    Help: "HTTP request counts from last poll window",
}, []string{"method", "status", "country", "zone"})

LastPollTimestamp records the unix timestamp of the last successful poll.

var LastPollTimestamp = promauto.NewGaugeVec(prometheus.GaugeOpts{
    Name: "cflog_last_poll_timestamp",
    Help: "Unix timestamp of last successful poll",
}, []string{"dataset", "zone"})

LokiPushDuration tracks Loki push latency.

var LokiPushDuration = promauto.NewHistogram(prometheus.HistogramOpts{
    Name:    "cflog_loki_push_duration_seconds",
    Help:    "Loki push latency in seconds",
    Buckets: prometheus.DefBuckets,
})

LokiPushTotal counts Loki push attempts by status.

var LokiPushTotal = promauto.NewCounterVec(prometheus.CounterOpts{
    Name: "cflog_loki_push_total",
    Help: "Total Loki push attempts",
}, []string{"status"})

PollDuration tracks poll latency by dataset and zone.

var PollDuration = promauto.NewHistogramVec(prometheus.HistogramOpts{
    Name:    "cflog_poll_duration_seconds",
    Help:    "Cloudflare API poll latency in seconds",
    Buckets: prometheus.DefBuckets,
}, []string{"dataset", "zone"})

PollTotal counts poll attempts by dataset, zone, and status.

var PollTotal = promauto.NewCounterVec(prometheus.CounterOpts{
    Name: "cflog_poll_total",
    Help: "Total Cloudflare API poll attempts",
}, []string{"dataset", "zone", "status"})

Generated by gomarkdoc