GithubHelp home page GithubHelp logo

Comments (3)

slok avatar slok commented on July 28, 2024 1

Thanks for the explanation! Makes total sense, lets do it then 🚀

from sloth.

slok avatar slok commented on July 28, 2024

Hi @proffalken!

Indeed! This was intended. As you saw, the validation has the discovery of manifests on directories, it only needs to validate and doesn't have an output, so it's safe to do it.

On the other part, the generator needs an output and we can't ask the user where to place the rules, so not allowing to do this was a way of avoiding this complexity (on the code and on the user).

Thinking about it, maybe we could manage something easy for the user with some validations, we could allow the user using a directory as output and use the same names as the input specs for the outputs, what do you think?

from sloth.

proffalken avatar proffalken commented on July 28, 2024

@slok that makes sense, thanks.

FWIW, this is exactly what the bash script I've written to wrap around Sloth does.

We start out with a directory structure similar to the following:

.
└── services
    ├── api
    │   └── response_rate.slo.yaml
    ├── database
    │   └── slow_queries.slo.yaml
    └── vector
        └── log_processing.slo.yaml

and end up with the following after running the script:

.
├── prom_alerts
│   └── services
│       ├── api
│       │   └── response_rate.slo.yaml
│       ├── database
│       │   └── slow_queries.slo.yaml
│       └── vector
│           └── log_processing.slo.yaml
└── services
    ├── api
    │   └── response_rate.slo.yaml
    ├── database
    │   └── slow_queries.slo.yaml
    └── vector
        └── log_processing.slo.yaml

where prom_alerts contains the Sloth output. We then use cortextool to upload these prometheus alert rules to Grafana cloud in the next step of our CI pipeline, but we never commit the output from Sloth to Git so we can be confident we're always generating new values.

The ability to pass it an --input-dir and --output-dir when running sloth generate would be awesome, but we have a workaround for now :)

from sloth.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.