Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
2b66b49a
Commit
2b66b49a
authored
Nov 14, 2016
by
Fabian Reinartz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use Histogram instead of Summary
A histogram allows to aggregate by labels and calculate more comprehensive quantiles.
parent
49e2074f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
prometheus.go
pkg/client/metrics/prometheus/prometheus.go
+6
-6
No files found.
pkg/client/metrics/prometheus/prometheus.go
View file @
2b66b49a
...
...
@@ -30,11 +30,11 @@ import (
var
(
// requestLatency is a Prometheus Summary metric type partitioned by
// "verb" and "url" labels. It is used for the rest client latency metrics.
requestLatency
=
prometheus
.
New
Summary
Vec
(
prometheus
.
Summary
Opts
{
Name
:
"rest_client_request_latency_seconds"
,
Help
:
"Request latency in seconds. Broken down by verb and URL."
,
MaxAge
:
time
.
Hour
,
requestLatency
=
prometheus
.
New
Histogram
Vec
(
prometheus
.
Histogram
Opts
{
Name
:
"rest_client_request_latency_seconds"
,
Help
:
"Request latency in seconds. Broken down by verb and URL."
,
Buckets
:
prometheus
.
ExponentialBuckets
(
0.001
,
2
,
10
)
,
},
[]
string
{
"verb"
,
"url"
},
)
...
...
@@ -55,7 +55,7 @@ func init() {
}
type
latencyAdapter
struct
{
m
*
prometheus
.
Summary
Vec
m
*
prometheus
.
Histogram
Vec
}
func
(
l
*
latencyAdapter
)
Observe
(
verb
string
,
u
url
.
URL
,
latency
time
.
Duration
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment