cmd/bosun: 2x API routes: Metadata for all metrics, metrics per tagk #1560

Merged
merged 1 commit into from Jan 13, 2016

Projects

None yet

2 participants

@kylebrandt
Member

No description provided.

@captncraig captncraig commented on the diff Jan 13, 2016
cmd/bosun/web/search.go
@@ -63,6 +63,24 @@ func MetricsByTagPair(t miniprofiler.Timer, w http.ResponseWriter, r *http.Reque
return schedule.Search.MetricsByTagPair(tagk, tagv)
}
+func MetricsByTagKey(t miniprofiler.Timer, w http.ResponseWriter, r *http.Request) (interface{}, error) {
@captncraig
captncraig Jan 13, 2016 Contributor

Perhaps a comment explaining what it returns with an example. map[string][]string could be anything

@captncraig captncraig commented on the diff Jan 13, 2016
cmd/bosun/web/web.go
@@ -358,12 +360,58 @@ func GetMetadata(t miniprofiler.Timer, w http.ResponseWriter, r *http.Request) (
return schedule.GetMetadata(r.FormValue("metric"), tags)
}
+type MetricMetaTagKeys struct {
+ *database.MetricMetadata
@captncraig
captncraig Jan 13, 2016 Contributor

This type should be moved into models now. But that can wait until later

@captncraig captncraig commented on the diff Jan 13, 2016
cmd/bosun/web/web.go
@@ -358,12 +360,58 @@ func GetMetadata(t miniprofiler.Timer, w http.ResponseWriter, r *http.Request) (
return schedule.GetMetadata(r.FormValue("metric"), tags)
}
+type MetricMetaTagKeys struct {
+ *database.MetricMetadata
+ TagKeys []string
+}
+
func MetadataMetrics(t miniprofiler.Timer, w http.ResponseWriter, r *http.Request) (interface{}, error) {
@captncraig
captncraig Jan 13, 2016 Contributor

I'm gonna insist on a better name here. MetadataMetrics could mean anything

@kylebrandt
kylebrandt Jan 13, 2016 Member

It Matches the underlying schedule name:

677f012 cmd/bosun/sched/sched.go (Craig Peterson 2015-09-25 14:05:28 -0600 161) func (s _Schedule) MetadataMetrics(metric string) (_database.MetricMetadata, error) {

;-)

@kylebrandt kylebrandt cmd/bosun: 2x API routes: Metadata for all metrics, metrics per tagk
898a956
@captncraig
Contributor

lgtm

@kylebrandt kylebrandt merged commit 898a956 into master Jan 13, 2016

2 checks passed

bosun All checks Passed!
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@captncraig captncraig deleted the apiMetricMeta branch Feb 24, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment