mirror of
https://github.com/NotAShelf/watchdog.git
synced 2026-03-07 05:46:00 +00:00
watchdog: migrate to Cobra and Viper for config management; search /etc for configs
Signed-off-by: NotAShelf <raf@notashelf.dev> Change-Id: I65dbf466cb030dccc7025585d6282bd26a6a6964
This commit is contained in:
parent
951ed9c36f
commit
f988174145
9 changed files with 187 additions and 61 deletions
|
|
@ -15,7 +15,7 @@ var prometheusLabelPattern = regexp.MustCompile(`^[a-zA-Z0-9_/:.-]*$`)
|
|||
type MetricsAggregator struct {
|
||||
pathRegistry *PathRegistry
|
||||
eventRegistry *CustomEventRegistry
|
||||
cfg config.Config
|
||||
cfg *config.Config
|
||||
pageviews *prometheus.CounterVec
|
||||
customEvents *prometheus.CounterVec
|
||||
pathOverflow prometheus.Counter
|
||||
|
|
@ -30,7 +30,7 @@ type MetricsAggregator struct {
|
|||
func NewMetricsAggregator(
|
||||
pathRegistry *PathRegistry,
|
||||
eventRegistry *CustomEventRegistry,
|
||||
cfg config.Config,
|
||||
cfg *config.Config,
|
||||
) *MetricsAggregator {
|
||||
// Build label names based on what's enabled in config
|
||||
labels := []string{"path"} // path is always included
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue