-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add flags of instance, endpoint and normal for metrics command (#76)
* Fix outdated doc Co-authored-by: kezhenxu94 <[email protected]>
- Loading branch information
1 parent
88b1874
commit ffee47d
Showing
9 changed files
with
88 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -160,12 +160,15 @@ Ascii Graph, like coloring in terminal, so please use `json` or `yaml` instead. | |
|
||
<details> | ||
|
||
<summary>metrics linear [--start=start-time] [--end=end-time] --name=metrics-name --service=service-name</summary> | ||
<summary>metrics linear [--start=start-time] [--end=end-time] --name=metrics-name --service=service-name [--instance=instance-name] [--endpoint=endpoint-name] [--isNormal=true/false]</summary> | ||
|
||
| option | description | default | | ||
| :--- | :--- | :--- | | ||
| `--name` | Metrics name, defined in [OAL](https://github.com/apache/skywalking/blob/master/oap-server/server-bootstrap/src/main/resources/oal/core.oal). | | ||
| `--service` | The name of the service. | "" | | ||
| `--instance` | The name of the service instance. | "" | | ||
| `--endpoint` | The name of the endpoint. | "" | | ||
| `--isNormal` | Set the service to normal or unnormal. | `true` | | ||
| `--start` | See [Common options](#common-options) | See [Common options](#common-options) | | ||
| `--end` | See [Common options](#common-options) | See [Common options](#common-options) | | ||
|
||
|
@@ -175,13 +178,16 @@ Ascii Graph, like coloring in terminal, so please use `json` or `yaml` instead. | |
|
||
<details> | ||
|
||
<summary>metrics multiple-linear [--start=start-time] [--end=end-time] --name=metrics-name [--service=service-name] [--num=number-of-linear-metrics]</summary> | ||
<summary>metrics multiple-linear [--start=start-time] [--end=end-time] --name=metrics-name [--service=service-name] [--num=number-of-linear-metrics] [--instance=instance-name] [--endpoint=endpoint-name] [--isNormal=true/false]</summary> | ||
|
||
| option | description | default | | ||
| :--- | :--- | :--- | | ||
| `--name` | Metrics name that ends with `_percentile`, defined in [OAL](https://github.com/apache/skywalking/blob/master/oap-server/server-bootstrap/src/main/resources/oal/core.oal), such as `all_percentile`, etc. | | ||
| `--service` | The name of the service, when scope is `All`, no name is required. | "" | | ||
| `--num` | Number of the linear metrics to fetch | `5` | | ||
| `--labels` | The labels you need to query | `0,1,2,3,4` | | ||
| `--instance` | The name of the service instance. | "" | | ||
| `--endpoint` | The name of the endpoint. | "" | | ||
| `--isNormal` | Set the service to normal or unnormal. | `true` | | ||
| `--start` | See [Common options](#common-options) | See [Common options](#common-options) | | ||
| `--end` | See [Common options](#common-options) | See [Common options](#common-options) | | ||
|
||
|
@@ -191,12 +197,15 @@ Ascii Graph, like coloring in terminal, so please use `json` or `yaml` instead. | |
|
||
<details> | ||
|
||
<summary>metrics single [--start=start-time] [--end=end-time] --name=metrics-name --service=service-name</summary> | ||
<summary>metrics single [--start=start-time] [--end=end-time] --name=metrics-name --service=service-name [--instance=instance-name] [--endpoint=endpoint-name] [--isNormal=true/false]</summary> | ||
|
||
| option | description | default | | ||
| :--- | :--- | :--- | | ||
| `--name` | Metrics name, defined in [OAL](https://github.com/apache/skywalking/blob/master/oap-server/server-bootstrap/src/main/resources/oal/core.oal), such as `service_sla`, etc. | | ||
| `--service` | The name of the service. | "" | | ||
| `--instance` | The name of the service instance. | "" | | ||
| `--endpoint` | The name of the endpoint. | "" | | ||
| `--isNormal` | Set the service to normal or unnormal. | `true` | | ||
| `--start` | See [Common options](#common-options) | See [Common options](#common-options) | | ||
| `--end` | See [Common options](#common-options) | See [Common options](#common-options) | | ||
|
||
|
@@ -206,14 +215,15 @@ Ascii Graph, like coloring in terminal, so please use `json` or `yaml` instead. | |
|
||
<details> | ||
|
||
<summary>metrics top 5 [--start=start-time] [--end=end-time] --name=metrics-name [--service=parent-service] [--order=DES]</summary> | ||
<summary>metrics top 5 [--start=start-time] [--end=end-time] --name=metrics-name [--service=parent-service] [--order=DES] [--isNormal=true/false]</summary> | ||
|
||
| option | description | default | | ||
| :--- | :--- | :--- | | ||
| arguments | The first argument is the number of top entities | `5` | | ||
| `--name` | Metrics name, defined in [OAL](https://github.com/apache/skywalking/blob/master/oap-server/server-bootstrap/src/main/resources/oal/core.oal), such as `service_sla`, etc. | | ||
| `--service` | The name of the parent service, could be null if query the global top N. | "" | | ||
| `--order` | The order of metrics, `DES` or `ASC`. |`DES`| | ||
| `--isNormal` | Set the service to normal or unnormal. | `true` | | ||
| `--start` | See [Common options](#common-options) | See [Common options](#common-options) | | ||
| `--end` | See [Common options](#common-options) | See [Common options](#common-options) | | ||
|
||
|
@@ -389,7 +399,7 @@ otherwise, | |
<summary>Query a linear metrics graph for an instance</summary> | ||
|
||
```shell | ||
$ ./bin/swctl --display=graph metrics linear --name=service_instance_resp_time --service "load balancer1.system" | ||
$ ./bin/swctl --display=graph metrics linear --name=service_instance_resp_time --service "projectC.business-zone" --instance "[email protected]" | ||
``` | ||
|
||
![](http://skywalking.apache.org/screenshots/cli/metrics-linear.png) | ||
|
@@ -407,19 +417,34 @@ $ ./bin/swctl instance ls --service-name=projectC | jq '.[] | select(.name == "p | |
<summary>Query a single metrics value for a specific endpoint</summary> | ||
|
||
```shell | ||
$ ./bin/swctl service ls projectC | jq '.[0].id' | xargs ./bin/swctl endpoint ls --service-id | jq '.[] | [.id] | join(",")' | xargs ./bin/swctl metrics single --name endpoint_cpm --ids | ||
[{"id":"22","value":116}] | ||
export SERVICE_NAME=projectC.business-zone | ||
export ENDPOINT=/projectC/{value} | ||
export METRICS_NAME=endpoint_cpm | ||
./bin/swctl metrics single --name ${METRICS_NAME} --service ${SERVICE_NAME} --endpoint ${ENDPOINT} | ||
``` | ||
|
||
Result: | ||
|
||
``` | ||
23 | ||
``` | ||
|
||
</details> | ||
|
||
<details> | ||
|
||
<summary>Query metrics single values for all endpoints of service of id 3</summary> | ||
<summary>Query metrics single values for all endpoints of service `projectC.business-zone`</summary> | ||
|
||
```shell | ||
$ ./bin/swctl service ls projectC | jq '.[0].id' | xargs ./bin/swctl endpoint ls --service-id | jq '.[] | [.id] | join(",")' | xargs ./bin/swctl metrics single --name endpoint_cpm --end='2019-12-02 2137' --ids | ||
[{"id":"3","value":116}] | ||
export SERVICE_NAME=projectC.business-zone | ||
export METRICS_NAME=endpoint_cpm | ||
./bin/swctl endpoint ls --service-id=$(./bin/swctl service ls "$SERVICE_NAME" | jq -r '.[0].id') | jq -r '.[].name' | xargs ./bin/swctl metrics single --name "${METRICS_NAME}" --service "${SERVICE_NAME}" --endpoint | ||
``` | ||
|
||
Result: | ||
|
||
``` | ||
23 | ||
``` | ||
|
||
</details> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -215,11 +215,9 @@ Vote result should follow these: | |
Website: http://skywalking.apache.org/ | ||
|
||
SkyWalking CLI Resources: | ||
- Issue: https://github.com/apache/skywalking/issues | ||
- Issue: https://github.com/apache/skywalking/issues | ||
- Mailing list: [email protected] | ||
- Documents: https://github.com/apache/skywalking-cli/blob/$VERSION/README.md | ||
|
||
The Apache SkyWalking Team | ||
``` | ||
|
||
|
||
``` |