From 4f2d8d907901dad5ca83bfff573c5db6565c97cc Mon Sep 17 00:00:00 2001 From: Hector Date: Mon, 18 Oct 2021 19:32:08 +0100 Subject: [PATCH 1/2] refactor: update imports in exporter.go Remove unnecessary name from the textfile import. Remove the sqlite3 dependency which is no longer required. --- src/exporter.go | 7 +++---- src/go.mod | 1 - src/go.sum | 2 -- 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/src/exporter.go b/src/exporter.go index 2468ea0..8adc057 100644 --- a/src/exporter.go +++ b/src/exporter.go @@ -3,12 +3,11 @@ package main import ( "fail2ban-prometheus-exporter/cfg" "fail2ban-prometheus-exporter/collector/f2b" - textfile2 "fail2ban-prometheus-exporter/collector/textfile" + "fail2ban-prometheus-exporter/collector/textfile" "fmt" "log" "net/http" - _ "github.com/mattn/go-sqlite3" "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/client_golang/prometheus/promhttp" ) @@ -44,7 +43,7 @@ func rootHtmlHandler(w http.ResponseWriter, r *http.Request) { } } -func metricHandler(w http.ResponseWriter, r *http.Request, collector *textfile2.Collector) { +func metricHandler(w http.ResponseWriter, r *http.Request, collector *textfile.Collector) { promhttp.Handler().ServeHTTP(w, r) collector.WriteTextFileMetrics(w, r) } @@ -61,7 +60,7 @@ func main() { f2bCollector := f2b.NewExporter(appSettings, version) prometheus.MustRegister(f2bCollector) - textFileCollector := textfile2.NewCollector(appSettings) + textFileCollector := textfile.NewCollector(appSettings) prometheus.MustRegister(textFileCollector) http.HandleFunc("/", rootHtmlHandler) diff --git a/src/go.mod b/src/go.mod index 1e47f44..31db45f 100644 --- a/src/go.mod +++ b/src/go.mod @@ -4,7 +4,6 @@ go 1.15 require ( github.com/kisielk/og-rek v1.1.0 - github.com/mattn/go-sqlite3 v1.14.6 github.com/nlpodyssey/gopickle v0.1.0 github.com/prometheus/client_golang v1.9.0 ) diff --git a/src/go.sum b/src/go.sum index 8f79c52..3200d34 100644 --- a/src/go.sum +++ b/src/go.sum @@ -152,8 +152,6 @@ github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaO github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= -github.com/mattn/go-sqlite3 v1.14.6 h1:dNPt6NO46WmLVt2DLNpwczCmdV5boIZ6g/tlDrlRUbg= -github.com/mattn/go-sqlite3 v1.14.6/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU= github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= From 61a8a58754c5dc47b6b97488c77f56c922096c2d Mon Sep 17 00:00:00 2001 From: Hector Date: Mon, 18 Oct 2021 19:33:59 +0100 Subject: [PATCH 2/2] docs: update changelog for release --- CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7093b08..b491c10 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,10 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog], and this project adheres to [Semantic Versioning]. ## [Unreleased] +*Nothing yet* + +## [0.4.0] - 2021-10-18 +*Add new fail2ban config metrics* ### Added - (56730c8) feat: add new jail config metrics @@ -65,3 +69,4 @@ The format is based on [Keep a Changelog], and this project adheres to [Semantic [0.1.0]: https://gitlab.com/hectorjsmith/fail2ban-prometheus-exporter/compare/0.0.0...0.1.0 [0.2.0]: https://gitlab.com/hectorjsmith/fail2ban-prometheus-exporter/compare/0.1.0...0.2.0 [0.3.0]: https://gitlab.com/hectorjsmith/fail2ban-prometheus-exporter/compare/0.2.0...0.3.0 +[0.4.0]: https://gitlab.com/hectorjsmith/fail2ban-prometheus-exporter/compare/0.3.0...0.4.0