Skip to content

Commit

Permalink
Updated documentation to include Summary
Browse files Browse the repository at this point in the history
  • Loading branch information
mapno committed May 20, 2019
1 parent a811240 commit d276743
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,9 @@ Define your metrics:
var metrics struct {
SomeCounter func() prometheus.Counter `name:"some_counter" help:"some counter"`
SomeObserver func() prometheus.Observer `name:"some_observer" help:"Some observer with default buckets"`
SomeObserverWithSpecificBuckets func() prometheus.Observer `name:"some_observer_with_buckets" help:"Some observer with default buckets" buckets:".01,.05,.1"`
SomeObserverWithSpecificBuckets func() prometheus.Observer `name:"some_observer_with_buckets" help:"Some observer with custom buckets" buckets:".01,.05,.1"`
SomeGauge func() prometheus.Gauge `name:"some_gauge" help:"Some gauge"`
SomeSummaryWithSpecificMaxAge func() prometheus.Summary `name:"some_summary_with_specific_max_age" help:"Some summary with custom max age" max_age:"20m"`

Requests struct {
Total func(requestLabels) prometheus.Count `name:"total" help:"Total amount of requests served"`
Expand Down Expand Up @@ -57,6 +58,7 @@ By default, only some basic metric types are registered when `gotoprom` is intia
* `prometheus.Counter`
* `prometheus.Observer`
* `prometheus.Gauge`
* `prometheus.Summary`

You can extend this by adding more types, for instance, if you want to observe time and want
to avoid repetitive code you can create a `prometheusx.TimeObserver`:
Expand Down
1 change: 0 additions & 1 deletion prometheusvanilla/builders.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,6 @@ func maxAgeFromTag(tag reflect.StructTag) (time.Duration, error) {
if !ok {
return 0, nil
}
var maxAgeDuration time.Duration
maxAgeDuration, err := time.ParseDuration(maxAgeString)
if err != nil {
return 0, fmt.Errorf("invalid time duration specified: %s", err)
Expand Down

0 comments on commit d276743

Please sign in to comment.