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

Evaluation delay set per group is not stored or used by Mimir #3357

Closed
pstibrany opened this issue Nov 2, 2022 · 0 comments · Fixed by #3392
Closed

Evaluation delay set per group is not stored or used by Mimir #3357

pstibrany opened this issue Nov 2, 2022 · 0 comments · Fixed by #3392
Labels
bug Something isn't working component/ruler

Comments

@pstibrany
Copy link
Member

pstibrany commented Nov 2, 2022

Describe the bug

#1474 introduced ability to set evaluation delay for individual rule groups. Unfortunately this isn't fully working in Mimir yet. While uploading rule group with evaluation delay says that upload succeeded, getting the rule back shows that evaluation delay field was lost.

My group.yaml file:

name: testrules
evaluation_delay: "3m"
rules:
    - record: evaluation:timestamp
      expr: time()
    - record: test_metric:sum:rate1m
      expr: sum(rate(test_metric[1m]))

Uploading using "/prometheus/config/v1/rules/namespace" endpoint reports:

$ curl -u "$MIMIR_TENANT_ID:$MIMIR_API_KEY" $RULES_ENDPOINT_PREFIX/namespace --data-binary @group.yaml
{"status":"success","data":null,"errorType":"","error":""}%

But getting the group back shows no evaluation delay:

$ curl -u "$MIMIR_TENANT_ID:$MIMIR_API_KEY" $RULES_ENDPOINT_PREFIX/namespace
namespace:
    - name: testrules
      rules:
        - record: evaluation:timestamp
          expr: time()
        - record: test_metric:sum:rate1m
          expr: sum(rate(test_metric[1m]))

This seems to be caused by the fact that rulespb.ToProto call in CreateRuleGroup method doesn't store evaluation delay field to protobuf message:

// ToProto transforms a formatted prometheus rulegroup to a rule group protobuf
func ToProto(user string, namespace string, rl rulefmt.RuleGroup) *RuleGroupDesc {
rg := RuleGroupDesc{
Name: rl.Name,
Namespace: namespace,
Interval: time.Duration(rl.Interval),
Rules: formattedRuleToProto(rl.Rules),
User: user,
SourceTenants: rl.SourceTenants,
}
return &rg
}

(Field doesn't even exist in protobuf message)

Tested against r210 build.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working component/ruler
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants