-
Notifications
You must be signed in to change notification settings - Fork 10
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
Add Prometheus monitoring endpoint #28
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.
Do you have ideas of metrics to add?
Sorry for the delay; I've now added a middleware to have include metrics on the syscalls made and a small histogram. Note this is useful even without the middleware, just being able to monitor the process is running via metrics and the Go level metrics can be useful. |
Currently this has no specific metrics for seccompagent, aside from Go built-in build info.
This adds an optional middleware to get Prometheus metrics for request latencies as a histogram.
@alban can you please take a look again? |
}).Error("Error in decoding syscall") | ||
} | ||
|
||
r := h(fd, req) |
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.
I think this is not measuring the duration of the syscall by the target process, but how long the seccomp agent takes to emulate the syscall (if such a handler is used for emulating the syscall).
I am curious about your use case and what syscall you emulate.
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.
The main one is allowing mount, we have a few more changes (I will open PRs for those soon) to allow network filesystems and that's definitely a place where these metrics are useful.
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, thanks.
I am pondering removing the vendor directory from git. But that's unrelated to this PR.
Add Prometheus monitoring endpoint
Adds an optional HTTP server, with a metrics endpoint available on
/metrics
. This allows for Prometheus compatible metrics to be collected; currently it adds no metrics specific to seccompagent, but those could be added later.This adds a dependency on github.com/prometheus/client_golang, I've updated vendoring as a result (in a different commit, ideally don't squash merge this to keep the history clearer).
How to use
Run seccompagent with the monitor listen option set to a port.
Testing done