Skip to content

heathcliff26/promremote

Repository files navigation

CI Coverage Status Editorconfig Check Generate go test cover report Renovate

promremote

promremote is a golang API for pushing metrics collected from client_golang to prometheus via remote_write.

Here is an example usage snippet:

rwClient, err := promremote.NewWriteClient(url, reg, promremote.WithBasicAuth(username, password))
if err != nil {
    slog.Error("Failed to create remote write client", "err", err)
    os.Exit(1)
}

slog.Info("Starting remote_write client")
err = rwClient.Run(30 * time.Second)
if err != nil {
    slog.Error("Failed to run remote write client", "err", err)
    os.Exit(1)
}
defer rwClient.Stop()

This creates a new promremote client. It will then collect metrics from the given registry and push them to prometheus periodically.

About

golang api for prometheus remote_write

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors