afs commented on a change in pull request #534: [WIP] Proof of concept for
prometheus endpoint
URL: https://github.com/apache/jena/pull/534#discussion_r272513825
##########
File path:
jena-fuseki2/jena-fuseki-core/src/main/java/org/apache/jena/fuseki/metrics/SimpleMetricsProvider.java
##########
@@ -33,7 +34,8 @@ public MeterRegistry getMeterRegistry() {
@Override
public void scrape(HttpAction action) {
- ServletOps.errorNotImplemented( "SimpleMeterRegistry isn't scrapeable"
);
+ ServletOps.responseSendError(action.response,
HttpSC.NOT_IMPLEMENTED_501,
+ "SimpleMeterRegistry isn't scrapeable" );
Review comment:
Something strange is going on.
`ServletOps.errorNotImplemented` should do that via throwing
`ActionErrorException` which is caught in `ActionBase`. Ah -
`ActionMetrics.doGet` is doing it's own thing not using the common lifecycle.
Using `ServletOps.errorNotImplemented` and the `ActionMetrics` below for the
common execution c. Is there anything in the lifecycle that was a problem?
```
public class ActionMetrics extends ActionCtl {
public ActionMetrics() { }
@Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp)
throws ServletException, IOException {
super.doCommon(req, resp);
}
@Override
protected void perform(HttpAction action) {
MetricsProviderRegistry.get().scrape( action );
}
}
```
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services