Skip to content

Commit

Permalink
Document Histogram&Summary builders tags behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
colega committed Jan 9, 2020
1 parent 652e679 commit 172f469
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions prometheusvanilla/builders.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ func BuildGauge(name, help, namespace string, labelNames []string, tag reflect.S

// BuildHistogram builds a prometheus.Histogram
// The function it returns returns a prometheus.Histogram type as an interface{}
// It requires the buckets tag to be provided
// If the buckets tag is explicitly empty, then the Histogram will be built with default prometheus buckets
// which is prometheus.DefBuckets at the time this comment is written.
func BuildHistogram(name, help, namespace string, labelNames []string, tag reflect.StructTag) (func(prometheus.Labels) interface{}, prometheus.Collector, error) {
buckets, err := bucketsFromTag(tag)
if err != nil {
Expand All @@ -81,6 +84,9 @@ func BuildHistogram(name, help, namespace string, labelNames []string, tag refle

// BuildSummary builds a prometheus.Summary
// The function it returns returns a prometheus.Summary type as an interface{}
// It requires the objectives tag to be provided, and optionally the max_age tag
// If the objectives tag is explicitly empty, then the Summary will be built with default prometheus objectives
// which is no objectives at the time this comment is written.
func BuildSummary(name, help, namespace string, labelNames []string, tag reflect.StructTag) (func(prometheus.Labels) interface{}, prometheus.Collector, error) {
maxAge, err := maxAgeFromTag(tag)
if err != nil {
Expand Down

0 comments on commit 172f469

Please sign in to comment.