Hello,
I'm trying to register io.prometheus.client.filter.MetricsFilter for Prometheus
metrics.
I'm trying to call registerFilter() with many possible url patterns, but none
seem to have any affect:
@Override
public void start(BundleContext context) throws Exception
{
webContainerTracker = new WebContainerTracker(context);
webContainerTracker.open();
}
@Override
public Object addingService(ServiceReference reference)
{
WebContainer webContainer = (WebContainer) context.getService(reference);
this.metricsFilter = new MetricsFilter();
webContainer.registerFilter(metricsFilter, new String[]{"/", "*", "/*"},
null, null, false, null);
return webContainer;
}
Expected behavior:
Any request to Karaf, including opening WebConsole, would land me in
MetricsFilter.doFilter breakpoint
Observed behavior:
Nothing, even init() method is not called.
Do wildcards are supported by WebContainer for registering filters? Or not
every request goes through that filters, and I'd need to register filter on
jetty directly? (how?, Jetty seems not to be exposed in OSGi context).
I'm using JaxRS-Publisher that registers servlets using
HttpService.addServlet() (and WebContainer is the only available
implementation).
WebConsole also uses WebContainer, so I assume, it must register servlets also
using that method.
Where is the problem? What I'm doing wrong?
Best regards,
Lukasz Lech
--
--
------------------
OPS4J - http://www.ops4j.org - [email protected]
---
You received this message because you are subscribed to the Google Groups
"OPS4J" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.