{{ message }}
Add PlatformCollector to collect information about the platform#152
Merged
Conversation
Python, machine and system information is collected once at startup, and exposed as labels on a metric with value 1.
Contributor
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). |
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 |
|
|
||
|
|
||
| class PlatformCollector(object): | ||
| """Collector for platform information""" |
Contributor
There was a problem hiding this comment.
"Python platform" would be a little clearer.
Contributor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

In the same vein as prometheus/client_java@bdc6f25 and prometheus/client_js@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.