Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
C
Coredns
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Railgun
Coredns
Commits
30a4a87e
Commit
30a4a87e
authored
Sep 14, 2020
by
Ruslan Drozhdzh
Committed by
GitHub
Sep 14, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
plugin/forward: add hit/miss metrics for connection cache (#4114)
Signed-off-by:
Ruslan Drozhdzh
<
rdrozhdzh@infoblox.com
>
parent
2fe5d684
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
2 deletions
+18
-2
plugin/forward/README.md
plugin/forward/README.md
+4
-2
plugin/forward/connect.go
plugin/forward/connect.go
+2
-0
plugin/forward/metrics.go
plugin/forward/metrics.go
+12
-0
No files found.
plugin/forward/README.md
View file @
30a4a87e
...
@@ -112,10 +112,12 @@ If monitoring is enabled (via the *prometheus* plugin) then the following metric
...
@@ -112,10 +112,12 @@ If monitoring is enabled (via the *prometheus* plugin) then the following metric
*
`coredns_forward_healthcheck_failures_total{to}`
- number of failed health checks per upstream.
*
`coredns_forward_healthcheck_failures_total{to}`
- number of failed health checks per upstream.
*
`coredns_forward_healthcheck_broken_total{}`
- counter of when all upstreams are unhealthy,
*
`coredns_forward_healthcheck_broken_total{}`
- counter of when all upstreams are unhealthy,
and we are randomly (this always uses the
`random`
policy) spraying to an upstream.
and we are randomly (this always uses the
`random`
policy) spraying to an upstream.
*
`max_concurrent_rejects_total{}`
- counter of the number of queries rejected because the
*
`
coredns_forward_
max_concurrent_rejects_total{}`
- counter of the number of queries rejected because the
number of concurrent queries were at maximum.
number of concurrent queries were at maximum.
*
`coredns_forward_conn_cache_hits_total{to, proto}`
- counter of connection cache hits per upstream and protocol.
*
`coredns_forward_conn_cache_misses_total{to, proto}`
- counter of connection cache misses per upstream and protocol.
Where
`to`
is one of the upstream servers (
**TO**
from the config),
`rcode`
is the returned RCODE
Where
`to`
is one of the upstream servers (
**TO**
from the config),
`rcode`
is the returned RCODE
from the upstream.
from the upstream
,
`proto`
is the transport protocol like
`udp`
,
`tcp`
,
`tcp-tls`
.
## Examples
## Examples
...
...
plugin/forward/connect.go
View file @
30a4a87e
...
@@ -54,8 +54,10 @@ func (t *Transport) Dial(proto string) (*persistConn, bool, error) {
...
@@ -54,8 +54,10 @@ func (t *Transport) Dial(proto string) (*persistConn, bool, error) {
pc
:=
<-
t
.
ret
pc
:=
<-
t
.
ret
if
pc
!=
nil
{
if
pc
!=
nil
{
ConnCacheHitsCount
.
WithLabelValues
(
t
.
addr
,
proto
)
.
Add
(
1
)
return
pc
,
true
,
nil
return
pc
,
true
,
nil
}
}
ConnCacheMissesCount
.
WithLabelValues
(
t
.
addr
,
proto
)
.
Add
(
1
)
reqTime
:=
time
.
Now
()
reqTime
:=
time
.
Now
()
timeout
:=
t
.
dialTimeout
()
timeout
:=
t
.
dialTimeout
()
...
...
plugin/forward/metrics.go
View file @
30a4a87e
...
@@ -52,4 +52,16 @@ var (
...
@@ -52,4 +52,16 @@ var (
Name
:
"max_concurrent_rejects_total"
,
Name
:
"max_concurrent_rejects_total"
,
Help
:
"Counter of the number of queries rejected because the concurrent queries were at maximum."
,
Help
:
"Counter of the number of queries rejected because the concurrent queries were at maximum."
,
})
})
ConnCacheHitsCount
=
promauto
.
NewCounterVec
(
prometheus
.
CounterOpts
{
Namespace
:
plugin
.
Namespace
,
Subsystem
:
"forward"
,
Name
:
"conn_cache_hits_total"
,
Help
:
"Counter of connection cache hits per upstream and protocol."
,
},
[]
string
{
"to"
,
"proto"
})
ConnCacheMissesCount
=
promauto
.
NewCounterVec
(
prometheus
.
CounterOpts
{
Namespace
:
plugin
.
Namespace
,
Subsystem
:
"forward"
,
Name
:
"conn_cache_misses_total"
,
Help
:
"Counter of connection cache misses per upstream and protocol."
,
},
[]
string
{
"to"
,
"proto"
})
)
)
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