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
e0c4f94d
Commit
e0c4f94d
authored
Apr 05, 2016
by
Miek Gieben
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
return failure with CH class hits file or etcd, monitoring portis 9135
parent
8892a1b4
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
9 additions
and
6 deletions
+9
-6
core/directives.go
core/directives.go
+1
-1
core/setup/prometheus.go
core/setup/prometheus.go
+1
-1
middleware/etcd/handler.go
middleware/etcd/handler.go
+2
-1
middleware/file/file.go
middleware/file/file.go
+2
-1
middleware/file/secondary.go
middleware/file/secondary.go
+1
-1
middleware/prometheus/README.md
middleware/prometheus/README.md
+1
-1
middleware/prometheus/metrics.go
middleware/prometheus/metrics.go
+1
-0
No files found.
core/directives.go
View file @
e0c4f94d
...
...
@@ -53,10 +53,10 @@ var directiveOrder = []directive{
// Directives that inject handlers (middleware)
{
"prometheus"
,
setup
.
Prometheus
},
{
"log"
,
setup
.
Log
},
{
"chaos"
,
setup
.
Chaos
},
{
"rewrite"
,
setup
.
Rewrite
},
{
"loadbalance"
,
setup
.
Loadbalance
},
{
"file"
,
setup
.
File
},
{
"chaos"
,
setup
.
Chaos
},
{
"secondary"
,
setup
.
Secondary
},
{
"etcd"
,
setup
.
Etcd
},
{
"proxy"
,
setup
.
Proxy
},
...
...
core/setup/prometheus.go
View file @
e0c4f94d
...
...
@@ -9,7 +9,7 @@ import (
const
(
path
=
"/metrics"
addr
=
"localhost:91
53"
addr
=
"localhost:91
35"
// 9153 is occopied by bind_exporter
)
var
once
sync
.
Once
...
...
middleware/etcd/handler.go
View file @
e0c4f94d
package
etcd
import
(
"fmt"
"strings"
"github.com/miekg/coredns/middleware"
...
...
@@ -12,7 +13,7 @@ import (
func
(
e
Etcd
)
ServeDNS
(
ctx
context
.
Context
,
w
dns
.
ResponseWriter
,
r
*
dns
.
Msg
)
(
int
,
error
)
{
state
:=
middleware
.
State
{
W
:
w
,
Req
:
r
}
if
state
.
QClass
()
!=
dns
.
ClassINET
{
return
e
.
Next
.
ServeDNS
(
ctx
,
w
,
r
)
return
dns
.
RcodeServerFailure
,
fmt
.
Errorf
(
"can only deal with ClassINET"
)
}
// We need to check stubzones first, because we may get a request for a zone we
...
...
middleware/file/file.go
View file @
e0c4f94d
package
file
import
(
"fmt"
"io"
"log"
...
...
@@ -25,7 +26,7 @@ type (
func
(
f
File
)
ServeDNS
(
ctx
context
.
Context
,
w
dns
.
ResponseWriter
,
r
*
dns
.
Msg
)
(
int
,
error
)
{
state
:=
middleware
.
State
{
W
:
w
,
Req
:
r
}
if
state
.
QClass
()
!=
dns
.
ClassINET
{
return
f
.
Next
.
ServeDNS
(
ctx
,
w
,
r
)
return
dns
.
RcodeServerFailure
,
fmt
.
Errorf
(
"can only deal with ClassINET"
)
}
qname
:=
state
.
Name
()
zone
:=
middleware
.
Zones
(
f
.
Zones
.
Names
)
.
Matches
(
qname
)
...
...
middleware/file/secondary.go
View file @
e0c4f94d
...
...
@@ -58,7 +58,7 @@ Transfer:
z
.
Tree
=
z1
.
Tree
*
z
.
Expired
=
false
log
.
Printf
(
"[INFO] Transfered: %s"
,
z
.
name
)
log
.
Printf
(
"[INFO] Transfer
r
ed: %s"
,
z
.
name
)
return
nil
}
...
...
middleware/prometheus/README.md
View file @
e0c4f94d
...
...
@@ -25,6 +25,6 @@ prometheus
For each zone that you want to see metrics for.
It optionally takes an address where the metrics are exported, the default
is
`localhost:915
3
`
. The metrics path is fixed to
`/metrics`
.
is
`localhost:915
4
`
. The metrics path is fixed to
`/metrics`
.
## Examples
middleware/prometheus/metrics.go
View file @
e0c4f94d
...
...
@@ -39,6 +39,7 @@ func (m *Metrics) Start() error {
http
.
Handle
(
path
,
prometheus
.
Handler
())
go
func
()
{
// TODO(miek): Logging here?
fmt
.
Errorf
(
"%s"
,
http
.
ListenAndServe
(
m
.
Addr
,
nil
))
}()
})
...
...
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