Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API Client: Support new metadata endpoint in v1 #718

Merged
merged 4 commits into from Feb 28, 2020

Conversation

gotjosh
Copy link
Member

@gotjosh gotjosh commented Feb 26, 2020

Introduces support for the new metadata endpoint from Prometheus. The new endpoint provides information independent of targets and collapses the unique combinations of HELP, TYPE and UNIT.

Fixes #705

Signed-off-by: gotjosh josue@grafana.com

@gotjosh gotjosh force-pushed the support-metric-metadata-endpoint branch from 77dc78b to 81fed67 Compare February 26, 2020 17:48
Introduces support for the new metadata endpoint from Prometheus. The new endpoint provides information independent of targets and collapses the unique combinations of HELP, TYPE and UNIT.

Fixes prometheus#705

Signed-off-by: gotjosh <josue@grafana.com>
@gotjosh gotjosh force-pushed the support-metric-metadata-endpoint branch from 81fed67 to 7f509dc Compare February 26, 2020 17:49
@@ -366,6 +369,13 @@ type MetricMetadata struct {
Unit string `json:"unit"`
}

// Metadata models the metadata of a metric.
type Metadata struct {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Initially, I tried to re-use the MetricMetadata struct above. However, it felt misleading to return a type that will always have two empty fields (target, metric).

@beorn7 beorn7 self-requested a review February 27, 2020 11:49
@beorn7
Copy link
Member

beorn7 commented Feb 27, 2020

On my review queue. Help would be appreciated. @slrtbtfs or @joe-elliott perhaps?

Copy link
Contributor

@slrtbtfs slrtbtfs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See comments, otherwise LGTM.

api/prometheus/v1/api_test.go Outdated Show resolved Hide resolved
api/prometheus/v1/api_test.go Outdated Show resolved Hide resolved
api/prometheus/v1/api.go Outdated Show resolved Hide resolved
gotjosh and others added 2 commits February 27, 2020 17:52
Co-Authored-By: Tobias Guggenmos <tguggenm@redhat.com>
Signed-off-by: gotjosh <josue@grafana.com>
Co-Authored-By: Tobias Guggenmos <tguggenm@redhat.com>
Signed-off-by: gotjosh <josue@grafana.com>
@gotjosh gotjosh force-pushed the support-metric-metadata-endpoint branch from e321596 to 6c9cb08 Compare February 27, 2020 18:12
Signed-off-by: gotjosh <josue@grafana.com>
@gotjosh gotjosh force-pushed the support-metric-metadata-endpoint branch from 6c9cb08 to 2463b8e Compare February 28, 2020 09:49
@gotjosh
Copy link
Member Author

gotjosh commented Feb 28, 2020

One last 👀 @joe-elliott / @slrtbtfs ?

Copy link
Contributor

@joe-elliott joe-elliott left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@slrtbtfs slrtbtfs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Member

@beorn7 beorn7 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks everyone, authors and reviewers alike.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

API client: Support for new metadata endpoints (in v1)
4 participants