Skip to content

Commit

Permalink
Merge pull request #1858 from dashpole/changelog_v0.27.4
Browse files Browse the repository at this point in the history
Changelog v0.27.4 and cherry-pick #1830
  • Loading branch information
dashpole authored Jan 9, 2018
2 parents 1f82310 + 6842d38 commit 492322b
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

### 0.27.4 (2018-01-09)
- Add timeout to docker API Calls
- Fix inconsistent Prometheus labels

### 0.27.3 (2017-11-22)
- Update Jquery and Bootstrap

Expand Down
14 changes: 11 additions & 3 deletions metrics/prometheus.go
Original file line number Diff line number Diff line change
Expand Up @@ -767,11 +767,19 @@ func (c *PrometheusCollector) collectContainersInfo(ch chan<- prometheus.Metric)
glog.Warningf("Couldn't get containers: %s", err)
return
}
rawLabels := map[string]struct{}{}
for _, container := range containers {
labels, values := []string{}, []string{}
for l, v := range c.containerLabelsFunc(container) {
for l := range c.containerLabelsFunc(container) {
rawLabels[l] = struct{}{}
}
}
for _, container := range containers {
values := make([]string, 0, len(rawLabels))
labels := make([]string, 0, len(rawLabels))
containerLabels := c.containerLabelsFunc(container)
for l := range rawLabels {
labels = append(labels, sanitizeLabelName(l))
values = append(values, v)
values = append(values, containerLabels[l])
}

// Container spec
Expand Down

0 comments on commit 492322b

Please sign in to comment.