mirror of
https://github.com/prometheus/prometheus
synced 2025-01-12 01:29:43 +00: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 {
|
||||
lb := labels.NewBuilder(lbls)
|
||||
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")
|
||||
|
||||
return &Target{labels: lb.Labels()}
|
||||
|
Loading…
Reference in New Issue
Block a user