Skip to content

Commit

Permalink
add version umber information
Browse files Browse the repository at this point in the history
  • Loading branch information
oliver006 committed Oct 10, 2015
1 parent e4cf9c9 commit 766ce36
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions redis_exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ var (
namespace = flag.String("namespace", "redis", "Namespace for metrics")
listenAddress = flag.String("web.listen-address", ":9121", "Address to listen on for web interface and telemetry.")
metricPath = flag.String("web.telemetry-path", "/metrics", "Path under which to expose metrics.")
showVersion = flag.Bool("version", false, "Show version information")

VERSION = "0.2"
)

type RedisHost struct {
Expand Down Expand Up @@ -307,6 +310,11 @@ func (e *Exporter) collectMetrics(metrics chan<- prometheus.Metric) {
func main() {
flag.Parse()

if *showVersion {
fmt.Printf("Redis Metrics Exporter v%s\n", VERSION)
return
}

addrs := strings.Split(*redisAddr, ",")
if len(addrs) == 0 || len(addrs[0]) == 0 {
log.Fatal("Invalid parameter --redis.addr")
Expand Down

0 comments on commit 766ce36

Please sign in to comment.