Skip to content

Commit

Permalink
Adding Updated label with release timestamp
Browse files Browse the repository at this point in the history
  • Loading branch information
Danny Kulchinsky authored and sstarcher committed Jan 15, 2019
1 parent 4aff6cf commit 1e8e073
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"fmt"
"time"
"flag"
"strconv"
"net/http"

"k8s.io/helm/pkg/helm"
Expand All @@ -25,6 +26,7 @@ var (
"chart",
"release",
"version",
"updated",
"namespace",
})

Expand Down Expand Up @@ -98,11 +100,12 @@ func helmStats() {
status := item.GetInfo().GetStatus().GetCode()
releaseName := item.GetName()
version := item.GetChart().GetMetadata().GetVersion()
updated := strconv.FormatInt(item.GetInfo().GetLastDeployed().Seconds, 10)
namespace := item.GetNamespace()
if status == release.Status_FAILED {
status = -1
}
stats.WithLabelValues(chart, releaseName, version, namespace).Set(float64(status))
stats.WithLabelValues(chart, releaseName, updated, version, namespace).Set(float64(status))
}
}
}
Expand Down

0 comments on commit 1e8e073

Please sign in to comment.