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
503e0dc4
Commit
503e0dc4
authored
Feb 03, 2020
by
Miek Gieben
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
more fixes
Signed-off-by:
Miek Gieben
<
miek@miek.nl
>
parent
3f1fd6d0
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
4 deletions
+14
-4
plugin/traffic/README.md
plugin/traffic/README.md
+2
-1
plugin/traffic/xds/client.go
plugin/traffic/xds/client.go
+6
-3
plugin/traffic/xds/metrics.go
plugin/traffic/xds/metrics.go
+6
-0
No files found.
plugin/traffic/README.md
View file @
503e0dc4
...
@@ -135,7 +135,8 @@ we continue with step 4 above, ignoring any locality.
...
@@ -135,7 +135,8 @@ we continue with step 4 above, ignoring any locality.
If monitoring is enabled (via the
*prometheus*
plugin) then the following metric are exported:
If monitoring is enabled (via the
*prometheus*
plugin) then the following metric are exported:
*
`coredns_traffic_clusters_tracked{}`
the number of tracked clusters.
*
`coredns_traffic_cluster_tracked{}`
the number of tracked clusters.
*
`coredns_traffic_endpoint_tracked{}`
the number of tracked clusters.
## Ready
## Ready
...
...
plugin/traffic/xds/client.go
View file @
503e0dc4
...
@@ -189,14 +189,15 @@ func (c *Client) receive(stream adsStream) error {
...
@@ -189,14 +189,15 @@ func (c *Client) receive(stream adsStream) error {
}
}
a
.
SetClusterLoadAssignment
(
cluster
.
GetName
(),
nil
)
a
.
SetClusterLoadAssignment
(
cluster
.
GetName
(),
nil
)
}
}
log
.
Debugf
(
"Cluster discovery processed with %d resources, version %q and nonce %q"
,
len
(
resp
.
GetResources
()),
c
.
Version
(
cdsURL
),
c
.
Nonce
(
cdsURL
))
ClusterGauge
.
Set
(
float64
(
len
(
resp
.
GetResources
())))
// set our local administration and ack the reply. Empty version would signal NACK.
// set our local administration and ack the reply. Empty version would signal NACK.
c
.
SetNonce
(
cdsURL
,
resp
.
GetNonce
())
c
.
SetNonce
(
cdsURL
,
resp
.
GetNonce
())
c
.
SetVersion
(
cdsURL
,
resp
.
GetVersionInfo
())
c
.
SetVersion
(
cdsURL
,
resp
.
GetVersionInfo
())
c
.
SetAssignments
(
a
)
c
.
SetAssignments
(
a
)
c
.
clusterDiscovery
(
stream
,
resp
.
GetVersionInfo
(),
resp
.
GetNonce
(),
a
.
clusters
())
c
.
clusterDiscovery
(
stream
,
resp
.
GetVersionInfo
(),
resp
.
GetNonce
(),
a
.
clusters
())
log
.
Debugf
(
"Cluster discovery processed with %d resources, version %q and nonce %q"
,
len
(
resp
.
GetResources
()),
c
.
Version
(
cdsURL
),
c
.
Nonce
(
cdsURL
))
ClusterGauge
.
Set
(
float64
(
len
(
resp
.
GetResources
())))
// now kick off discovery for endpoints
// now kick off discovery for endpoints
if
err
:=
c
.
endpointDiscovery
(
stream
,
c
.
Version
(
edsURL
),
c
.
Nonce
(
edsURL
),
a
.
clusters
());
err
!=
nil
{
if
err
:=
c
.
endpointDiscovery
(
stream
,
c
.
Version
(
edsURL
),
c
.
Nonce
(
edsURL
),
a
.
clusters
());
err
!=
nil
{
log
.
Debug
(
err
)
log
.
Debug
(
err
)
...
@@ -214,11 +215,13 @@ func (c *Client) receive(stream adsStream) error {
...
@@ -214,11 +215,13 @@ func (c *Client) receive(stream adsStream) error {
}
}
c
.
assignments
.
SetClusterLoadAssignment
(
cla
.
GetClusterName
(),
cla
)
c
.
assignments
.
SetClusterLoadAssignment
(
cla
.
GetClusterName
(),
cla
)
}
}
log
.
Debugf
(
"Endpoint discovery processed with %d resources, version %q and nonce %q"
,
len
(
resp
.
GetResources
()),
c
.
Version
(
edsURL
),
c
.
Nonce
(
edsURL
))
// set our local administration and ack the reply. Empty version would signal NACK.
// set our local administration and ack the reply. Empty version would signal NACK.
c
.
SetNonce
(
edsURL
,
resp
.
GetNonce
())
c
.
SetNonce
(
edsURL
,
resp
.
GetNonce
())
c
.
SetVersion
(
edsURL
,
resp
.
GetVersionInfo
())
c
.
SetVersion
(
edsURL
,
resp
.
GetVersionInfo
())
log
.
Debugf
(
"Endpoint discovery processed with %d resources, version %q and nonce %q"
,
len
(
resp
.
GetResources
()),
c
.
Version
(
edsURL
),
c
.
Nonce
(
edsURL
))
EndpointGauge
.
Set
(
float64
(
len
(
resp
.
GetResources
())))
default
:
default
:
return
fmt
.
Errorf
(
"unknown response URL for discovery: %q"
,
resp
.
GetTypeUrl
())
return
fmt
.
Errorf
(
"unknown response URL for discovery: %q"
,
resp
.
GetTypeUrl
())
}
}
...
...
plugin/traffic/xds/metrics.go
View file @
503e0dc4
...
@@ -14,4 +14,10 @@ var (
...
@@ -14,4 +14,10 @@ var (
Name
:
"clusters_tracked"
,
Name
:
"clusters_tracked"
,
Help
:
"Gauge of tracked clusters."
,
Help
:
"Gauge of tracked clusters."
,
})
})
EndpointGauge
=
prometheus
.
NewGauge
(
prometheus
.
GaugeOpts
{
Namespace
:
plugin
.
Namespace
,
Subsystem
:
"traffic"
,
Name
:
"endpoints_tracked"
,
Help
:
"Gauge of all tracked endpoints."
,
})
)
)
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