Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace references to /_opendistro with /_plugins #16

Merged
merged 3 commits into from
May 21, 2021
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,12 +128,12 @@ Once the cluster is up and running, you will need to enable Performance Analyzer

1. Enable Performance Analyzer

`curl localhost:9200/_opendistro/_performanceanalyzer/cluster/config -H 'Content-Type: application/json' -d '{"enabled": true}' `
`curl localhost:9200/_plugins/_performanceanalyzer/cluster/config -H 'Content-Type: application/json' -d '{"enabled": true}' `

2. Enable RCA Framework

`curl localhost:9200/_opendistro/_performanceanalyzer/rca/cluster/config -H 'Content-Type: application/json' -d '{"enabled": true}' `
`curl localhost:9200/_plugins/_performanceanalyzer/rca/cluster/config -H 'Content-Type: application/json' -d '{"enabled": true}' `

3. Verify the Settings
`curl -XGET localhost:9200/_opendistro/_performanceanalyzer/cluster/config`.
`curl -XGET localhost:9200/_plugins/_performanceanalyzer/cluster/config`.
It should give you `{"currentPerformanceAnalyzerClusterState":3}`
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,11 @@ __Tags__: Tags are key-value pairs that are specified in the configuration file(
## Rest API to get the RCAs
* To get response for all the available RCA, use:
```
curl --url "localhost:9650/_opendistro/_performanceanalyzer/rca" -XGET
curl --url "localhost:9600/_plugins/_performanceanalyzer/rca" -XGET
```
* To get response for a specific RCA, use:
```
curl --url "localhost:9650/_opendistro/_performanceanalyzer/rca?name=HighHeapUsageClusterRca" -XGET
curl --url "localhost:9650/_plugins/_performanceanalyzer/rca?name=HighHeapUsageClusterRca" -XGET
jotok marked this conversation as resolved.
Show resolved Hide resolved
```
The sample RCA response from above api
```
Expand Down Expand Up @@ -117,18 +117,18 @@ There are ways to get the temperature profile of a cluster and of individual nod

The cluster level RCA can only be queried from the elected master using the following rest API.

`curl "localhost:9600/_opendistro/_performanceanalyzer/rca?name=ClusterTemperatureRca"`
`curl "localhost:9600/_plugins/_performanceanalyzer/rca?name=ClusterTemperatureRca"`

In order to get the temperature of a particular node, we can use:

`curl "localhost:9600/_opendistro/_performanceanalyzer/rca?name=AllTemperatureDimensions&local=true"`
`curl "localhost:9600/_plugins/_performanceanalyzer/rca?name=AllTemperatureDimensions&local=true"`

## Rest API to get the ACTIONS suggested by the decider

This api returns the last suggested action set by the decider framework.

```
curl --url "localhost:9650/_opendistro/_performanceanalyzer/actions" -XGET
curl --url "localhost:9650/_plugins/_performanceanalyzer/actions" -XGET
jotok marked this conversation as resolved.
Show resolved Hide resolved
```

The sample response from the above API:
Expand Down
6 changes: 3 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -581,15 +581,15 @@ def openSearchUpChecker = {
// Attempts to enable PA for up to 2 minutes. Returns when PA is successfully enabled or
// throws an Exception if the timeout is exceeded
def paUpChecker = {
String server = "localhost:9200/_opendistro/_performanceanalyzer/cluster/config"
String server = "localhost:9200/_plugins/_performanceanalyzer/cluster/config"
int timeoutSeconds = 2 * 60
enableComponent(server, 1, timeoutSeconds)
}

// Attempts to enable RCA for up to 2 minutes. Returns when RCA is successfully enabled or
// throws an Exception if the timeout is exceeded
def rcaUpChecker = {
String server = "localhost:9200/_opendistro/_performanceanalyzer/rca/cluster/config"
String server = "localhost:9200/_plugins/_performanceanalyzer/rca/cluster/config"
int timeoutSeconds = 2 * 60
enableComponent(server, 3, timeoutSeconds)
}
Expand Down Expand Up @@ -714,7 +714,7 @@ task runRally {
while (true) {
runCommand(opensearchrally, null, wdir, true)
println('Get all RCAs using:')
println('curl localhost:9600/_opendistro/_performanceanalyzer/rca?all | python -m json.tool')
println('curl localhost:9600/_plugins/_performanceanalyzer/rca?all | python -m json.tool')
Thread.sleep(1000)
}
}
Expand Down
12 changes: 6 additions & 6 deletions docs/batch-metrics-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,17 @@ All the raw metrics data from a period of time may be too high granularity for s
## API

**performance-analyzer.properties**
* retention-period: The number of minutes worth of metrics data to collect. The configured retention period can be read via the “/_opendistro/performanceanalyzer/batch/config” api. Default=7 (7 minutes), min=1, max = 60.
* retention-period: The number of minutes worth of metrics data to collect. The configured retention period can be read via the “/_plugins/performanceanalyzer/batch/config” api. Default=7 (7 minutes), min=1, max = 60.
* Note, the default is 7 minutes because a typical use-case would be to query for 5 minutes worth of data from the node. In order to do this, a client would actually select a starttime of now-6min and an endtime of now-1min (this one minute offset will give sufficient time for the metrics in the time range to be available at the node). Atop this 6 minutes of retention, we need an extra 1 minute of retention to account for the time that would have passed by the time the query arrives at the node, and for the fact that starttime and endtime will be rounded down to the nearest samplingperiod.

**API**

Queries:

* POST \<endpoint\>:9200/_opendistro/performanceanalyzer/batch/config -H ‘Content-Type: application/json’ -d ‘{“enabled”: true}’
* POST \<endpoint\>:9200/_opendistro/performanceanalyzer/batch/cluster/config -H ‘Content-Type: application/json’ -d ‘{“enabled”: true}’
* GET \<endpoint\>:9200/_opendistro/_performanceanalyzer/_agent/batch?metrics=\<metrics\>&starttime=\<starttime\>&endtime=\<endtime\>&samplingperiod=\<samplingperiod\>
* GET \<endpoint\>:9600/_opendistro/_performanceanalyzer/batch?metrics=\<metrics\>&starttime=\<starttime\>&endtime=\<endtime\>&samplingperiod=\<samplingperiod\>
* POST \<endpoint\>:9200/_plugins/performanceanalyzer/batch/config -H ‘Content-Type: application/json’ -d ‘{“enabled”: true}’
* POST \<endpoint\>:9200/_plugins/performanceanalyzer/batch/cluster/config -H ‘Content-Type: application/json’ -d ‘{“enabled”: true}’
* GET \<endpoint\>:9200/_plugins/_performanceanalyzer/_agent/batch?metrics=\<metrics\>&starttime=\<starttime\>&endtime=\<endtime\>&samplingperiod=\<samplingperiod\>
* GET \<endpoint\>:9600/_plugins/_performanceanalyzer/batch?metrics=\<metrics\>&starttime=\<starttime\>&endtime=\<endtime\>&samplingperiod=\<samplingperiod\>

Parameters:
* metrics - Comma separated list of metrics you are interested in. For a full list of metrics, see Metrics Reference.
Expand All @@ -43,7 +43,7 @@ Note, the maximum number of datapoints that a single query can request for via A

Sample Query:

GET localhost:9600/_opendistro/_performanceanalyzer/batch?metrics=CPU_Utilization,IO_TotThroughput&starttime=1594412250000&endtime=1594412260000&samplingperiod=5
GET localhost:9600/_plugins/_performanceanalyzer/batch?metrics=CPU_Utilization,IO_TotThroughput&starttime=1594412250000&endtime=1594412260000&samplingperiod=5

Output
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@
public class PerformanceAnalyzerApp {

private static final int EXCEPTION_QUEUE_LENGTH = 1;
public static final String QUERY_URL = "/_opendistro/_performanceanalyzer/metrics";
public static final String BATCH_METRICS_URL = "/_opendistro/_performanceanalyzer/batch";
public static final String QUERY_URL = "/_plugins/_performanceanalyzer/metrics";
public static final String BATCH_METRICS_URL = "/_plugins/_performanceanalyzer/batch";
private static final Logger LOG = LogManager.getLogger(PerformanceAnalyzerApp.class);
private static final ScheduledMetricCollectorsExecutor METRIC_COLLECTOR_EXECUTOR =
new ScheduledMetricCollectorsExecutor(1, false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@

public class Util {
private static final Logger LOG = LogManager.getLogger(Util.class);
public static final String METRICS_QUERY_URL = "/_opendistro/_performanceanalyzer/metrics";
public static final String RCA_QUERY_URL = "/_opendistro/_performanceanalyzer/rca";
public static final String ACTIONS_QUERY_URL = "/_opendistro/_performanceanalyzer/actions";
public static final String METRICS_QUERY_URL = "/_plugins/_performanceanalyzer/metrics";
public static final String RCA_QUERY_URL = "/_plugins/_performanceanalyzer/rca";
public static final String ACTIONS_QUERY_URL = "/_plugins/_performanceanalyzer/actions";
public static final String OPENSEARCH_HOME = System.getProperty("opensearch.path.home");
public static final String PLUGIN_LOCATION =
OPENSEARCH_HOME
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@

/**
* Request Handler that supports querying the latest action set
*
* spotless:off
* <p>To get the response for the latest action set suggested via DM Framework curl --url
* "localhost:9600/_opendistro/_performanceanalyzer/actions" -XGET @<code>
* "localhost:9600/_plugins/_performanceanalyzer/actions" -XGET @<code>
* {
* "LastSuggestedActionSet": [
* {
Expand All @@ -76,6 +76,7 @@
* }
*
* </code>
* spotless:on
*
* <p>
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,10 @@
* Request handler that supports querying batch metrics from an EC2 instance
*
* <p>Return 1 minute of CPU_Utilization metrics sampled at a 5s sampling period:
* "http://localhost:9600/_opendistro/_performanceanalyzer/batch?metrics=CPU_Utilization&starttime=1566413975000&endtime=1566413980000"
* "http://localhost:9600/_plugins/_performanceanalyzer/batch?metrics=CPU_Utilization&starttime=1566413975000&endtime=1566413980000"
*
* <p>Return 1 minute of CPU_Utilization and Latency metrics sampled at a 10s sampling period:
* "http://localhost:9600/_opendistro/_performanceanalyzer/batch?metrics=CPU_Utilization,Latency&starttime=1566413975000&endtime=1566413980000&samplingperiod=10"
* "http://localhost:9600/_plugins/_performanceanalyzer/batch?metrics=CPU_Utilization,Latency&starttime=1566413975000&endtime=1566413980000&samplingperiod=10"
*
* <p>Return format: { "1594412650000": { "CPU_Utilization": { "fields": [ { "name: "IndexName",
* "type": "VARCHAR" }, <...> ] "records": [ [ "pmc", <...> ], <...> ] } } }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,30 +54,29 @@
* Request handler that supports querying RCAs
*
* <p>To dump all RCA related tables from SQL : curl --url
* "localhost:9650/_opendistro/_performanceanalyzer/rca?all" -XGET
* "localhost:9650/_plugins/_performanceanalyzer/rca?all" -XGET
jotok marked this conversation as resolved.
Show resolved Hide resolved
*
* <p>To get response for all the available RCA, use: curl --url
* "localhost:9650/_opendistro/_performanceanalyzer/rca" -XGET
* "localhost:9650/_plugins/_performanceanalyzer/rca" -XGET
*
* <p>To get response for a specific RCA, use: curl --url
* "localhost:9650/_opendistro/_performanceanalyzer/rca?name=HighHeapUsageClusterRca" -XGET
* "localhost:9650/_plugins/_performanceanalyzer/rca?name=HighHeapUsageClusterRca" -XGET
jotok marked this conversation as resolved.
Show resolved Hide resolved
*
* <p>For temperature profiles, one can get the local node temperature using a request url as: curl
* "localhost:9600/_opendistro/_performanceanalyzer/rca?name=NodeTemperatureRca&local=true"
* "localhost:9600/_plugins/_performanceanalyzer/rca?name=NodeTemperatureRca&local=true"
*
* <p>The cluster level RCA can only be queried from the elected master using this rest API: curl
* "localhost:9600/_opendistro/_performanceanalyzer/rca?name=ClusterTemperatureRca"
* "localhost:9600/_plugins/_performanceanalyzer/rca?name=ClusterTemperatureRca"
*
* <p>curl
* "localhost:9600/_opendistro/_performanceanalyzer/rca?name=NodeTemperatureRca&local=true"|jq {
* "NodeTemperatureRca": [ { "rca_name": "NodeTemperatureRca", "timestamp": 1589592178829, "state":
* "unknown", "CompactNodeSummary": [ { "node_id": "v9_TNhEeSP2Q3DJO8fd6BA", "host_address":
* "172.17.0.2", "CPU_Utilization_mean": 0, "CPU_Utilization_total": 0.0310837676896351,
* "CPU_Utilization_num_shards": 2, "Heap_AllocRate_mean": 0, "Heap_AllocRate_total":
* 4021355.87442904, "Heap_AllocRate_num_shards": 2, "IO_READ_SYSCALL_RATE_mean": 0,
* "IO_READ_SYSCALL_RATE_total": 0, "IO_READ_SYSCALL_RATE_num_shards": 0,
* "IO_WriteSyscallRate_mean": 0, "IO_WriteSyscallRate_total": 0, "IO_WriteSyscallRate_num_shards":
* 0 } ] } ] }
* <p>curl "localhost:9600/_plugins/_performanceanalyzer/rca?name=NodeTemperatureRca&local=true"|jq
* { "NodeTemperatureRca": [ { "rca_name": "NodeTemperatureRca", "timestamp": 1589592178829,
* "state": "unknown", "CompactNodeSummary": [ { "node_id": "v9_TNhEeSP2Q3DJO8fd6BA",
* "host_address": "172.17.0.2", "CPU_Utilization_mean": 0, "CPU_Utilization_total":
* 0.0310837676896351, "CPU_Utilization_num_shards": 2, "Heap_AllocRate_mean": 0,
* "Heap_AllocRate_total": 4021355.87442904, "Heap_AllocRate_num_shards": 2,
* "IO_READ_SYSCALL_RATE_mean": 0, "IO_READ_SYSCALL_RATE_total": 0,
* "IO_READ_SYSCALL_RATE_num_shards": 0, "IO_WriteSyscallRate_mean": 0, "IO_WriteSyscallRate_total":
* 0, "IO_WriteSyscallRate_num_shards": 0 } ] } ] }
*/
public class QueryRcaRequestHandler extends MetricsHandler implements HttpHandler {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public void setUp() throws IOException {
handler = new QueryBatchRequestHandler(null, new MetricsRestUtil());
rootLocation = "build/resources/test/reader/";
setBatchMetricsEnabled(false);
queryPrefix = "http://localhost:9600/_opendistro/_performanceanalyzer/batch?";
queryPrefix = "http://localhost:9600/_plugins/_performanceanalyzer/batch?";
timestamp = 1566413970000L;
}

Expand Down