collector

package
v0.0.0-...-6e97fea Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2025 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Metric names
	UpMetric                   = "catchpoint_up"
	TotalTimeMetric            = "catchpoint_total_time"
	ConnectTimeMetric          = "catchpoint_connect_time"
	DNSTimeMetric              = "catchpoint_dns_time"
	ContentLoadTimeMetric      = "catchpoint_content_load_time"
	LoadTimeMetric             = "catchpoint_load_time"
	RedirectTimeMetric         = "catchpoint_redirect_time"
	SSLTimeMetric              = "catchpoint_ssl_time"
	WaitTimeMetric             = "catchpoint_wait_time"
	ClientTimeMetric           = "catchpoint_client_time"
	DocumentCompleteTimeMetric = "catchpoint_document_complete_time"
	RenderStartTimeMetric      = "catchpoint_render_start_time"
	ResponseContentSizeMetric  = "catchpoint_response_content_size"
	ResponseHeadersSizeMetric  = "catchpoint_response_headers_size"
	TotalContentSizeMetric     = "catchpoint_total_content_size"
	TotalHeadersSizeMetric     = "catchpoint_total_headers_size"
	AnyErrorMetric             = "catchpoint_any_error"
	ConnectionErrorMetric      = "catchpoint_connection_error"
	DNSErrorMetric             = "catchpoint_dns_error"
	LoadErrorMetric            = "catchpoint_load_error"
	TimeoutErrorMetric         = "catchpoint_timeout_error"
	TransactionErrorMetric     = "catchpoint_transaction_error"
	ErrorObjectsLoadedMetric   = "catchpoint_error_objects_loaded"
	ImageContentTypeMetric     = "catchpoint_image_content_type"
	ScriptContentTypeMetric    = "catchpoint_script_content_type"
	HTMLContentTypeMetric      = "catchpoint_html_content_type"
	CSSContentTypeMetric       = "catchpoint_css_content_type"
	FontContentTypeMetric      = "catchpoint_font_content_type"
	MediaContentTypeMetric     = "catchpoint_media_content_type"
	XMLContentTypeMetric       = "catchpoint_xml_content_type"
	OtherContentTypeMetric     = "catchpoint_other_content_type"
	ConnectionsCountMetric     = "catchpoint_connections_count"
	HostsCountMetric           = "catchpoint_hosts_count"
	FailedRequestsCountMetric  = "catchpoint_failed_requests_count"
	RequestsCountMetric        = "catchpoint_requests_count"
	RedirectionsCountMetric    = "catchpoint_redirections_count"
	CachedCountMetric          = "catchpoint_cached_count"
	ImageCountMetric           = "catchpoint_image_count"
	ScriptCountMetric          = "catchpoint_script_count"
	HTMLCountMetric            = "catchpoint_html_count"
	CSSCountMetric             = "catchpoint_css_count"
	FontCountMetric            = "catchpoint_font_count"
	XMLCountMetric             = "catchpoint_xml_count"
	MediaCountMetric           = "catchpoint_media_count"
	TracepointsCountMetric     = "catchpoint_tracepoints_count"

	// Metric descriptions
	UpDesc                   = "Catchpoint exporter is up and running."
	TotalTimeDesc            = "Total time it took to load the webpage in milliseconds."
	ConnectTimeDesc          = "Time taken to connect to the URL in milliseconds."
	DNSTimeDesc              = "Time taken to resolve the domain name in milliseconds."
	ContentLoadTimeDesc      = "Time taken to load content in milliseconds."
	LoadTimeDesc             = "Time taken to load the first and last byte of the primary URL in milliseconds."
	RedirectTimeDesc         = "Time taken for HTTP redirects in milliseconds."
	SSLTimeDesc              = "Time taken to establish SSL handshake in milliseconds."
	WaitTimeDesc             = "Time from successful connection to receiving the first byte in milliseconds."
	ClientTimeDesc           = "Client processing time in milliseconds."
	DocumentCompleteTimeDesc = "Time taken for the browser to fully render the page after all resources are downloaded in milliseconds."
	RenderStartTimeDesc      = "Time taken to start rendering the webpage in milliseconds."
	ResponseContentSizeDesc  = "Size of the HTTP response content in bytes."
	ResponseHeadersSizeDesc  = "Size of the HTTP response headers in bytes."
	TotalContentSizeDesc     = "Total size of the HTTP response content and headers in bytes."
	TotalHeadersSizeDesc     = "Total size of the HTTP response headers in bytes."
	AnyErrorDesc             = "Indicates if any error occurred during the test."
	ConnectionErrorDesc      = "Indicates if a connection error occurred during the test."
	DNSErrorDesc             = "Indicates if a DNS error occurred during the test."
	LoadErrorDesc            = "Indicates if a load error occurred during the test."
	TimeoutErrorDesc         = "Indicates if a timeout error occurred during the test."
	TransactionErrorDesc     = "Indicates if a transaction error occurred during the test."
	ErrorObjectsLoadedDesc   = "Indicates if error objects were loaded during the test."
	ImageContentTypeDesc     = "Size of image content loaded during the test in bytes."
	ScriptContentTypeDesc    = "Size of script content loaded during the test in bytes."
	HTMLContentTypeDesc      = "Size of HTML content loaded during the test in bytes."
	CSSContentTypeDesc       = "Size of CSS content loaded during the test in bytes."
	FontContentTypeDesc      = "Size of font content loaded during the test in bytes."
	MediaContentTypeDesc     = "Size of media content loaded during the test in bytes."
	XMLContentTypeDesc       = "Size of XML content loaded during the test in bytes."
	OtherContentTypeDesc     = "Size of other content loaded during the test in bytes."
	ConnectionsCountDesc     = "Total number of connections made during the test."
	HostsCountDesc           = "Total number of hosts contacted during the test."
	FailedRequestsCountDesc  = "Number of failed requests during the test."
	RequestsCountDesc        = "Number of requests made during the test."
	RedirectionsCountDesc    = "Number of HTTP redirections encountered during the test."
	CachedCountDesc          = "Number of cached elements accessed during the test."
	ImageCountDesc           = "Number of image elements loaded during the test."
	ScriptCountDesc          = "Number of script elements loaded during the test."
	HTMLCountDesc            = "Number of HTML documents loaded during the test."
	CSSCountDesc             = "Number of CSS documents loaded during the test."
	FontCountDesc            = "Number of font resources loaded during the test."
	XMLCountDesc             = "Number of XML documents loaded during the test."
	MediaCountDesc           = "Number of media elements loaded during the test."
	TracepointsCountDesc     = "Number of tracepoints hit during the test."
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Collector

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

func NewCollector

func NewCollector(logger *slog.Logger, cfg *Config) *Collector

func (*Collector) Collect

func (c *Collector) Collect(ch chan<- prometheus.Metric)

func (*Collector) Describe

func (c *Collector) Describe(ch chan<- *prometheus.Desc)

func (*Collector) HandleWebhook

func (c *Collector) HandleWebhook(w http.ResponseWriter, r *http.Request)

type Config

type Config struct {
	VerboseLogging bool
	Port           string
	WebhookPath    string
}

func NewConfig

func NewConfig() *Config

type Response

type Response struct {
	TestDetails TestDetails `json:"TestDetails"`
	Summary     Summary     `json:"Summary"`
}

Response represents the full response structure from the API.

type Summary

type Summary struct {
	Timestamp           string `json:"Timestamp"`
	TotalTime           string `json:"TotalTime"`
	Connect             string `json:"Connect"`
	Dns                 string `json:"Dns"`
	ContentLoad         string `json:"ContentLoad"`
	Load                string `json:"Load"`
	Redirect            string `json:"Redirect"`
	SSL                 string `json:"SSL"`
	Wait                string `json:"Wait"`
	Client              string `json:"Client"`
	DocumentComplete    string `json:"DocumentComplete"`
	RenderStart         string `json:"RenderStart"`
	ResponseContent     string `json:"ResponseContent"`
	ResponseHeaders     string `json:"ResponseHeaders"`
	TotalContent        string `json:"TotalContent"`
	TotalHeaders        string `json:"TotalHeaders"`
	AnyError            string `json:"AnyError"`
	ConnectionError     string `json:"ConnectionError"`
	DNSError            string `json:"DNSError"`
	LoadError           string `json:"LoadError"`
	TimeoutError        string `json:"TimeoutError"`
	TransactionError    string `json:"TransactionError"`
	ErrorObjectsLoaded  string `json:"ErrorObjectsLoaded"`
	ImageContentType    string `json:"ImageContentType"`
	ScriptContentType   string `json:"ScriptContentType"`
	HTMLContentType     string `json:"HTMLContentType"`
	CSSContentType      string `json:"CSSContentType"`
	FontContentType     string `json:"FontContentType"`
	MediaContentType    string `json:"MediaContentType"`
	XMLContentType      string `json:"XMLContentType"`
	OtherContentType    string `json:"OtherContentType"`
	ConnectionsCount    string `json:"ConnectionsCount"`
	HostsCount          string `json:"HostsCount"`
	FailedRequestsCount string `json:"FailedRequestsCount"`
	RequestsCount       string `json:"RequestsCount"`
	RedirectionsCount   string `json:"RedirectionsCount"`
	CachedCount         string `json:"CachedCount"`
	ImageCount          string `json:"ImageCount"`
	ScriptCount         string `json:"ScriptCount"`
	HTMLCount           string `json:"HTMLCount"`
	CSSCount            string `json:"CSSCount"`
	FontCount           string `json:"FontCount"`
	XMLCount            string `json:"XMLCount"`
	MediaCount          string `json:"MediaCount"`
	TracepointsCount    string `json:"TracepointsCount"`
}

Summary represents the 44 aggregated results of a test run.

type TestDetails

type TestDetails struct {
	TestName      string `json:"TestName"`
	TypeId        string `json:"TypeId"`
	MonitorTypeId string `json:"MonitorTypeId"`
	TestId        string `json:"TestId"`
	ReportWindow  string `json:"ReportWindow"`
	NodeId        string `json:"NodeId"`
	NodeName      string `json:"NodeName"`
	Asn           string `json:"Asn"`
	DivisionId    string `json:"DivisionId"`
	ClientId      string `json:"ClientId"`
}

TestDetails represents detailed information about a test run.

Jump to

Keyboard shortcuts

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