From c2da403f46fd014e2fe0a180698b3b159a6483e1 Mon Sep 17 00:00:00 2001 From: SuperQ Date: Tue, 29 Oct 2024 08:36:41 +0100 Subject: [PATCH] Release v0.16.0 * [CHANGE] Replace logging with Go slog library #277 Signed-off-by: SuperQ --- .circleci/config.yml | 2 +- .promu.yml | 3 +-- CHANGELOG.md | 4 ++++ VERSION | 2 +- cmd/graphite_exporter/main.go | 32 +++++++++++++++++++------------- 5 files changed, 26 insertions(+), 17 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index fd4f58f..ee9c550 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -5,7 +5,7 @@ executors: # Whenever the Go version is updated here, .promu.yml should also be updated. golang: docker: - - image: cimg/go:1.22 + - image: cimg/go:1.23 jobs: test: executor: golang diff --git a/.promu.yml b/.promu.yml index 22291d6..b2997c1 100644 --- a/.promu.yml +++ b/.promu.yml @@ -1,7 +1,7 @@ go: # Whenever the Go version is updated here, .travis.yml and # .circle/config.yml should also be updated. - version: 1.22 + version: 1.23 repository: path: github.com/prometheus/graphite_exporter build: @@ -10,7 +10,6 @@ build: path: ./cmd/graphite_exporter - name: getool path: ./cmd/getool - flags: -a -tags netgo ldflags: | -X github.com/prometheus/common/version.Version={{.Version}} -X github.com/prometheus/common/version.Revision={{.Revision}} diff --git a/CHANGELOG.md b/CHANGELOG.md index 9d72a0a..707e87c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.16.0 / 2024-10-29 + +* [CHANGE] Replace logging with Go slog library #277 + ## 0.15.2 / 2024-03-22 * [SECURITY] Update Go to 1.22, update dependencies diff --git a/VERSION b/VERSION index 4312e0d..04a373e 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.15.2 +0.16.0 diff --git a/cmd/graphite_exporter/main.go b/cmd/graphite_exporter/main.go index dca5091..282f8e0 100644 --- a/cmd/graphite_exporter/main.go +++ b/cmd/graphite_exporter/main.go @@ -161,20 +161,26 @@ func main() { } }() - http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { - if r.URL.Path != "/" { - http.NotFound(w, r) - return + if *metricsPath != "/" { + landingConfig := web.LandingConfig{ + Name: "Graphite Exporter", + Description: "Prometheus Graphite Exporter", + ExtraHTML: `

Accepting plaintext Graphite samples over TCP and UDP on ` + *graphiteAddress + `

`, + Version: version.Info(), + Links: []web.LandingLinks{ + { + Address: *metricsPath, + Text: "Metrics", + }, + }, } - w.Write([]byte(` - Graphite Exporter - -

Graphite Exporter

-

Accepting plaintext Graphite samples over TCP and UDP on ` + *graphiteAddress + `

-

Metrics

- - `)) - }) + landingPage, err := web.NewLandingPage(landingConfig) + if err != nil { + logger.Error(err.Error()) + os.Exit(1) + } + http.Handle("/", landingPage) + } server := &http.Server{} if err := web.ListenAndServe(server, toolkitFlags, logger); err != nil {