Skip to content

Add validate command for alloy config #3315

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
kalleep opened this issue Apr 14, 2025 · 0 comments
Open

Add validate command for alloy config #3315

kalleep opened this issue Apr 14, 2025 · 0 comments
Assignees
Labels
proposal A proposal for new functionality.

Comments

@kalleep
Copy link
Contributor

kalleep commented Apr 14, 2025

Background

Currently there is no way to perform any sort of validation of alloy config files like agent have.

They only way to perform any sort of validation is to either deploy config and check logs or try to run alloy locally with the config.

Proposal

Add a validate command to alloy. This command should:

  1. Parse config and report any syntax errors.
  2. Check if components exists and can be used with proper flags (stability and community components enabled).
  3. Perform some sort of type checking of arguments.

The first two are pretty simple and already implemented in #3220.
The third point is most likely going to be pretty tricky. We cannot really reuse the runtime flow because this will have side effect, like expanding environment variables. Instead I think we want to perform type checking and some type inference e.g. we infer that sys.env("VARIABLE") returns a string. This will have some limitations and cannot catch all possible errors but we can work towards making this as robust a possible.

I prefer to split this work over several pr:s because I will need to experiment a lot on point 3 and we can get some value of the easy parts faster.

Other things to explore is how we can expose this for external use like fleet management

@kalleep kalleep added the proposal A proposal for new functionality. label Apr 14, 2025
@thampiotr thampiotr moved this from Incoming to Likely Accept in Alloy proposals Apr 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
proposal A proposal for new functionality.
Projects
Status: Likely Accept
Development

No branches or pull requests

1 participant