Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
go-common
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ai3
go-common
Commits
aa880113
Commit
aa880113
authored
7 years ago
by
ale
Browse files
Options
Downloads
Patches
Plain Diff
Change names of the HTTP metrics to match other jobs
parent
9b20acad
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
serverutil/http.go
+11
-3
11 additions, 3 deletions
serverutil/http.go
with
11 additions
and
3 deletions
serverutil/http.go
+
11
−
3
View file @
aa880113
...
...
@@ -103,16 +103,24 @@ func instrumentHandler(h http.Handler) http.Handler {
// HTTP-related metrics.
var
(
// Since we instrument the root HTTP handler, we don't really
// have a good way to set the 'handler' label based on the
// request URL - but still, we'd like to set the label to
// match what the other Prometheus jobs do. So we just set it
// to 'all'.
totalRequests
=
prometheus
.
NewCounterVec
(
prometheus
.
CounterOpts
{
Name
:
"
total
_requests"
,
Name
:
"
http
_requests
_total
"
,
Help
:
"Total number of requests."
,
ConstLabels
:
prometheus
.
Labels
{
"handler"
:
"all"
,
},
},
[]
string
{
"code"
},
[]
string
{
"code"
,
"method"
},
)
inFlightRequests
=
prometheus
.
NewGauge
(
prometheus
.
GaugeOpts
{
Name
:
"
inflig
ht_requests"
,
Name
:
"ht
tp
_requests
_inflight
"
,
Help
:
"Number of in-flight requests."
,
},
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment