-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Copy cortex/pkg/ruler
package dependency into Loki
#5089
Conversation
b2df5ff
to
866532c
Compare
cortex/pkg/ruler
package dependency into Loki
I recommend reviewing this commit-by-commit. |
@@ -8,15 +8,15 @@ import ( | |||
"io/ioutil" | |||
"strings" | |||
|
|||
"github.com/cortexproject/cortex/pkg/chunk" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replace with the Loki one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good catch. pushed a few commits changing it, wdyt?
@@ -1,4 +1,4 @@ | |||
package ruler | |||
package base | |||
|
|||
import ( | |||
"github.com/prometheus/client_golang/prometheus" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The util package below could be avoided ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nope, unfortunately. However, we are already working on forking util
.
@@ -1,4 +1,4 @@ | |||
package ruler | |||
package base | |||
|
|||
import ( | |||
"context" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same for the util package of cortex below ?
"testing" | ||
"time" | ||
|
||
"github.com/cortexproject/cortex/pkg/util" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same we should get those function in loki.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
We copied over the ruler code as part of #5089, and it seems that at the same time we stopped depending on the object storage implementation of Cortex. Turns out, there are (slight) differences between the clients which meant that response returned by the API when we try to get a rule group that is not found had changed. This ensures that is consistent with the error assertion that we have in the code for the ruler.
* Ruler: Rule group not found API message We copied over the ruler code as part of #5089, and it seems that at the same time we stopped depending on the object storage implementation of Cortex. Turns out, there are (slight) differences between the clients which meant that response returned by the API when we try to get a rule group that is not found had changed. This ensures that is consistent with the error assertion that we have in the code for the ruler. * Use the method from the interfaace to determine object storage * also include DeleteObject * appease the linter
We copied over the ruler code as part of #5089, and it seems that at the same time we stopped depending on the object storage implementation of Cortex. Turns out, there are (slight) differences between the clients which meant that response returned by the API when we try to get a rule group that is not found had changed. This ensures that is consistent with the error assertion that we have in the code for the ruler.
* Ruler: Rule group not found API message We copied over the ruler code as part of #5089, and it seems that at the same time we stopped depending on the object storage implementation of Cortex. Turns out, there are (slight) differences between the clients which meant that response returned by the API when we try to get a rule group that is not found had changed. This ensures that is consistent with the error assertion that we have in the code for the ruler. * Use the method from the interfaace to determine object storage * also include DeleteObject * appease the linter
What this PR does / why we need it:
As a part of removing Loki dependency on cortex packages, we decided to copy the
ruler
package from cortex to Loki itself.Note that I decided to copy it into a
base
subpackage instead of merging with existingruler
package to make reviewing this easier. If you prefer that I try merging them into a single package at this same PR, just let me know.Which issue(s) this PR fixes:
N/A
Special notes for your reviewer:
base
subpackage instead of merging it with the existingruler
package to make reviewing this easier. If you prefer that I try merging them into a single package at this same PR, just let me know.Checklist
CHANGELOG.md
about the changes.