@@ -11,27 +11,27 @@ func AddMetrics() map[string]*prometheus.Desc {
1111 APIMetrics ["Stars" ] = prometheus .NewDesc (
1212 prometheus .BuildFQName ("github" , "repo" , "stars" ),
1313 "Total number of Stars for given repository" ,
14- []string {"repo" , "user" , "private" }, nil ,
14+ []string {"repo" , "user" , "private" , "fork" , "archived" , "license" , "language" }, nil ,
1515 )
1616 APIMetrics ["OpenIssues" ] = prometheus .NewDesc (
1717 prometheus .BuildFQName ("github" , "repo" , "open_issues" ),
1818 "Total number of open issues for given repository" ,
19- []string {"repo" , "user" , "private" }, nil ,
19+ []string {"repo" , "user" , "private" , "fork" , "archived" , "license" , "language" }, nil ,
2020 )
2121 APIMetrics ["Watchers" ] = prometheus .NewDesc (
2222 prometheus .BuildFQName ("github" , "repo" , "watchers" ),
2323 "Total number of watchers/subscribers for given repository" ,
24- []string {"repo" , "user" , "private" }, nil ,
24+ []string {"repo" , "user" , "private" , "fork" , "archived" , "license" , "language" }, nil ,
2525 )
2626 APIMetrics ["Forks" ] = prometheus .NewDesc (
2727 prometheus .BuildFQName ("github" , "repo" , "forks" ),
2828 "Total number of forks for given repository" ,
29- []string {"repo" , "user" , "private" }, nil ,
29+ []string {"repo" , "user" , "private" , "fork" , "archived" , "license" , "language" }, nil ,
3030 )
3131 APIMetrics ["Size" ] = prometheus .NewDesc (
3232 prometheus .BuildFQName ("github" , "repo" , "size_kb" ),
3333 "Size in KB for given repository" ,
34- []string {"repo" , "user" , "private" }, nil ,
34+ []string {"repo" , "user" , "private" , "fork" , "archived" , "license" , "language" }, nil ,
3535 )
3636 APIMetrics ["Limit" ] = prometheus .NewDesc (
3737 prometheus .BuildFQName ("github" , "rate" , "limit" ),
@@ -57,11 +57,11 @@ func (e *Exporter) processMetrics(data []*Datum, rates *RateLimits, ch chan<- pr
5757
5858 // APIMetrics - range through the data slice
5959 for _ , x := range data {
60- ch <- prometheus .MustNewConstMetric (e .APIMetrics ["Stars" ], prometheus .GaugeValue , x .Stars , x .Name , x .Owner .Login , strconv .FormatBool (x .Private ))
61- ch <- prometheus .MustNewConstMetric (e .APIMetrics ["Forks" ], prometheus .GaugeValue , x .Forks , x .Name , x .Owner .Login , strconv .FormatBool (x .Private ))
62- ch <- prometheus .MustNewConstMetric (e .APIMetrics ["OpenIssues" ], prometheus .GaugeValue , x .OpenIssues , x .Name , x .Owner .Login , strconv .FormatBool (x .Private ))
63- ch <- prometheus .MustNewConstMetric (e .APIMetrics ["Watchers" ], prometheus .GaugeValue , x .Watchers , x .Name , x .Owner .Login , strconv .FormatBool (x .Private ))
64- ch <- prometheus .MustNewConstMetric (e .APIMetrics ["Size" ], prometheus .GaugeValue , x .Size , x .Name , x .Owner .Login , strconv .FormatBool (x .Private ))
60+ ch <- prometheus .MustNewConstMetric (e .APIMetrics ["Stars" ], prometheus .GaugeValue , x .Stars , x .Name , x .Owner .Login , strconv .FormatBool (x .Private ), strconv . FormatBool ( x . Fork ), strconv . FormatBool ( x . Archived ), x . License . Key , x . Language )
61+ ch <- prometheus .MustNewConstMetric (e .APIMetrics ["Forks" ], prometheus .GaugeValue , x .Forks , x .Name , x .Owner .Login , strconv .FormatBool (x .Private ), strconv . FormatBool ( x . Fork ), strconv . FormatBool ( x . Archived ), x . License . Key , x . Language )
62+ ch <- prometheus .MustNewConstMetric (e .APIMetrics ["OpenIssues" ], prometheus .GaugeValue , x .OpenIssues , x .Name , x .Owner .Login , strconv .FormatBool (x .Private ), strconv . FormatBool ( x . Fork ), strconv . FormatBool ( x . Archived ), x . License . Key , x . Language )
63+ ch <- prometheus .MustNewConstMetric (e .APIMetrics ["Watchers" ], prometheus .GaugeValue , x .Watchers , x .Name , x .Owner .Login , strconv .FormatBool (x .Private ), strconv . FormatBool ( x . Fork ), strconv . FormatBool ( x . Archived ), x . License . Key , x . Language )
64+ ch <- prometheus .MustNewConstMetric (e .APIMetrics ["Size" ], prometheus .GaugeValue , x .Size , x .Name , x .Owner .Login , strconv .FormatBool (x .Private ), strconv . FormatBool ( x . Fork ), strconv . FormatBool ( x . Archived ), x . License . Key , x . Language )
6565
6666 }
6767
0 commit comments