Update godeps

This commit is contained in:
Prashanth Balasubramanian 2016-06-21 11:58:43 -07:00
parent 423433bc5f
commit 701c5a0e30
482 changed files with 86915 additions and 19741 deletions

View file

@ -46,7 +46,7 @@ type counter002 struct {
Value float64 `json:"value"`
}
func protoLabelSet(base, ext model.LabelSet) []*dto.LabelPair {
func protoLabelSet(base, ext model.LabelSet) ([]*dto.LabelPair, error) {
labels := base.Clone().Merge(ext)
delete(labels, model.MetricNameLabel)
@ -59,6 +59,9 @@ func protoLabelSet(base, ext model.LabelSet) []*dto.LabelPair {
pairs := make([]*dto.LabelPair, 0, len(labels))
for _, ln := range names {
if !model.LabelNameRE.MatchString(ln) {
return nil, fmt.Errorf("invalid label name %q", ln)
}
lv := labels[model.LabelName(ln)]
pairs = append(pairs, &dto.LabelPair{
@ -67,7 +70,7 @@ func protoLabelSet(base, ext model.LabelSet) []*dto.LabelPair {
})
}
return pairs
return pairs, nil
}
func (d *json2Decoder) more() error {
@ -102,8 +105,12 @@ func (d *json2Decoder) more() error {
}
for _, ctr := range values {
labels, err := protoLabelSet(e.BaseLabels, ctr.Labels)
if err != nil {
return err
}
f.Metric = append(f.Metric, &dto.Metric{
Label: protoLabelSet(e.BaseLabels, ctr.Labels),
Label: labels,
Untyped: &dto.Untyped{
Value: proto.Float64(ctr.Value),
},
@ -131,8 +138,13 @@ func (d *json2Decoder) more() error {
// this remains "percentile"
hist.Labels["percentile"] = model.LabelValue(q)
labels, err := protoLabelSet(e.BaseLabels, hist.Labels)
if err != nil {
return err
}
f.Metric = append(f.Metric, &dto.Metric{
Label: protoLabelSet(e.BaseLabels, hist.Labels),
Label: labels,
Untyped: &dto.Untyped{
Value: proto.Float64(value),
},