diff --git a/CHANGELOG.md b/CHANGELOG.md index 7333789..d885ac2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). +## [4.1.0] - 2019-12-30 +### Changed + - Debug logging is now hidden behind the `--debug` flag. + ## [4.0.0] - 2019-07-19 ### Added - Multi query endpoint. You no longer need to run a single instance per NetScaler you want to monitor. The exporter now supports Prometheus targets so only one instance is required. diff --git a/Dockerfile b/Dockerfile index f02c053..e27bc45 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,6 @@ FROM golang:alpine as builder -ENV VERSION="4.0.0" +ENV VERSION="4.1.0" WORKDIR $GOPATH/src/github.com/rokett RUN \ diff --git a/Makefile b/Makefile index e70ea6f..21a4bd5 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ .PHONY: build APP = Citrix-NetScaler-Exporter -VERSION = 4.0.0 +VERSION = 4.1.0 BINARY-LINUX = ${APP}_${VERSION}_Linux_amd64 BUILD_VER = $(shell git rev-parse HEAD) diff --git a/main.go b/main.go index ea4e296..b312556 100644 --- a/main.go +++ b/main.go @@ -18,14 +18,15 @@ import ( ) var ( - app = "Citrix-NetScaler-Exporter" - version string - build string + app = "Citrix-NetScaler-Exporter" + version string + build string username = flag.String("username", "", "Username with which to connect to the NetScaler API") password = flag.String("password", "", "Password with which to connect to the NetScaler API") bindPort = flag.Int("bind_port", 9280, "Port to bind the exporter endpoint to") versionFlg = flag.Bool("version", false, "Display application version") - logger log.Logger + debugFlg = flag.Bool("debug", false, "Enable debug logging?") + logger log.Logger nsInstance string ) @@ -108,7 +109,9 @@ func handler(w http.ResponseWriter, r *http.Request) { nsInstance = strings.TrimLeft(nsInstance, "http://") nsInstance = strings.Trim(nsInstance, " /") - level.Debug(logger).Log("msg", "scraping target", "target", target) + if *debugFlg { + level.Debug(logger).Log("msg", "scraping target", "target", target) + } exporter, err := collector.NewExporter(target, *username, *password, ignoreCertCheck, logger, nsInstance) if err != nil { diff --git a/make.bat b/make.bat index 9ec2657..ca1ba24 100644 --- a/make.bat +++ b/make.bat @@ -2,7 +2,7 @@ SETLOCAL set APP=Citrix-NetScaler-Exporter -set VERSION=4.0.0 +set VERSION=4.1.0 set BINARY-WINDOWS-X64=%APP%_%VERSION%_Windows_amd64.exe set BINARY-LINUX=%APP%_%VERSION%_Linux_amd64