Documentation ¶
Index ¶
Constants ¶
const RateLimitExceededStatus = "403 rate limit exceeded"
RateLimitExceededStatus is the status response from github when the rate limit is exceeded.
Variables ¶
This section is empty.
Functions ¶
func AddMetrics ¶
func AddMetrics() map[string]*prometheus.Desc
AddMetrics - Add's all of the metrics to a map of strings, returns the map.
Types ¶
type Data ¶
type Data []Datum
Data is used to store an array of Datums. This is useful for the JSON array detection
type Datum ¶
type Datum struct { Name string `json:"name"` Owner struct { Login string `json:"login"` } `json:"owner"` License struct { Key string `json:"key"` } `json:"license"` Language string `json:"language"` Archived bool `json:"archived"` Private bool `json:"private"` Fork bool `json:"fork"` Forks float64 `json:"forks"` Stars float64 `json:"stargazers_count"` OpenIssues float64 `json:"open_issues"` Watchers float64 `json:"subscribers_count"` Size float64 `json:"size"` Releases []Release Pulls []Pull Clones Clones ReferralPaths []ReferralPath ReferralSources []ReferralSource PageViews PageViews }
Datum is used to store data from all the relevant endpoints in the API
type Exporter ¶
type Exporter struct { APIMetrics map[string]*prometheus.Desc config.Config }
Exporter is used to store Metrics data and embeds the config struct. This is done so that the relevant functions have easy access to the user defined runtime configuration when the Collect method is called.
func (*Exporter) Collect ¶
func (e *Exporter) Collect(ch chan<- prometheus.Metric)
Collect function, called on by Prometheus Client library This function is called when a scrape is peformed on the /metrics page
func (*Exporter) Describe ¶
func (e *Exporter) Describe(ch chan<- *prometheus.Desc)
Describe - loops through the API metrics and passes them to prometheus.Describe
type RateLimits ¶
RateLimits is used to store rate limit data into a struct This data is later represented as a metric, captured at the end of a scrape