How does /monitoring skip starting splash page?

30 views
Skip to first unread message

Michael Carter

unread,
Feb 7, 2023, 2:46:56 PM2/7/23
to Jenkins Developers
Short version I've got a custom prometheus stats page for my plugin.  But I want to make it available early.  How does the /monitoring plugin skip the starting splash page?  Want to do the same thing?

Gavin Mogan

unread,
Feb 8, 2023, 2:02:38 AM2/8/23
to jenkin...@googlegroups.com
Can you share code? I would assume a root action with no auth wouldn't care about ... wait when you say splash screen, do you mean the "jenkins is starting up" or the "welcome wizard"? I would assume a root action wouldn't care about the welcome wizard, but the starting up screen my only guess is you have to have some sort of init hook that changes the order of things.

https://github.com/jenkinsci/prometheus-plugin/blob/master/src/main/java/org/jenkinsci/plugins/prometheus/rest/PrometheusAction.java says unprotecetedrootaction, which probably means it doesn't wait for auth/acl to startup

But these are just guesses

On Tue, Feb 7, 2023 at 11:47 AM Michael Carter <mikeyca...@gmail.com> wrote:
Short version I've got a custom prometheus stats page for my plugin.  But I want to make it available early.  How does the /monitoring plugin skip the starting splash page?  Want to do the same thing?

--
You received this message because you are subscribed to the Google Groups "Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-de...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/dc9615d5-8840-4c30-b3f2-da956124d281n%40googlegroups.com.

Jesse Glick

unread,
Feb 8, 2023, 7:38:38 AM2/8/23
to jenkin...@googlegroups.com
It may be possible by calling `PluginServletFilter` in an `@Initializer`, as filters will be consulted before the request is even routed to Stapler (where the `HudsonIsLoading` object is installed until startup completes and it is replaced with the `Jenkins` singleton). Remember that, among other things, you are bypassing authentication checks (requests may be anonymous), so this is only appropriate for carefully vetted code and non-sensitive data.

Michael Carter

unread,
Feb 8, 2023, 8:47:11 AM2/8/23
to Jenkins Developers
"jenkins is starting up" is the screen I'm talking about.   https://plugins.jenkins.io/monitoring/ is available before the init level of COMPLETED is reached so you can troubleshoot things as jenkins is starting up.   Analyzed their code and couldn't quite figure out what allows them to do it.

They do have stuff in there about the crumb and security so maybe that's what is allowing it.   

Daniel Beck

unread,
Feb 8, 2023, 8:55:35 AM2/8/23
to jenkin...@googlegroups.com
PluginImpl#start adds HudsonMonitoringFilter to the PluginServletFilter list, which should be happening before PLUGINS_STARTED, so it doesn't wait for items to load etc.

Jesse Glick

unread,
Feb 8, 2023, 9:55:13 AM2/8/23
to jenkin...@googlegroups.com
On Wed, Feb 8, 2023 at 8:55 AM 'Daniel Beck' via Jenkins Developers <jenkin...@googlegroups.com> wrote:
PluginImpl#start adds…

Yes, as I wrote, but please bear in mind that `Plugin.start` is deprecated—use `@Initializer` instead.
Reply all
Reply to author
Forward
0 new messages