-
Notifications
You must be signed in to change notification settings - Fork 930
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Send OVN logs to events API and Loki #12200
Send OVN logs to events API and Loki #12200
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM but I'm curious to hear your opinion on the seek
approach.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should not re-read the whole log file(s) each time they change.
7b7cb64
to
dded3dc
Compare
@monstermunchkin when you're ready for another review please can you click the refresh review button on my name top right so that I get a notification and it'll appear on my todo list on https://github.com/pulls/review-requested Thanks |
dded3dc
to
e45c5c0
Compare
84ef3bc
to
f308765
Compare
@tomponline @monstermunchkin ovn supports streaming logs to a Unix socket using syslog protocol. Would it be simpler to stream those through LXD then to Loki? That would avoid writing them to disk to read them back. |
That would be preferable by the sounds of it, do you have more details on how this works in a cluster? |
That's a good question re cluster, one I cannot answer. All I saw is https://www.man7.org/linux/man-pages/man8/ovn-controller.8.html which also mentions log levels can changed dynamically using |
I've been playing around with the unix socket thing but didn't manage to get it working. I wasn't receiving any log messages for some reason. However, what I did get working is OVN sending logs via UDP using |
Sounds promising. Although this approach would require more setup in ovn, it would avoid needing special microovn handling, and we could get microcloud to make the necessary configuration changes in both microovn and lxd during setup. |
24ea749
to
d99762a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is also missing the tests we discussed adding in our 1:1 wrt to using nc to send messages to the syslog listener and checking they appear in the lxc monitor.
2a70e56
to
da00eca
Compare
@monstermunchkin please let me know when tests pass and ill re-review. Thanks |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some fixes.
Signed-off-by: Thomas Hipp <thomas.hipp@canonical.com>
Signed-off-by: Thomas Hipp <thomas.hipp@canonical.com>
992f557
to
f682199
Compare
Signed-off-by: Thomas Hipp <thomas.hipp@canonical.com>
Signed-off-by: Thomas Hipp <thomas.hipp@canonical.com>
Signed-off-by: Thomas Hipp <thomas.hipp@canonical.com>
Signed-off-by: Thomas Hipp <thomas.hipp@canonical.com>
Signed-off-by: Thomas Hipp <thomas.hipp@canonical.com>
Signed-off-by: Thomas Hipp <thomas.hipp@canonical.com>
6586560
to
2dd5489
Compare
This adds the following words to the wordlist * lxc * syslog * unixgram Signed-off-by: Thomas Hipp <thomas.hipp@canonical.com>
Signed-off-by: Thomas Hipp <thomas.hipp@canonical.com>
Signed-off-by: Thomas Hipp <thomas.hipp@canonical.com>
Signed-off-by: Thomas Hipp <thomas.hipp@canonical.com>
Signed-off-by: Thomas Hipp <thomas.hipp@canonical.com>
2dd5489
to
0515097
Compare
@tomponline all tests have passed. |
LGTM thanks |
This adds an OVN log monitor which listens for log messages on a unix socket. If messages are received, they are sent to the events API which will then forward them to Loki (if configured). The log monitor can be enabled by setting
core.syslog_socket
totrue
. The logs will only be sent to Loki, ifloki.types
containsovn
.In this case, the
ovn
events can also be monitored usinglxc monitor --type=ovn
.Setting up OVN
On Ubuntu, OVN uses the
/etc/default/ovn-host
environment file. To enable the OVN controller to send their logs via unix socket, one needs to add the following:There are also
--ovn-sb-log
and--ovn-nb-log
which take the same arguments. These need to be set in/etc/default/ovn-central
though.Specification https://discourse.ubuntu.com/t/send-ovn-logs-to-the-events-api/38445