mirror of
https://github.com/prometheus/prometheus.git
synced 2025-01-27 05:32:27 -08:00
TrimPrefix removes a prefix, TrimLeft removes chars
This commit is contained in:
parent
ee88f0d222
commit
1545842704
|
@ -128,7 +128,7 @@ func TestTargetURL(t *testing.T) {
|
||||||
func newTestTarget(targetURL string, deadline time.Duration, lbls labels.Labels) *Target {
|
func newTestTarget(targetURL string, deadline time.Duration, lbls labels.Labels) *Target {
|
||||||
lb := labels.NewBuilder(lbls)
|
lb := labels.NewBuilder(lbls)
|
||||||
lb.Set(model.SchemeLabel, "http")
|
lb.Set(model.SchemeLabel, "http")
|
||||||
lb.Set(model.AddressLabel, strings.TrimLeft(targetURL, "http://"))
|
lb.Set(model.AddressLabel, strings.TrimPrefix(targetURL, "http://"))
|
||||||
lb.Set(model.MetricsPathLabel, "/metrics")
|
lb.Set(model.MetricsPathLabel, "/metrics")
|
||||||
|
|
||||||
return &Target{labels: lb.Labels()}
|
return &Target{labels: lb.Labels()}
|
||||||
|
|
Loading…
Reference in a new issue