Compare commits

..

2 Commits

Author SHA1 Message Date
277a49a666 chore: update flake inputs
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-09 15:44:18 +01:00
bc02393c5a fix: wait for metrics scrape before restarting after switch deployment
After a successful switch deployment, the listener now waits for Prometheus
to scrape the /metrics endpoint before exiting for restart. This ensures
deployment metrics are captured before the process restarts and resets
in-memory counters. Falls back to a 60 second timeout if no scrape occurs.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-09 15:44:14 +01:00
3 changed files with 5 additions and 5 deletions

View File

@@ -16,7 +16,7 @@ import (
"github.com/urfave/cli/v3" "github.com/urfave/cli/v3"
) )
const version = "0.1.12" const version = "0.1.13"
func main() { func main() {
app := &cli.Command{ app := &cli.Command{

6
flake.lock generated
View File

@@ -2,11 +2,11 @@
"nodes": { "nodes": {
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1770197578, "lastModified": 1770562336,
"narHash": "sha256-AYqlWrX09+HvGs8zM6ebZ1pwUqjkfpnv8mewYwAo+iM=", "narHash": "sha256-ub1gpAONMFsT/GU2hV6ZWJjur8rJ6kKxdm9IlCT0j84=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "00c21e4c93d963c50d4c0c89bfa84ed6e0694df2", "rev": "d6c71932130818840fc8fe9509cf50be8c64634f",
"type": "github" "type": "github"
}, },
"original": { "original": {

View File

@@ -36,7 +36,7 @@ func NewServer(cfg ServerConfig) *Server {
registry := prometheus.NewRegistry() registry := prometheus.NewRegistry()
collector := NewCollector(registry) collector := NewCollector(registry)
scrapeCh := make(chan struct{}, 1) scrapeCh := make(chan struct{})
metricsHandler := promhttp.HandlerFor(registry, promhttp.HandlerOpts{ metricsHandler := promhttp.HandlerFor(registry, promhttp.HandlerOpts{
Registry: registry, Registry: registry,