Instance name on process log lines and every metric (closes #91)
check / check (push) Waiting to run

Process log lines carry instance, as request lines do; the instance name
is read before the other settings, so the line saying a setting is
invalid carries it too. Every metric, Go's and the process's included,
carries the label instance, set once on the registry. README.md says so,
and that Prometheus keeps it as exported_instance unless the scrape sets
honor_labels.

Tests that read metrics expect the label. One test helper replaces the
two alert tests' loops that wait for the metrics.

Judgement call: the label is named instance, as in the log lines and
alerts, although Prometheus gives each target a label of that name.

Model: opus-5-5
This commit is contained in:
2026-10-07 04:16:39 +00:00
parent 70a8ea1b92
commit 5ceef3edf3
14 changed files with 232 additions and 120 deletions
+1 -1
View File
@@ -88,7 +88,7 @@ type Server struct {
// applies the timeouts and size limits from then on.
func New(params Params) *Server {
errorLog := slog.NewLogLogger(params.ProcessLog.Handler(), slog.LevelWarn)
m := metrics.New(params.Config.MetricsTopN)
m := metrics.New(params.Config.MetricsTopN, params.Config.InstanceName)
h := &handler{
config: params.Config,
requestLog: params.RequestLog,