Documentation ¶
Index ¶
- Constants
- func AddMetrics() map[string]*prometheus.Desc
- type AccountInfo
- type Data
- type Datum
- type Exporter
- type Field
- type Issue
- type IssueCounter
- type IssueFilter
- type IssueTypeDescription
- type JQLRequest
- type PostRequest
- type Priority
- type Project
- type ProjectCategoryInfo
- type ProjectInfo
- type RateLimits
- type Response
- type SearchResponse
- type Status
- type StatusCategory
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 AccountInfo ¶
type AccountInfo struct { DisplayName string `json:"displayName"` TimeZone string `json:"timeZone"` AccountId string `json:"accountId"` AccountType string `json:"accountType"` Self string `json:"self"` AvatarURLs map[string]string `json:"avatarUrls"` Active bool `json:"active"` EmailAddrees string `json:"emailAddress"` }
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 {
Issues []Issue
}
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 Field ¶
type Field struct { Summary string `json:"summary"` Status Status `json:"status"` Priority Priority `json:"priority"` IssueType IssueTypeDescription `json:"issuetype"` Project ProjectInfo `json:"project"` Creator AccountInfo `json:"creator"` Assignee AccountInfo `json:"assignee"` Reporter AccountInfo `json:"reporter"` }
type IssueCounter ¶
type IssueCounter struct {
// contains filtered or unexported fields
}
type IssueFilter ¶
type IssueFilter struct {
IssueType string
}
func (IssueFilter) Filter ¶
func (f IssueFilter) Filter(issues []Issue) (ret []Issue)
type IssueTypeDescription ¶
type IssueTypeDescription struct { Self string `json:"self"` Id string `json:"id"` Description string `json:"description"` IconURL string `json:"iconUrl"` Name string `json:"name"` Subtask bool `json:"subtask"` AvatarId int `json:"avatarId"` EntityId string `json:"entityId"` HeirarchyLevel int `json:"hierarchyLevel"` }
Example
"issuetype": { "self": "https://benri.atlassian.net/rest/api/3/issuetype/10007", "id": "10007", "description": "Subtasks track small pieces of work that are part of a larger task.", "iconUrl": "https://benri.atlassian.net/rest/api/2/universal_avatar/view/type/issuetype/avatar/10316?size=medium", "name": "Subtask", "subtask": true, "avatarId": 10316, "entityId": "2c4923b2-0754-499c-ab8e-0d1fefa20d99", "hierarchyLevel": -1 },
type JQLRequest ¶
type PostRequest ¶
type PostRequest struct {
// contains filtered or unexported fields
}
type ProjectCategoryInfo ¶
type ProjectInfo ¶
type ProjectInfo struct { Name string `json:"name"` Self string `json:"self"` ProjectTypeKey string `json:"projectTypeKey"` Simplified bool `json:"simplified"` Key string `json"key` AvatarURLs map[string]string `json:"avatarUrls"` ProjectCategory ProjectCategoryInfo `json:"projectCategory"` Id string `json:"id"` }
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
type Response ¶
type Response struct {
// contains filtered or unexported fields
}
Response struct is used to store http.Response and associated data