Skip to content

Commit

Permalink
set version for prometheus to fix grafana exception
Browse files Browse the repository at this point in the history
  • Loading branch information
Hedius committed May 16, 2024
1 parent 2ce86bc commit 5b63bde
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion graphite-clickhouse.go
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ func main() {
})

if cfg.Prometheus.Listen != "" {
if err := prometheus.Run(cfg); err != nil {
if err := prometheus.Run(cfg, Version); err != nil {
log.Fatal(err)
}
}
Expand Down
5 changes: 4 additions & 1 deletion prometheus/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (
"github.com/prometheus/prometheus/web"
)

func Run(config *config.Config) error {
func Run(config *config.Config, version string) error {
zapLogger := &logger{
z: zapwriter.Logger("prometheus"),
}
Expand Down Expand Up @@ -70,6 +70,9 @@ func Run(config *config.Config) error {
PageTitle: config.Prometheus.PageTitle,
LookbackDelta: config.Prometheus.LookbackDelta,
RemoteReadConcurrencyLimit: config.Prometheus.RemoteReadConcurrencyLimit,
Version: &web.PrometheusVersion{
Version: version,
},
})

promHandler.ApplyConfig(&promConfig.Config{})
Expand Down

0 comments on commit 5b63bde

Please sign in to comment.