Skip to content

Commit 9da1555

Browse files
Merge pull request #332 from zalando-incubator/drop-identifier
Remove HTTP collector check on identifier label
2 parents 85f6dda + d7f9664 commit 9da1555

File tree

3 files changed

+3
-8
lines changed

3 files changed

+3
-8
lines changed

README.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -650,9 +650,8 @@ spec:
650650
type: AverageValue
651651
```
652652

653-
The HTTP collector similar to the Pod Metrics collector. The metric name should always be `http`.
654-
This value is also used in the annotations to configure the metrics adapter to query the required
655-
target. The following configuration values are supported:
653+
The HTTP collector similar to the Pod Metrics collector. The following
654+
configuration values are supported:
656655

657656
- `json-key` to specify the JSON path of the metric to be queried
658657
- `endpoint` the fully formed path to query for the metric. In the above example a Kubernetes _Service_

pkg/collector/http_collector.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ const (
1818
HTTPMetricNameLegacy = "http"
1919
HTTPEndpointAnnotationKey = "endpoint"
2020
HTTPJsonPathAnnotationKey = "json-key"
21-
identifierLabel = "identifier"
2221
)
2322

2423
type HTTPCollectorPlugin struct{}
@@ -53,9 +52,6 @@ func (p *HTTPCollectorPlugin) NewCollector(hpa *v2beta2.HorizontalPodAutoscaler,
5352
if config.Metric.Selector == nil || config.Metric.Selector.MatchLabels == nil {
5453
return nil, fmt.Errorf("no label selector specified for metric: %s", config.Metric.Name)
5554
}
56-
if _, ok := config.Metric.Selector.MatchLabels[identifierLabel]; !ok {
57-
return nil, fmt.Errorf("%s is not specified as a label for metric %s", identifierLabel, config.Metric.Name)
58-
}
5955
collector.metric = config.Metric
6056
var aggFunc httpmetrics.AggregatorFunc
6157

pkg/collector/http_collector_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ func makeTestHTTPCollectorConfig(endpoint, aggregator string) *MetricConfig {
8585
Metric: v2beta2.MetricIdentifier{
8686
Name: "test-metric",
8787
Selector: &v1.LabelSelector{
88-
MatchLabels: map[string]string{identifierLabel: "test-metric"},
88+
MatchLabels: map[string]string{"type": HTTPJSONPathType},
8989
},
9090
},
9191
},

0 commit comments

Comments
 (0)