Hello
if you want global filters or prometheus integration (I imagine it like
>> single endpoint, like /health or /metrics or something) you could try doing
>> something container (jetty/undertow/tomcat) specific. Tomcat has valves,
>> jetty and undertow have handlers - you can look at the code to check how
>> for example NSCA logging interceptor/handler/valve is implemented.
>>
>
> What would be the right place to register my handler directly on Jetty?
>
> It is somewhere created internally in Pax-Web and it is not exposed to
> OSGi context....
>
I didn't check it, but you could try adding some additional handlers in
etc/jetty.xml (in Karaf). Something like:
<Configure id="Server" class="org.eclipse.jetty.server.Server">
<Call name="addBean">
<Arg>
<New class="org.eclipse.jetty.server.Handler">
I'm not sure if it will work, but jetty.xml syntax is quite powerful. You
can add different "beans" to different objects.
Also I see that pax-web-jetty tracks instances of OSGi services for
org.eclipse.jetty.server.Handler - so you should be able to register your
own. See
org.ops4j.pax.web.service.jetty.internal.JettyServerImpl#addHandler() for
where it's used and how - it can even be prioritized.
The main handler (actually HandlerCollection) is
org.ops4j.pax.web.service.jetty.internal.JettyServerHandlerCollection and
when a handler is added to this collection, it'll be called - see here how
pax-web-jetty calls all the handlers
<https://github.com/ops4j/org.ops4j.pax.web/blob/pax-web-7.2.x/pax-web-jetty/src/main/java/org/ops4j/pax/web/service/jetty/internal/JettyServerHandlerCollection.java#L93-L105>
.
best regards
Grzegorz Grzybek
>
> 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.
>
--
--
------------------
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.