Advanced Configuration

This commit introduces advanced configuration.  The rate-interval and
label-prefix flags are removed, and replaced by a configuration file
that allows you to specify series queries and the rules for transforming
those into metrics queries and API resources.
This commit is contained in:
Solly Ross 2018-02-12 17:35:32 -05:00
parent 61b071c186
commit af9f11c817
12 changed files with 1077 additions and 548 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, ","))
}