mirror of
https://codeberg.org/davrot/forgejo.git
synced 2025-05-20 14:00:04 +02:00
Prometheus endpoint (#5256)
* Add prometheus collector and route * dep ensure -add github.com/prometheus/client_golang/prometheus * dep ensure -update github.com/golang/protobuf * add metrics to reserved usernames * add comment head in metrics package * fix style imports * add metrics settings * add bearer token check * mapping metrics configs * fix lint * update config cheat sheet * update conf sample, typo fix
This commit is contained in:
parent
92fb89f6e1
commit
078c404c3b
112 changed files with 24693 additions and 3011 deletions
|
@ -561,6 +561,15 @@ var (
|
|||
TrustedFacets []string
|
||||
}{}
|
||||
|
||||
// Metrics settings
|
||||
Metrics = struct {
|
||||
Enabled bool
|
||||
Token string
|
||||
}{
|
||||
Enabled: false,
|
||||
Token: "",
|
||||
}
|
||||
|
||||
// I18n settings
|
||||
Langs []string
|
||||
Names []string
|
||||
|
@ -1125,6 +1134,8 @@ func NewContext() {
|
|||
log.Fatal(4, "Failed to map Git settings: %v", err)
|
||||
} else if err = Cfg.Section("api").MapTo(&API); err != nil {
|
||||
log.Fatal(4, "Failed to map API settings: %v", err)
|
||||
} else if err = Cfg.Section("metrics").MapTo(&Metrics); err != nil {
|
||||
log.Fatal(4, "Failed to map Metrics settings: %v", err)
|
||||
}
|
||||
|
||||
sec = Cfg.Section("mirror")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue