Use correct label name for metric name in rule.

This commit is contained in:
Julius Volz 2013-01-17 23:45:57 +01:00
parent 6929c10acf
commit c21450a089

View file

@ -27,7 +27,7 @@ func (rule *Rule) Eval(timestamp *time.Time) ast.Vector {
// Override the metric name and labels.
for _, sample := range vector {
sample.Metric["metric"] = model.LabelValue(rule.name)
sample.Metric["name"] = model.LabelValue(rule.name)
for label, value := range rule.labels {
if value == "" {
delete(sample.Metric, label)