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

Migrate Metrics extension to a vert.x route #4174

Merged
merged 1 commit into from
Sep 25, 2019

Conversation

jmartisk
Copy link
Contributor

@jmartisk jmartisk commented Sep 24, 2019

Fixes #4159

@gsmet gsmet added this to the 0.24.0 milestone Sep 24, 2019
Stream<String> acceptHeaders = request.headers().getAll("Accept").stream();

try {
internalHandler.handleRequest(request.path(), metricsPath, request.rawMethod(), acceptHeaders,
Copy link
Contributor

Choose a reason for hiding this comment

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

Is the logic inside the internalHandler.handleRequest() non-blocking? If so then OK, otherwise you should use HandlerType#BLOCKING instead.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok I added HandlerType#BLOCKING

Copy link
Member

Choose a reason for hiding this comment

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

I think it's safer to use "blocking" for now. While it could be non-blocking, it the user declare a metric where the computation is blocking that could have a terrible impact.

Copy link
Member

@gsmet gsmet left a comment

Choose a reason for hiding this comment

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

Added 2 minor comments.

@@ -65,7 +69,7 @@
static final class SmallRyeMetricsConfig {

/**
* The path to the metrics Servlet.
* The path to metrics handler.
Copy link
Member

Choose a reason for hiding this comment

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

Having the was better IMHO

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Right, my bad

@Record(STATIC_INIT)
void createRoute(BuildProducer<RouteBuildItem> routes,
SmallRyeMetricsRecorder recorder) {
SmallRyeMetricsHandler metricsHandler = new SmallRyeMetricsHandler();
Copy link
Member

Choose a reason for hiding this comment

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

Couldn't we push the path directly from config as a parameter?

The handler is then passed as a recorder parameter so we have to make sure it will work but a setter and a field would do it, I think.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I now changed it so that the handler is instantiated in the recorder and a setter is used to set the path

@geoand
Copy link
Contributor

geoand commented Sep 24, 2019

There is a weird CI failure that I've been trying to track down but so far I've been unable to pinpoint it. Would it be possible to rebase this onto the latest master and see if CI passes that way?

Doing so fixed similar issues I had. I think there was some kind of weird caching of artifacts on CI

@jmartisk
Copy link
Contributor Author

There is a weird CI failure that I've been trying to track down but so far I've been unable to pinpoint it. Would it be possible to rebase this onto the latest master and see if CI passes that way?

Doing so fixed similar issues I had. I think there was some kind of weird caching of artifacts on CI

Rebased. Fingers crossed :)

@cescoffier cescoffier changed the title Migrate Metrics extension to vert.x. Fixes #4159 Migrate Metrics extension to a vert.x route Sep 25, 2019
@gsmet gsmet merged commit cac589f into quarkusio:master Sep 25, 2019
@gsmet
Copy link
Member

gsmet commented Sep 25, 2019

Thanks @jmartisk !

@jmartisk jmartisk deleted the master-issue-4159 branch September 25, 2019 13:14
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.

Make Metrics extension use Vert.x instead of Servlets
5 participants