You've already forked prometheus-fail2ban-exporter
							
							remove: references to db collector
Remove final references to the deprecated database metric collector. Remove counter for db connection errors. BREAKING CHANGE: Remove `-db` CLI flag.
This commit is contained in:
		@@ -29,9 +29,6 @@ func Parse() *AppSettings {
 | 
			
		||||
	flag.BoolVar(&appSettings.FileCollectorEnabled, "collector.textfile", false, "enable the textfile collector")
 | 
			
		||||
	flag.StringVar(&appSettings.FileCollectorPath, "collector.textfile.directory", "", "directory to read text files with metrics from")
 | 
			
		||||
 | 
			
		||||
	// deprecated: to be removed in next version
 | 
			
		||||
	_ = flag.String("db", "", "path to the fail2ban sqlite database (removed)")
 | 
			
		||||
 | 
			
		||||
	flag.Parse()
 | 
			
		||||
	appSettings.validateFlags()
 | 
			
		||||
	return appSettings
 | 
			
		||||
 
 | 
			
		||||
@@ -11,7 +11,6 @@ type Collector struct {
 | 
			
		||||
	socketPath                 string
 | 
			
		||||
	exporterVersion            string
 | 
			
		||||
	lastError                  error
 | 
			
		||||
	dbErrorCount               int
 | 
			
		||||
	socketConnectionErrorCount int
 | 
			
		||||
	socketRequestErrorCount    int
 | 
			
		||||
}
 | 
			
		||||
@@ -21,7 +20,6 @@ func NewExporter(appSettings *cfg.AppSettings, exporterVersion string) *Collecto
 | 
			
		||||
		socketPath:                 appSettings.Fail2BanSocketPath,
 | 
			
		||||
		exporterVersion:            exporterVersion,
 | 
			
		||||
		lastError:                  nil,
 | 
			
		||||
		dbErrorCount:               0,
 | 
			
		||||
		socketConnectionErrorCount: 0,
 | 
			
		||||
		socketRequestErrorCount:    0,
 | 
			
		||||
	}
 | 
			
		||||
 
 | 
			
		||||
@@ -69,9 +69,6 @@ var (
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
func (c *Collector) collectErrorCountMetric(ch chan<- prometheus.Metric) {
 | 
			
		||||
	ch <- prometheus.MustNewConstMetric(
 | 
			
		||||
		metricErrorCount, prometheus.CounterValue, float64(c.dbErrorCount), "db",
 | 
			
		||||
	)
 | 
			
		||||
	ch <- prometheus.MustNewConstMetric(
 | 
			
		||||
		metricErrorCount, prometheus.CounterValue, float64(c.socketConnectionErrorCount), "socket_conn",
 | 
			
		||||
	)
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user