Cloud native log shipping daemon written in Go
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

34 lines
679 B

package main
import (
"context"
"errors"
"fmt"
"log"
"net/http"
"os"
"os/signal"
"git.k-space.ee/k-space/logmower-shipper/pkg/watcher"
"github.com/prometheus/client_golang/prometheus/promhttp"
)
func main() {
go func() {
metricsPort := 8000
log.Printf("serving /metrics on port %d", metricsPort)
http.Handle("/metrics", promhttp.Handler())
if err := http.ListenAndServe(fmt.Sprintf(":%d", metricsPort), nil); !errors.Is(err, http.ErrServerClosed) {
log.Fatalf("serving /metrics: %e", err)
}
}()
ctx, _ := signal.NotifyContext(context.Background(), os.Interrupt)
if err := watcher.App.RunContext(ctx, os.Args); err != nil {
log.Fatal(err)
}
}