-
Notifications
You must be signed in to change notification settings - Fork 8.9k
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
Rules v1 API #3656
Rules v1 API #3656
Conversation
Can you share example output? |
Sure 😄 I added all strings, group name and file, and rules (yaml).
|
Parsing the JSON and YAML mixture could be complex. |
I think a structure more like #3391 would make more sense. Returning YAML should be for entire files (so someday we can include comments too for the main config), it isn't needed in more detailed views. |
@brian-brazil can you be more specific on the format changes? I don't see a difference between #3391 rules api and this output.
|
@moolitayer there were concerns about format and field changes, so the original request was for a string return. We could convert this yaml to json, but it probably shouldn't be here. We could return json from rules.go as a new method? |
@midnightconman I wasn't aware of any backward compatibility concerns, can you elaborate on that a little? It would be helpful to think of how in the future we could request a different output format from the API if we need to implement something different. BTW are there any plans for rule mutating API? (and how would that work with rule configuration files)
How would that be exposed? |
Do we wan't this to be schema-full or schema-less? Meaning, do we only want to provide the fields in the current struct and new fields would be dropped? Also, do we want to do this if it requires existing struct changes? Here is the existing Rule struct: https://github.com/prometheus/prometheus/blob/master/rules/manager.go#L135 |
If/when there's new fields the code can be changed. |
@midnightconman are you still working on this? |
@midnightconman And also i want to create a rule via API. Is that possible? |
With #4318 merged, I am closing here. Let me know if I am missing something. |
This is part of #2467