Metric implementation

This commit is contained in:
2025-01-04 20:54:36 -05:00
parent 23da46fe07
commit 59b598c6b3
13 changed files with 290 additions and 96 deletions

21
config.go Normal file
View File

@ -0,0 +1,21 @@
package main
import "gitea.libretechconsulting.com/rmcguire/go-app/pkg/config"
// This configuration extends on go-app config.AppConfig,
// setting configuration for the exporter itself
type AmbientLocalExporterConfig struct {
Redis *RedisConfig
*config.AppConfig
}
type RedisConfig struct {
Enabled bool `yaml:"enabled" env:"APP_REDIS_ENABLED" envDefault:"false"`
Addr string `yaml:"addr" env:"APP_REDIS_ADDR"`
ClientName string `yaml:"clientName" env:"APP_REDIS_CLIENT_NAME"`
Protocol int `yaml:"protocol" env:"APP_REDIS_PROTOCOL"`
Username string `yaml:"username" env:"APP_REDIS_USERNAME"`
Password string `yaml:"password" env:"APP_REDIS_PASSWORD"`
DB int `yaml:"db" env:"APP_REDIS_DB"`
MaxRetries int `yaml:"maxRetries" env:"APP_REDIS_MAX_RETRIES"`
}