-
Notifications
You must be signed in to change notification settings - Fork 818
Add PlatformCollector to collect information about the platform #152
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
Conversation
Python, machine and system information is collected once at startup, and exposed as labels on a metric with value 1.
Machine level information should come from the node exporter, it's not the concern of a python application. Cut this down to just the python stuff. |
Yeah, I can see the point about the machine info, I'll remove that. I'll remove the windows, linux, darwin stuff too, as that is also something the node exporter can handle. What do you think about the java info? If you are using jython, which java version your application is using becomes relevant, and it's not something the node exporter can tell you (it might tell you which java versions are installed, but not necessarily which one is used to run your application). |
Keeping Jython stats makes sense. There's an open question on how to handle a mix of Jython and client_java stats, but noone has asked about it yet. |
def _java(self): | ||
java_version, _, vminfo, osinfo = self._platform.java_ver() | ||
vm_name, vm_release, vm_vendor = vminfo | ||
system, kernel, _ = osinfo |
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 unused
|
||
|
||
class PlatformCollector(object): | ||
"""Collector for platform information""" |
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.
"Python platform" would be a little clearer.
Thanks! |
In the same vein as prometheus/client_java@bdc6f25 and siimon/prom-client@ee561e2, this PR adds Python version and some other metadata as labels on a small set of metrics.
This has turned out to be very useful for creating common dashboards across implementation languages, allowing the dashboard to extract metadata from the metrics exposed.
Python, machine and system information is collected once at startup, and
exposed as labels on a metric with value 1.