Skip to content

Commit

Permalink
Include createContext fix
Browse files Browse the repository at this point in the history
Signed-off-by: Craig Perkins <[email protected]>
  • Loading branch information
cwperks committed Oct 24, 2024
1 parent 9ecdb9b commit 176bd41
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public class Util {
private static final Logger LOG = LogManager.getLogger(Util.class);

public static final String PA_BASE_URL = "/_plugins/_performanceanalyzer";
public static final String LEGACY_OPENDISTRO_PA_BASE_URL = PA_BASE_URL;
public static final String LEGACY_OPENDISTRO_PA_BASE_URL = "/_opendistro/_performanceanalyzer";

public static final String METRICS_QUERY_URL = PA_BASE_URL + "/metrics";
public static final String LEGACY_OPENDISTRO_METRICS_QUERY_URL =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -527,14 +527,36 @@ public RCAScheduler getRcaScheduler() {
}

private void addRcaRequestHandler() {
httpServer.createContext(Util.RCA_QUERY_URL, queryRcaRequestHandler);
httpServer.createContext(Util.LEGACY_OPENDISTRO_RCA_QUERY_URL, queryRcaRequestHandler);
try {
httpServer.createContext(Util.RCA_QUERY_URL, queryRcaRequestHandler);
} catch (IllegalArgumentException e) {
LOG.error("unable to create context in http server for URL: " + Util.RCA_QUERY_URL);
}

try {
httpServer.createContext(Util.LEGACY_OPENDISTRO_RCA_QUERY_URL, queryRcaRequestHandler);
} catch (IllegalArgumentException e) {
LOG.error(
"unable to create context in http server for URL: "
+ Util.LEGACY_OPENDISTRO_RCA_QUERY_URL);
}
}

private void addActionsRequestHandler() {
httpServer.createContext(Util.ACTIONS_QUERY_URL, queryActionRequestHandler);
httpServer.createContext(
Util.LEGACY_OPENDISTRO_ACTIONS_QUERY_URL, queryActionRequestHandler);
try {
httpServer.createContext(Util.ACTIONS_QUERY_URL, queryActionRequestHandler);
} catch (IllegalArgumentException e) {
LOG.error("unable to create context in http server for URL: " + Util.ACTIONS_QUERY_URL);
}

try {
httpServer.createContext(
Util.LEGACY_OPENDISTRO_ACTIONS_QUERY_URL, queryActionRequestHandler);
} catch (IllegalArgumentException e) {
LOG.error(
"unable to create context in http server for URL: "
+ Util.LEGACY_OPENDISTRO_ACTIONS_QUERY_URL);
}
}

public void setDeliberateInterrupt() {
Expand Down

0 comments on commit 176bd41

Please sign in to comment.