Skip to content
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

Made storepb.RuleGroups a source of truth for rules API (Go, JSON, proto). Added tests. #2242

Merged
merged 1 commit into from
Mar 10, 2020

Conversation

bwplotka
Copy link
Member

@bwplotka bwplotka commented Mar 9, 2020

cc @s-urbaniak

Signed-off-by: Bartlomiej Plotka bwplotka@gmail.com

case "":
return errors.Errorf("rule: no type field provided: %v", string(entry))
default:
return errors.Errorf("rule: unknown type field provided %s; %v", decider.Type, string(entry))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a bummer that this isn't supported natively, but this looks actually quite ok!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess it would work for int not string field out of the box

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wait, I thought we are talking about enums. Then you probably mean gogo/protobuf#623? I think there will be never native support due to custom type thing in JSON (unless it will become a standard).

@s-urbaniak
Copy link
Contributor

CI complains something about go.mod 🤔
else LGTM 🎉

@s-urbaniak
Copy link
Contributor

i think the github.com/gogo/status dependency in go.mod is not necessary.

…oto). Added tests.

Signed-off-by: Bartlomiej Plotka <bwplotka@gmail.com>
@bwplotka bwplotka merged commit 0c9bbb8 into features/rules-proxy Mar 10, 2020
@bwplotka bwplotka deleted the parsable-rules branch March 10, 2020 10:10
bwplotka added a commit that referenced this pull request May 22, 2020
…oto). Added tests. (#2242)

Signed-off-by: Bartlomiej Plotka <bwplotka@gmail.com>
brancz pushed a commit that referenced this pull request May 25, 2020
)

* Added RulesAPI.

Signed-off-by: Bartlomiej Plotka <bwplotka@gmail.com>

* Added warnings.

Signed-off-by: Bartlomiej Plotka <bwplotka@gmail.com>

* Added Type to rules requests as it is on HTTP API. (#2201)

Signed-off-by: Bartlomiej Plotka <bwplotka@gmail.com>

* pkg/store/storepb: fix wrong rule reference (#2237)

* pkg/store/storepb: fix wrong rule reference

Currently we recursively reference rules instead of recording rules.

Signed-off-by: Sergiusz Urbaniak <sergiusz.urbaniak@gmail.com>

* proto: regenerate

Signed-off-by: Sergiusz Urbaniak <sergiusz.urbaniak@gmail.com>

* Made storepb.RuleGroups a source of truth for rules API (Go, JSON, proto). Added tests. (#2242)

Signed-off-by: Bartlomiej Plotka <bwplotka@gmail.com>

* Use proto rules API instead of struct; Moved as much as possible to promclient; Added rulesAPI RPC to sidecar. (#2243)

* Use proto rules API instead of struct; Added rulesAPI RPC to sidecar.

Signed-off-by: Bartlomiej Plotka <bwplotka@gmail.com>

* Fixed broken test.

Signed-off-by: Bartlomiej Plotka <bwplotka@gmail.com>

* Use proto rules API instead of struct; Moved as much as possible to promclient; Added rulesAPI RPC to sidecar. (#2291)

* rules_custom_test: fix asserting labels

Signed-off-by: Sergiusz Urbaniak <sergiusz.urbaniak@gmail.com>

* TestPrometheusStore_Rules_e2e: fix test fixture

Signed-off-by: Sergiusz Urbaniak <sergiusz.urbaniak@gmail.com>

Co-authored-by: Sergiusz Urbaniak <sergiusz.urbaniak@gmail.com>

* cmd/thanos/query: add initial rules support (#2240)

* cmd/thanos/query: add initial rules support

Signed-off-by: Sergiusz Urbaniak <sergiusz.urbaniak@gmail.com>

* pkg/query/api/v1: initial implementation

Signed-off-by: Sergiusz Urbaniak <sergiusz.urbaniak@gmail.com>

* e2e: initial implementation and fixes

Signed-off-by: Sergiusz Urbaniak <sergiusz.urbaniak@gmail.com>

* pkg/query: fix racy access to assert rules API store

Signed-off-by: Sergiusz Urbaniak <sergiusz.urbaniak@gmail.com>

* Refactored proto generation and separated store from rules APIs. (#2558)

* Refactored proto generation and separate store from rules APIs.

Signed-off-by: Bartlomiej Plotka <bwplotka@gmail.com>

* Addressed comments.

Signed-off-by: Bartlomiej Plotka <bwplotka@gmail.com>

* Fixed proto gen.

Signed-off-by: Bartlomiej Plotka <bwplotka@gmail.com>

* Addressed Serg comments.

Signed-off-by: Bartlomiej Plotka <bwplotka@gmail.com>

* Added Ruler support for RulesAPI; Refactored Manager. (#2562)

As per: https://thanos.io/proposals/202003_thanos_rules_federation.md/

Signed-off-by: Bartlomiej Plotka <bwplotka@gmail.com>

* Small fixes to changelog and flags. Do not add any.

Signed-off-by: Bartlomiej Plotka <bwplotka@gmail.com>

* Fixed after rebase.

Signed-off-by: Bartlomiej Plotka <bwplotka@gmail.com>

Co-authored-by: Sergiusz Urbaniak <sergiusz.urbaniak@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants