Skip to content

Commit

Permalink
Add source branch as label for MR info
Browse files Browse the repository at this point in the history
  • Loading branch information
Whyeasy committed Sep 1, 2020
1 parent 2723b15 commit b9121bc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/collector/collector.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ func New(c *client.ExporterClient) *Collector {
client: c,

projectInfo: prometheus.NewDesc("gitlab_project_info", "General information about projects", []string{"project_id", "project_name"}, nil),
mergeRequestInfo: prometheus.NewDesc("gitlab_merge_request_info", "General information about merge requests", []string{"merge_request_id", "target_branch", "state", "merge_request_title", "project_id", "merge_request_internal_id"}, nil),
mergeRequestInfo: prometheus.NewDesc("gitlab_merge_request_info", "General information about merge requests", []string{"merge_request_id", "target_branch", "source_branch", "state", "merge_request_title", "project_id", "merge_request_internal_id"}, nil),

mergeRequestUpdated: prometheus.NewDesc("gitlab_merge_request_updated", "Time since last update on the merge requests that are open", []string{"merge_request_id", "project_id"}, nil),
mergeRequestClosed: prometheus.NewDesc("gitlab_merge_request_closed", "Date of closing the merge request", []string{"merge_request_id", "project_id"}, nil),
Expand Down Expand Up @@ -114,7 +114,7 @@ func collectProjectInfo(c *Collector, ch chan<- prometheus.Metric, stats *client

func collectMergeReqeustInfo(c *Collector, ch chan<- prometheus.Metric, stats *client.Stats) {
for _, mr := range *stats.MergeRequests {
ch <- prometheus.MustNewConstMetric(c.mergeRequestInfo, prometheus.GaugeValue, 1, mr.ID, mr.TargetBranch, mr.State, mr.Title, mr.ProjectID, strconv.Itoa(mr.InternalID))
ch <- prometheus.MustNewConstMetric(c.mergeRequestInfo, prometheus.GaugeValue, 1, mr.ID, mr.TargetBranch, mr.SourceBranch, mr.State, mr.Title, mr.ProjectID, strconv.Itoa(mr.InternalID))
}
}

Expand Down

0 comments on commit b9121bc

Please sign in to comment.