Skip to content

Commit 2463b8e

Browse files
committed
Address review feedback
Signed-off-by: gotjosh <[email protected]>
1 parent 7810669 commit 2463b8e

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

api/prometheus/v1/api.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ const (
130130
epSeries = apiPrefix + "/series"
131131
epTargets = apiPrefix + "/targets"
132132
epTargetsMetadata = apiPrefix + "/targets/metadata"
133-
epMetricsMetadata = apiPrefix + "/metadata"
133+
epMetadata = apiPrefix + "/metadata"
134134
epRules = apiPrefix + "/rules"
135135
epSnapshot = apiPrefix + "/admin/tsdb/snapshot"
136136
epDeleteSeries = apiPrefix + "/admin/tsdb/delete_series"
@@ -249,8 +249,8 @@ type API interface {
249249
Targets(ctx context.Context) (TargetsResult, error)
250250
// TargetsMetadata returns metadata about metrics currently scraped by the target.
251251
TargetsMetadata(ctx context.Context, matchTarget string, metric string, limit string) ([]MetricMetadata, error)
252-
// MetricMetadata returns metadata about metrics currently scraped by the metric name.
253-
MetricsMetadata(ctx context.Context, metric string, limit string) (map[string][]Metadata, error)
252+
// Metadata returns metadata about metrics currently scraped by the metric name.
253+
Metadata(ctx context.Context, metric string, limit string) (map[string][]Metadata, error)
254254
}
255255

256256
// AlertsResult contains the result from querying the alerts endpoint.
@@ -812,8 +812,8 @@ func (h *httpAPI) TargetsMetadata(ctx context.Context, matchTarget string, metri
812812
return res, json.Unmarshal(body, &res)
813813
}
814814

815-
func (h *httpAPI) MetricsMetadata(ctx context.Context, metric string, limit string) (map[string][]Metadata, error) {
816-
u := h.client.URL(epMetricsMetadata, nil)
815+
func (h *httpAPI) Metadata(ctx context.Context, metric string, limit string) (map[string][]Metadata, error) {
816+
u := h.client.URL(epMetadata, nil)
817817
q := u.Query()
818818

819819
q.Set("metric", metric)

api/prometheus/v1/api_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -202,9 +202,9 @@ func TestAPIs(t *testing.T) {
202202
}
203203
}
204204

205-
doMetricsMetadata := func(metric string, limit string) func() (interface{}, Warnings, error) {
205+
doMetadata := func(metric string, limit string) func() (interface{}, Warnings, error) {
206206
return func() (interface{}, Warnings, error) {
207-
v, err := promAPI.MetricsMetadata(context.Background(), metric, limit)
207+
v, err := promAPI.Metadata(context.Background(), metric, limit)
208208
return v, nil, err
209209
}
210210
}
@@ -866,7 +866,7 @@ func TestAPIs(t *testing.T) {
866866
},
867867

868868
{
869-
do: doMetricsMetadata("go_goroutines", "1"),
869+
do: doMetadata("go_goroutines", "1"),
870870
inRes: map[string]interface{}{
871871
"go_goroutines": []map[string]interface{}{
872872
{
@@ -894,7 +894,7 @@ func TestAPIs(t *testing.T) {
894894
},
895895

896896
{
897-
do: doMetricsMetadata("", "1"),
897+
do: doMetadata("", "1"),
898898
inErr: fmt.Errorf("some error"),
899899
reqMethod: "GET",
900900
reqPath: "/api/v1/metadata",

0 commit comments

Comments
 (0)