Skip to content
This repository was archived by the owner on Jul 28, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Main (unreleased)

- [ENHANCEMENT] Allow reloading configuration using `SIGHUP` signal. (@tharun208)

- [FEATURE] Add TLS config options for tempo `remote_write`s. (@mapno)

- [FEATURE] Add support for OTLP HTTP trace exporting. (@mapno)
Expand Down
17 changes: 17 additions & 0 deletions cmd/agent/entrypoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ import (
"fmt"
"net"
"net/http"
"os"
"os/signal"
"sync"
"syscall"

"github.com/gorilla/mux"
"github.com/grafana/agent/pkg/integrations"
Expand Down Expand Up @@ -230,6 +233,14 @@ func (ep *Entrypoint) Start() error {
// signal is received.
signalHandler := signals.NewHandler(ep.cfg.Server.Log)

notifier := make(chan os.Signal)
signal.Notify(notifier, syscall.SIGHUP)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you defer a call to signal.Stop and close(notifier) here?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

addressed


defer func() {
signal.Stop(notifier)
close(notifier)
}()

g.Add(func() error {
signalHandler.Loop()
return nil
Expand All @@ -251,5 +262,11 @@ func (ep *Entrypoint) Start() error {
ep.srv.Close()
})

go func() {
for range notifier {
ep.TriggerReload()
}
}()

return g.Run()
}