Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Log agent connections/disconnections. #7557
Conversation
howbazaar
changed the base branch from
develop
to
2.2
Jun 27, 2017
|
!!retry!! |
|
$$merge$$ |
|
Status: merge request accepted. Url: http://juju-ci.vapour.ws:8080/job/github-merge-juju |
|
Build failed: Tests failed |
| +} | ||
| + | ||
| +func (n *RequestObserver) isAgent(entity names.Tag) bool { | ||
| + switch entity.(type) { |
| @@ -71,6 +93,9 @@ func (n *RequestObserver) Join(req *http.Request, connectionID uint64) { | ||
| // Leave implements Observer. | ||
| func (n *RequestObserver) Leave() { | ||
| + if n.state.agent { | ||
| + n.connLogger.Infof("agent disconnected: %s for %s", n.state.tag, n.state.model) |
jameinel
Jun 27, 2017
Owner
as a side note, I've seen some stuff that was using truncated model UUIds, and I wonder if we might want to do something standard about how to represent models that can be more human readable than a 36 character UUID. (Arguably model Name would be best, but truncated 10char UUID might be something more humane, though we'd want to do it consistently)
|
I was also wondering if we would want prometheus metrics for 'how many current agents' do we have/how many agent logins/disconnects have we had. |
|
$$try-again$$ |
|
Status: merge request accepted. Url: http://juju-ci.vapour.ws:8080/job/github-merge-juju |
|
Build failed: Tests failed |
|
$$again$$ |
|
Status: merge request accepted. Url: http://juju-ci.vapour.ws:8080/job/github-merge-juju |
|
Build failed: Tests failed |
|
This failed because some of the log messages moved from INFO to debug: |
|
$$now$$ |
|
Status: merge request accepted. Url: http://juju-ci.vapour.ws:8080/job/github-merge-juju |
howbazaar commentedJun 27, 2017
Description of change
While some information was logged before for connections and disconnections, it is often desirable to know which agents are connecting and disconnecting. This branch logs agent connections using a particular logging module, and at INFO level for ease of finding. This would help make it obvious if a particular agent was bouncing regularly.
Additional logging has been moved from INFO to DEBUG as it was a bit too verbose for an INFO logging controller.
QA steps
Bootstrap a controller, deploy some agents, then run this:
juju debug-log --include-module juju.apiserver.connectionDocumentation changes
I'm not sure this warrents doc changes.