YARN-10970. Standby RM should expose prom endpoint (#3480)

Reviewed-by: Adam Antal <adamantal@apache.org>
Signed-off-by: Akira Ajisaka <aajisaka@apache.org>
This commit is contained in:
Neil 2021-09-29 14:46:55 +08:00 committed by GitHub
parent 51bd528bd3
commit 4bd0c36189
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 2 deletions

View File

@ -295,7 +295,7 @@ public void testRMWebAppRedirect() throws YarnException,
assertEquals(redirectURL,rm1Url + "/metrics"); assertEquals(redirectURL,rm1Url + "/metrics");
// standby RM links /conf, /stacks, /logLevel, /static, /logs, /jmx // standby RM links /conf, /stacks, /logLevel, /static, /logs, /jmx, /prom
// /cluster/cluster as well as webService // /cluster/cluster as well as webService
// /ws/v1/cluster/info should not be redirected to active RM // /ws/v1/cluster/info should not be redirected to active RM
redirectURL = getRedirectURL(rm2Url + "/cluster/cluster"); redirectURL = getRedirectURL(rm2Url + "/cluster/cluster");
@ -319,6 +319,9 @@ public void testRMWebAppRedirect() throws YarnException,
redirectURL = getRedirectURL(rm2Url + "/jmx?param1=value1+x&param2=y"); redirectURL = getRedirectURL(rm2Url + "/jmx?param1=value1+x&param2=y");
assertNull(redirectURL); assertNull(redirectURL);
redirectURL = getRedirectURL(rm2Url + "/prom");
assertNull(redirectURL);
redirectURL = getRedirectURL(rm2Url + "/ws/v1/cluster/info"); redirectURL = getRedirectURL(rm2Url + "/ws/v1/cluster/info");
assertNull(redirectURL); assertNull(redirectURL);

View File

@ -70,7 +70,7 @@ public class RMWebAppFilter extends GuiceContainer {
// define a set of URIs which do not need to do redirection // define a set of URIs which do not need to do redirection
private static final Set<String> NON_REDIRECTED_URIS = Sets.newHashSet( private static final Set<String> NON_REDIRECTED_URIS = Sets.newHashSet(
"/conf", "/stacks", "/logLevel", "/logs", IsActiveServlet.PATH_SPEC, "/conf", "/stacks", "/logLevel", "/logs", IsActiveServlet.PATH_SPEC,
"/jmx"); "/jmx", "/prom");
private String path; private String path;
private boolean ahsEnabled; private boolean ahsEnabled;
private String ahsPageURLPrefix; private String ahsPageURLPrefix;