Update deps without licenses
The following packes did not have discernible LICENSE files at the hash we have vendored: github.com/beorn7/perks github.com/daviddengcn/go-colortext github.com/garyburd/redigo github.com/prometheus/common github.com/shurcooL/sanitized_anchor_name github.com/stretchr/objx This commit updates all of them and updates the central LICENSE file.
This commit is contained in:
20
vendor/github.com/prometheus/common/expfmt/json_decode.go
generated
vendored
20
vendor/github.com/prometheus/common/expfmt/json_decode.go
generated
vendored
@@ -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),
|
||||
},
|
||||
|
Reference in New Issue
Block a user