collector

package
v0.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 26, 2024 License: BSD-3-Clause Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Account

type Account struct {
	NetAttacks []AttackHistory `json:"attackHistory"`
	Workers    []Worker        `json:"workers"`
}

type AttackHistory

type AttackHistory struct {
	NetworkDimensions NetworkDimensions `json:"networkDimensions"`
	Sum               SumAttacks        `json:"sum"`
}

type Caching

type Caching struct {
	Dimensions           Dimensions           `json:"dimensions"`
	SumEdgeResponseBytes SumEdgeResponseBytes `json:"sumEdgeResponseBytes"`
}

type ClientHTTPVersionMap

type ClientHTTPVersionMap struct {
	ClientHTTPProtocol string `json:"clientHTTPProtocol"`
	Requests           int    `json:"requests"`
}

type ClientSSLMap

type ClientSSLMap struct {
	ClientSSLProtocol string `json:"clientSSLProtocol"`
	Requests          int    `json:"requests"`
}

type CloudflareCollector

type CloudflareCollector struct {
	API *cloudflare.API
	// contains filtered or unexported fields
}

CloudflareCollector is the structure that stores all the information related to the collector

func New

func New(apiKey, apiMail, AccountID, zoneName, dataset string) *CloudflareCollector

NewCloudflareCollector returns an initialized Collector.

func (*CloudflareCollector) Collect

func (collector *CloudflareCollector) Collect(ch chan<- prometheus.Metric)

Collect fetches the stats from Cloudflare zones and delivers them as Prometheus metrics. It implements prometheus.Collector.

func (*CloudflareCollector) Describe

func (collector *CloudflareCollector) Describe(ch chan<- *prometheus.Desc)

Describe describes all the metrics ever exported by the Cloudflare exporter. It implements prometheus.Collector.

func (*CloudflareCollector) Validate

func (collector *CloudflareCollector) Validate() error

Validate checks the configuration parameters given to the Collector

type ContentTypeMap

type ContentTypeMap struct {
	ContentTypeName string `json:"edgeResponseContentTypeName"`
	Requests        int    `json:"requests"`
	Bytes           int    `json:"bytes"`
}

type CountryMap

type CountryMap struct {
	CountryName string `json:"clientCountryName"`
	Requests    int    `json:"requests"`
	Bytes       int    `json:"bytes"`
	Threats     int    `json:"threats"`
}

type DNSAnalytics

type DNSAnalytics struct {
	Data []struct {
		Dimensions []string  `json:"dimensions"`
		Metrics    []float64 `json:"metrics"`
	} `json:"data"`
	Totals struct {
		QueryCount         int     `json:"queryCount"`
		ResponseTime90Th   int     `json:"responseTime90th"`
		ResponseTime99Th   int     `json:"responseTime99th"`
		ResponseTimeAvg    float64 `json:"responseTimeAvg"`
		ResponseTimeMedian int     `json:"responseTimeMedian"`
		StaleCount         int     `json:"staleCount"`
		UncachedCount      int     `json:"uncachedCount"`
	} `json:"totals"`
}

type DNSAnalyticsResponse

type DNSAnalyticsResponse struct {
	Result DNSAnalytics `json:"result"`
}

type Dimensions

type Dimensions struct {
	CacheStatus     string `json:"cacheStatus"`
	HTTPMethod      string `json:"clientRequestHTTPMethodName"`
	CountryName     string `json:"clientCountryName"`
	ContentTypeName string `json:"edgeResponseContentTypeName"`
}

type FwDimensions

type FwDimensions struct {
	Action  string `json:"action"`
	ASName  string `json:"clientASNDescription"`
	Country string `json:"clientCountryName"`
	RuleID  string `json:"ruleId"`
}

type FwEvent

type FwEvent struct {
	Count      int          `json:"count"`
	Dimensions FwDimensions `json:"dimensions"`
}

type NetworkDimensions

type NetworkDimensions struct {
	AttackID             string `json:"attackId"`
	AttackMitigationType string `json:"attackMitigationType"`
	AttackProtocol       string `json:"attackProtocol"`
	AttackType           string `json:"attackType"`
	ColoCountry          string `json:"coloCountry"`
	DestinationPort      int    `json:"destinationPort"`
}

type Requests

type Requests struct {
	RequestsData RequestsData `json:"requestsData"`
}

type RequestsData

type RequestsData struct {
	Bytes             int `json:"bytes"`
	CachedBytes       int `json:"cachedBytes"`
	EncryptedBytes    int `json:"encryptedBytes"`
	Requests          int `json:"requests"`
	CachedRequests    int `json:"cachedRequests"`
	EncryptedRequests int `json:"encryptedRequests"`

	ResponseStatusMap    []ResponseStatusMap    `json:"responseStatusMap"`
	ClientSSLMap         []ClientSSLMap         `json:"clientSSLMap"`
	ClientHTTPVersionMap []ClientHTTPVersionMap `json:"clientHTTPVersionMap"`
	ContentTypeMap       []ContentTypeMap       `json:"contentTypeMap"`
	CountryMap           []CountryMap           `json:"countryMap"`
}

type RespDataStruct

type RespDataStruct struct {
	Viewer Viewer `json:"viewer"`
}

type ResponseStatusMap

type ResponseStatusMap struct {
	EdgeResponseStatus int `json:"edgeResponseStatus"`
	Requests           int `json:"requests"`
}

type SumAttacks

type SumAttacks struct {
	Bits    int `json:"bits"`
	Packets int `json:"packets"`
}

type SumEdgeResponseBytes

type SumEdgeResponseBytes struct {
	EdgeResponseBytes int `json:"edgeResponseBytes"`
}

type Viewer

type Viewer struct {
	Zones    []Zones   `json:"zones"`
	Accounts []Account `json:"accounts"`
}

type Worker

type Worker struct {
	Info      WorkersInfo      `json:"info"`
	Quantiles WorkersQuantiles `json:"quantiles"`
	Sum       WorkersSum       `json:"sum"`
}

type WorkersInfo

type WorkersInfo struct {
	Name string `json:"scriptName"`
}

type WorkersQuantiles

type WorkersQuantiles struct {
	CpuTimeP50  float64 `json:"cpuTimeP50"`
	CpuTimeP75  float64 `json:"cpuTimeP75"`
	CpuTimeP99  float64 `json:"cpuTimeP99"`
	CpuTimeP999 float64 `json:"cpuTimeP999"`
}

type WorkersSum

type WorkersSum struct {
	Errors      int `json:"errors"`
	Requests    int `json:"requests"`
	SubRequests int `json:"subrequests"`
}

type Zones

type Zones struct {
	Caching  []Caching  `json:"caching"`
	Requests []Requests `json:"requests"`
	FwEvents []FwEvent  `json:"fwEvents"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL