Catch this up to upstream/master.

This commit is contained in:
Tony Compton 2018-06-27 17:31:43 -04:00
parent 0af14dc93d
commit b3e1323a1c
11 changed files with 1442 additions and 520 deletions

View file

@ -19,6 +19,7 @@ import (
"context"
"encoding/json"
"fmt"
"strings"
"time"
"github.com/prometheus/common/model"
@ -121,3 +122,11 @@ func (s *Series) UnmarshalJSON(data []byte) error {
return nil
}
func (s *Series) String() string {
lblStrings := make([]string, 0, len(s.Labels))
for k, v := range s.Labels {
lblStrings = append(lblStrings, fmt.Sprintf("%s=%q", k, v))
}
return fmt.Sprintf("%s{%s}", s.Name, strings.Join(lblStrings, ","))
}