Fix double slash in GeneratorURL sent to alertmanager.

Fixes https://github.com/prometheus/prometheus/issues/722
This commit is contained in:
Julius Volz 2015-05-23 19:16:35 +02:00
parent a92134a947
commit ff53d10849
1 changed files with 2 additions and 1 deletions

View File

@ -16,6 +16,7 @@ package rules
import (
"fmt"
"io/ioutil"
"strings"
"sync"
"time"
@ -211,7 +212,7 @@ func (m *Manager) queueAlertNotifications(rule *AlertingRule, timestamp clientmo
Value: aa.Value,
ActiveSince: aa.ActiveSince.Time(),
RuleString: rule.String(),
GeneratorURL: m.prometheusURL + utility.GraphLinkForExpression(rule.Vector.String()),
GeneratorURL: m.prometheusURL + strings.TrimLeft(utility.GraphLinkForExpression(rule.Vector.String()), "/"),
})
}
m.notificationHandler.SubmitReqs(notifications)