Skip to content

Commit

Permalink
Merge pull request #30 from rokett/dev
Browse files Browse the repository at this point in the history
Debug logging is now disabled by default
  • Loading branch information
rokett authored Dec 31, 2019
2 parents a454636 + b0f8911 commit 2d0d806
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 8 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -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 \
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
13 changes: 8 additions & 5 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
Expand Down Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion make.bat
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 2d0d806

Please sign in to comment.