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

Move servlet adapters to an internal package to avoid duplicating classes when building OSGi bundles #789

Merged
merged 2 commits into from
Jun 14, 2022

Conversation

adessaigne
Copy link
Contributor

@adessaigne adessaigne commented Jun 1, 2022

This fixes #771

OSGi requires that any particular package is exposed by only one bundle (jar). With the Adapter class directly in the root io.prometheus.simpleclient it was copying all the other classes from this particular package and so copying the classes from simpleclient. I've chosen io.prometheus.simpleclient.internal as no package named internal is exported by default in OSGi. So, in OSGi environments, this class will only be visible by MetricsServlet and MetricsFilter

I've also included a fix of a typo that was preventing the adapter class to work as expected.

…sses when building OSGi bundles

Signed-off-by: Antoine DESSAIGNE <antoine.dessaigne@gmail.com>
Signed-off-by: Antoine DESSAIGNE <antoine.dessaigne@gmail.com>
@fstab
Copy link
Member

fstab commented Jun 13, 2022

Thanks a lot for figuring this out. I am considering to start a 1.0 release branch. We could use this for breaking changes, like refactoring the module and package structure to make sure there's only one module for each package.

What do you think, if we start a 1.0 branch, how should it be structured?

@adessaigne
Copy link
Contributor Author

adessaigne commented Jun 13, 2022

Hi Fabian, thanks for having a look at this pull request.

Even if I moved around the Adapter class I don't think that it can be considered as breaking change as no one should call this class directly.

As for the 1.0 branch I'm not familiar enough with the codebase to make informed decision but I'll gladly help.

Note: I wrongly closed this pull request because I have big fingers on a small smartphone screen...

@adessaigne adessaigne closed this Jun 13, 2022
@adessaigne adessaigne reopened this Jun 13, 2022
@fstab fstab merged commit 75baa06 into prometheus:master Jun 14, 2022
@fstab
Copy link
Member

fstab commented Jun 14, 2022

Thanks, I merged it.

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.

simpleclient_servlet duplicates classes from simpleclient.jar starting in 0.12
2 participants