Skip to content

Commit

Permalink
Added redirect for / to metrics endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
fheinecke committed Mar 20, 2024
1 parent 20a8d98 commit 9381d0b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]
### Added
- Added redirect from `/` to metrics endpoint at `/metrics`

## [0.0.10] - 2024-03-19
### Added
Expand Down
1 change: 1 addition & 0 deletions server.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
func RunServer(cfg *CLI) error {
mux := http.NewServeMux()
mux.Handle("GET /metrics", promhttp.Handler())
mux.Handle("GET /", http.RedirectHandler("/metrics", http.StatusPermanentRedirect))
s := http.Server{
Addr: ":8080",
Handler: mux,
Expand Down

0 comments on commit 9381d0b

Please sign in to comment.