Skip to content

Commit

Permalink
Merge pull request #22 from uvyuhin/updating_prometeus_template
Browse files Browse the repository at this point in the history
Adding Objectives to prometheus.SummaryOpts into prometheus template
  • Loading branch information
hexdigest committed Apr 21, 2020
2 parents da66e73 + 1741ed8 commit b28d953
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions templates/prometheus
Expand Up @@ -19,6 +19,7 @@ var {{down .Interface.Name}}DurationSummaryVec = promauto.NewSummaryVec(
Name: "{{down .Interface.Name}}_duration_seconds",
Help: "{{down .Interface.Name}} runtime duration and result",
MaxAge: time.Minute,
Objectives: map[float64]float64{0.5: 0.05, 0.9: 0.01, 0.99: 0.001},
},
[]string{"instance_name", "method", "result"})

Expand Down
7 changes: 4 additions & 3 deletions templates_tests/interface_with_prometheus.go
Expand Up @@ -23,9 +23,10 @@ type TestInterfaceWithPrometheus struct {

var testinterfaceDurationSummaryVec = promauto.NewSummaryVec(
prometheus.SummaryOpts{
Name: "testinterface_duration_seconds",
Help: "testinterface runtime duration and result",
MaxAge: time.Minute,
Name: "testinterface_duration_seconds",
Help: "testinterface runtime duration and result",
MaxAge: time.Minute,
Objectives: map[float64]float64{0.5: 0.05, 0.9: 0.01, 0.99: 0.001},
},
[]string{"instance_name", "method", "result"})

Expand Down

0 comments on commit b28d953

Please sign in to comment.