forked from mtusi2026/mtusi2026lab6
feat: add bounded observability and verified SLO incident alerts
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
package config
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/google/uuid"
|
||||
)
|
||||
|
||||
// Worker contains the broker address and a process-unique consumer identity.
|
||||
type Worker struct {
|
||||
// BrokerAddress is a private Valkey Streams endpoint.
|
||||
BrokerAddress string
|
||||
// Consumer is never used as an unbounded metric label.
|
||||
Consumer string
|
||||
}
|
||||
|
||||
// NewWorker requires an explicit broker separate from the admission shards.
|
||||
func NewWorker() (*Worker, error) {
|
||||
address := os.Getenv("BROKER_ADDRESS")
|
||||
if address == "" {
|
||||
return nil, fmt.Errorf("BROKER_ADDRESS is required")
|
||||
}
|
||||
return &Worker{BrokerAddress: address, Consumer: uuid.NewString()}, nil
|
||||
}
|
||||
Reference in New Issue
Block a user