Thanks to visit codestin.com
Credit goes to github.com

Skip to content

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

Merged
merged 6 commits into from
Mar 30, 2017
Merged

Add PlatformCollector to collect information about the platform #152

merged 6 commits into from
Mar 30, 2017

Conversation

mortenlj
Copy link
Contributor

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.

Python, machine and system information is collected once at startup, and
exposed as labels on a metric with value 1.
@brian-brazil
Copy link
Contributor

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.

@mortenlj
Copy link
Contributor Author

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).

@brian-brazil
Copy link
Contributor

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
Copy link
Contributor

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"""
Copy link
Contributor

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.

@brian-brazil brian-brazil merged commit 91171a0 into prometheus:master Mar 30, 2017
@brian-brazil
Copy link
Contributor

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants