Skip to content

Commit e8f6986

Browse files
committed
add documentation regarding the configuration
Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
1 parent 7f28def commit e8f6986

File tree

2 files changed

+40
-0
lines changed

2 files changed

+40
-0
lines changed

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@ The following Language Clients have been tested with this language server. More
6262

6363
Feel free to reach out if you want to use it with another Editor/Tool.
6464

65+
Reading this [documentation](./doc/developing_editor.md) can help you in your work
66+
6567
### VS Code
6668

6769
There exists a VS Code extension based on this language server: <https://github.com/slrtbtfs/vscode-prometheus>
@@ -100,3 +102,11 @@ The Vim command `:YcmDebugInfo` gives status information and points to logfiles.
100102

101103
1. Install package `LSP`, `LSP-promql` via `Package Control`.
102104
2. Follow the [installation instruction](https://github.com/nevill/lsp-promql#installation).
105+
106+
## Contributing
107+
108+
Refer to [CONTRIBUTING.md](./CONTRIBUTING.md)
109+
110+
## License
111+
112+
Apache License 2.0, see [LICENSE](./LICENSE).

doc/developing_editor.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
Development of new client editor
2+
=============================
3+
4+
This documentation will give you some tips to help when you are going to support the promql-server in a new editor.
5+
6+
## Config
7+
There is two different config used by the promql-server.
8+
9+
### YAML configuration (cold configuration)
10+
The first one is a classic yaml file which can be used to customize the server when it is starting. It has the following structure:
11+
12+
```yaml
13+
activate_rpc_log: false # It's a boolean in order to activate or deactivate the rpc log. It's deactivated by default
14+
log_format: "text" # The format of the log printed. Possible value: json, text. Default value: "text"
15+
prometheus_url: "http://localhost:9090" # the HTTP URL of the prometheus server.
16+
rest_api_port: 8080 # When set, the server will be started as an HTTP server. Default value: 0
17+
```
18+
19+
### JSON configuration (hot configuration)
20+
There is a second configuration which is used only at the runtime.
21+
22+
```json
23+
{
24+
"promql": {
25+
"url": "http://localhost:9090" # the HTTP URL of the prometheus server.
26+
}
27+
}
28+
```
29+
30+
This configuration will be watched thanks to the method implemented `DidChangeConfiguration`

0 commit comments

Comments
 (0)