cloudflare / pint

Prometheus rule linter/validator
https://cloudflare.github.io/pint/
Apache License 2.0
879 stars 53 forks source link

[Feature Request] Support using pint as library / embed into other programs #1124

Closed timo-reymann closed 2 months ago

timo-reymann commented 2 months ago

Currently pint is only usable as a command line application, without even a minimal API exposed.

This makes it de-facto impossible to embed it into other go applications. Which is exactly the use case I have.

What do you think about at least offering sth like

package other_tool

import (
  "github.com/cloudflare/pint/cli"
  "os"
)

func main() {
  cli.Run(os.Args)
}

Where cli.Run is basically the same done in cmd/pint/main.go

This would enable embedding pint into other applications for easier integration and distribution.

prymitive commented 2 months ago

pint is a tool we developed to improve health of our internal Prometheus rule deployment. The goal was to have a cli tool and a daemon, we don't have a use case for embedding and so it's a non-goal.