-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
processcollector: Add support for Darwin platform. #1590
Comments
#1600 handles most of this, but I didn't add |
Yea, ideally none of those There is always option for others (or us) to create a separate module for darwin statistics/collector. Here we aim for something standard, good enough for majority of users. Thanks! |
Can you describe this in a little more please? I think I'm missing something here. (If there's a better forum for a wider discussion, we can move it there). To be clear when I said "undocumented API", I meant from Apple, not something in Go. I think the fundamental problem here is that there's no built-in mechanism in Go to call into random system libraries like there is on Windows (AFAICT), and they've been resistant to adding that support[1][2]. Given that restriction, we can't access the (undocumented) Apple APIs for getting this info without either cgo or a 3rd party mechanism. (Maybe the Placing this code in another module would just seem to shift the problem, and create additional problems in that I don't care too much about the network transfer counters, but the memory usage ones helped me find a memory leak on Windows, so those are worth jumping through some hoops IMHO. I think there are build tags to detect if cgo is enabled, so maybe it can be done in cgo, with a corresponding Go function that causes the metric(s) to not be emitted when cgo is not enabled? Not as nice as just working everywhere, but it would still allow me to cross compile for local builds if I don't care about those metrics at the time. [1] golang/go#18296 |
Not a high priority but we could implement metrics for MacOS e.g. using
sysctl
. Currently we error out (silently by default).The text was updated successfully, but these errors were encountered: