-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Adding JSON schema for configuration file #12083
Comments
FYI, the configuration documentation is partially generated. The source file can be found at |
It looks great, thanks!
|
Hey! I wanted a JSON Schema too. By tweaked the doc-generator, I made one SchemaStore/schemastore#3743. |
For what it's worth, I've written a script to parse the docs page and output Typescript typedefs in case someone else is trying to use Typescript to configure Loki. I'm generating it from the generated YAML docs since it spares me the effort of figuring out how to parse types from Go code. The next natural step would be to publish an NPM |
Is your feature request related to a problem? Please describe.
Currently, the configurations for Grafana Loki are documented on the website and can also be accessed from the binary using the
-help
tag. However, as a newcomer, I find it is still challenging to navigate and be overwhelmed by the large number of configurations. It would be great if we could reach the documentation more easily and get instant feedback on incorrect configuration directly in text editors/IDEs.Describe the solution you'd like
I propose adding a JSON schema for the configuration file on SchemaStore. With tools supporting LSP, users would be able to access hover information (documentation) and obtain configuration validation in real time. While Grafana Loki configurations are written in YAML format, the tools should be capable of validating YAML files with a JSON schema.
I am not sure whether the configuration documentation is generated or not, I think the JSON schema should be able to be generated from the
Config
structs, but since the descriptions are currently located in theRegisterFlags
functions, minor changes are needed.Describe alternatives you've considered
N/A
Additional context
I am willing to contribute to this. 😊
The text was updated successfully, but these errors were encountered: