Skip to content
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

Registering JMX Exporter build info #279

Merged
merged 2 commits into from
Jun 8, 2018
Merged

Registering JMX Exporter build info #279

merged 2 commits into from
Jun 8, 2018

Conversation

picadoh
Copy link
Contributor

@picadoh picadoh commented Jun 6, 2018

By adding the Implementation-Version manifest entry it is possible
to retrieve the lib version at runtime by checking the class Package.

This allows the tracking of which JVMs are running which versions of
the exporter.

Closes #278

By adding the Implementation-Version manifest entry it is possible
to retrieve the lib version at runtime by checking the class Package.

This allows the tracking of which JVMs are running which versions of
the exporter.

Closes #278

Signed-off-by: Hugo Picado <hugo.pcd@gmail.com>
@picadoh
Copy link
Contributor Author

picadoh commented Jun 6, 2018

Hi @brian-brazil. Would you please review this PR regarding #278?

@brian-brazil
Copy link
Contributor

Does this have to apply only to the agent, could it not work for the http server too?

@picadoh
Copy link
Contributor Author

picadoh commented Jun 7, 2018

@brian-brazil I was not able to retrieve the implementation-version from the http server package in the same way. Some research is required. I may open a new PR for that as soon as I find a solution for it. Is this ok?

@picadoh
Copy link
Contributor Author

picadoh commented Jun 7, 2018

@brian-brazil Actually, it works for the HTTP Server as well if we run through the fat jar, as I'm able to inject the version into the manifest through the assembly plugin. Shall I proceed with the changes to allow it in this PR?

@brian-brazil
Copy link
Contributor

Please go ahead.

import io.prometheus.client.Collector;
import io.prometheus.client.GaugeMetricFamily;

import java.util.*;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please be explicit in your imports

As now we are exporting the build info for different modules, besides
the version, the name of the module was also added so we can distinguish
between both.

Signed-off-by: Hugo Picado <hugo.pcd@gmail.com>

Closes #278
@picadoh
Copy link
Contributor Author

picadoh commented Jun 7, 2018

@brian-brazil I pushed the changes to enable this to HTTP Server as well. Also, besides the version, I included the name as it allows to distinguish between both the agent or the HTTP server. Could you please check?

@brian-brazil brian-brazil merged commit 2db4f0c into prometheus:master Jun 8, 2018
@brian-brazil
Copy link
Contributor

Thanks!

qinghui-xu pushed a commit to qinghui-xu/jmx_exporter that referenced this pull request Sep 18, 2020
* Registering JMX Exporter build info

By adding the Implementation-Version manifest entry it is possible
to retrieve the lib version at runtime by checking the class Package.

This allows the tracking of which JVMs are running which versions of
the exporter.

Closes prometheus#278

Signed-off-by: Hugo Picado <hugo.pcd@gmail.com>

* Registering jmx_exporter build info for HTTP Server

As now we are exporting the build info for different modules, besides
the version, the name of the module was also added so we can distinguish
between both.

Signed-off-by: Hugo Picado <hugo.pcd@gmail.com>

Closes prometheus#278
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