Add token-based authentication for receiver
All checks were successful
ci / build (push) Successful in 28s
All checks were successful
ci / build (push) Successful in 28s
This commit is contained in:
parent
042ce77ddc
commit
aa3e8cddf9
10 changed files with 635 additions and 41 deletions
|
|
@ -31,6 +31,7 @@ func main() {
|
|||
logFormat := flag.String("log-format", defaultLogFormat, "Output format: json, text")
|
||||
topN := flag.Int("top", defaultTopN, "Number of top processes to include")
|
||||
pushEndpoint := flag.String("push-endpoint", "", "HTTP endpoint to push metrics to (e.g., http://localhost:8080/api/v1/metrics)")
|
||||
pushToken := flag.String("push-token", os.Getenv("COLLECTOR_PUSH_TOKEN"), "Bearer token for push endpoint authentication (or set COLLECTOR_PUSH_TOKEN)")
|
||||
flag.Parse()
|
||||
|
||||
// Setup structured logging for application logs
|
||||
|
|
@ -61,7 +62,7 @@ func main() {
|
|||
|
||||
// Setup push client if endpoint is configured
|
||||
if *pushEndpoint != "" {
|
||||
pushClient := summary.NewPushClient(*pushEndpoint)
|
||||
pushClient := summary.NewPushClient(*pushEndpoint, *pushToken)
|
||||
c.SetPushClient(pushClient)
|
||||
execCtx := pushClient.ExecutionContext()
|
||||
appLogger.Info("push client configured",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue