mirror of
https://github.com/kubernetes-sigs/prometheus-adapter.git
synced 2026-04-05 17:27:51 +00:00
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:
parent
c22681a91d
commit
2984604be8
12 changed files with 1082 additions and 548 deletions
|
|
@ -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, ","))
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue