mirror of
https://github.com/zalando-incubator/kube-metrics-adapter.git
synced 2025-05-14 09:19:26 +00:00
Use labels for mapping metric types to metrics (#219)
* Use labels for mapping metric types to metrics Signed-off-by: Mikkel Oscar Lyderik Larsen <mikkel.larsen@zalando.de> * Log warning when old format is used Signed-off-by: Mikkel Oscar Lyderik Larsen <mikkel.larsen@zalando.de> * Test NewCollector logic for external metrics Signed-off-by: Mikkel Oscar Lyderik Larsen <mikkel.larsen@zalando.de>
This commit is contained in:

committed by
GitHub

parent
bb107b678c
commit
df0ed1fca4
@ -15,7 +15,7 @@ const (
|
||||
)
|
||||
|
||||
type AnnotationConfigs struct {
|
||||
CollectorName string
|
||||
CollectorType string
|
||||
Configs map[string]string
|
||||
PerReplica bool
|
||||
Interval time.Duration
|
||||
@ -64,14 +64,14 @@ func (m AnnotationConfigMap) Parse(annotations map[string]string) error {
|
||||
config, ok := m[key]
|
||||
if !ok {
|
||||
config = &AnnotationConfigs{
|
||||
CollectorName: metricCollector,
|
||||
CollectorType: metricCollector,
|
||||
Configs: map[string]string{},
|
||||
}
|
||||
m[key] = config
|
||||
}
|
||||
|
||||
// TODO: fail if collector name doesn't match
|
||||
if config.CollectorName != metricCollector {
|
||||
if config.CollectorType != metricCollector {
|
||||
continue
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user