mirror of
https://github.com/thomiceli/opengist.git
synced 2025-07-09 17:38:04 +02:00
feat: add Prometheus metrics (#439)
* feat: add Prometheus metrics * setup metrics using Prometheus client under /metrics endpoint * add configuration value for metrics * configure Prometheus middleware for generic metrics * provide metrics for totals of users, gists and SSH keys * modify test request to optionally return the response * provide integration test for Prometheus metrics * update documentation * chore: make fmt
This commit is contained in:
@ -71,6 +71,8 @@ type config struct {
|
||||
OIDCSecret string `yaml:"oidc.secret" env:"OG_OIDC_SECRET"`
|
||||
OIDCDiscoveryUrl string `yaml:"oidc.discovery-url" env:"OG_OIDC_DISCOVERY_URL"`
|
||||
|
||||
MetricsEnabled bool `yaml:"metrics.enabled" env:"OG_METRICS_ENABLED"`
|
||||
|
||||
CustomName string `yaml:"custom.name" env:"OG_CUSTOM_NAME"`
|
||||
CustomLogo string `yaml:"custom.logo" env:"OG_CUSTOM_LOGO"`
|
||||
CustomFavicon string `yaml:"custom.favicon" env:"OG_CUSTOM_FAVICON"`
|
||||
@ -110,6 +112,8 @@ func configWithDefaults() (*config, error) {
|
||||
c.GiteaUrl = "https://gitea.com"
|
||||
c.GiteaName = "Gitea"
|
||||
|
||||
c.MetricsEnabled = false
|
||||
|
||||
return c, nil
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user