Skip to content

Commit

Permalink
Add OpenTelemetry commands.
Browse files Browse the repository at this point in the history
Signed-off-by: svrnm <[email protected]>
  • Loading branch information
svrnm committed Nov 9, 2022
1 parent 4b793e4 commit eac4229
Show file tree
Hide file tree
Showing 4 changed files with 99 additions and 6 deletions.
13 changes: 12 additions & 1 deletion USAGE.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ These commands allow you to run ADQL queries agains the controller (not the even

| Command | Description | Example |
| ------- | ----------- | ------- |
| query | Run an ADQL query | `act.sh adql query ` |
| query | Run an ADQL query Provide an adql query (-q), a start time (-s) and an end time (-e) as parameters. Remember to escape double quotes in the query. | `act.sh adql query -q 'SELECT eventTimestamp FROM transactions LIMIT 1' -s 2022-06-05T00:00:00.000Z -e 2022-06-16T06:00:00.000Z` |


## agents
Expand Down Expand Up @@ -140,6 +140,7 @@ The applications API lets you retrieve information about the monitored environme
| export | Export an application. Provide an application id as parameter (-a) | `act.sh application export -a 29` |
| get | Get an application. Provide an application id or name as parameter (-a). | `act.sh application get -a 15` |
| list | List all applications. This command requires no further arguments. | `act.sh application list ` |
| listdetails | List application details List application details including health. Provide application ids as parameter (-i), a start and end timestamp (-s and -e). | `act.sh application listdetails -i 9326,8914 -s 1610389435 -e 1620389435` |


## audit
Expand Down Expand Up @@ -394,6 +395,16 @@ Retrieve nodes within a business application
| move | Move node. Provide a node id (-n) and a tier id (-t) to move the given node to the given tier. | `act.sh node move -n 1782418 -t 187811` |


## otel

Configure OpenTelemetry collector for AppDynamics

| Command | Description | Example |
| ------- | ----------- | ------- |
| getApiKey | Get OpenTelemetry API Key No parameter required. | `act.sh otel getApiKey ` |
| isEnabled | Check if OpenTelemetry enabled. No parameter required. | `act.sh otel isEnabled ` |


## policy

Import and export policies
Expand Down
11 changes: 9 additions & 2 deletions act.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash
ACT_VERSION="v22.4.0"
ACT_LAST_COMMIT="401363b3bf068013122e8a9975b1af70be7dfbec"
ACT_LAST_COMMIT="4b793e41e6df7ef1911b29e871c9046b99651441"
USER_CONFIG="$HOME/.appdynamics/act/config.sh"
GLOBAL_CONFIG="/etc/appdynamics/act/config.sh"
CONFIG_CONTROLLER_COOKIE_LOCATION="/tmp/appdynamics-controller-cookie.txt"
Expand Down Expand Up @@ -93,7 +93,7 @@ doc adql << EOF
These commands allow you to run ADQL queries agains the controller (not the event service!)
EOF
adql_query() { apiCall -X POST -d '{"requests":[{"query":"{{q:query}}","label":"DataQuery","customResponseRequest":true,"responseConverter":"UIGRID","responseType":"ORDERED","start":"{{s:start}}","end":"{{e:end}}","chunk":false,"mode":"page","scrollId":"","size":"50000","offset":"0","limit":"1000000"}],"start":"","end":"","chunk":false,"mode":"none","scrollId":"","size":"","offset":"","limit":"1000000","chunkDelayMillis":"","chunkBreakDelayMillis":"","chunkBreakBytes":"","others":"false","emptyOnError":"false","token":"","dashboardId":0,"warRoomToken":"","warRoom":false}' '/controller/restui/analytics/adql/query' "$@" ; }
rde adql_query "Run an ADQL query:" "Provide an adql query (-q), a start time (-s) and an end time (-e) as parameters. Remember to escape double quotes in the query." "-q 'SELECT eventTimestamp FROM transactions LIMIT 1' -s 2022-06-05T00:00:00.000Z -e 2022-06-16T06:00:00.000Z"
rde adql_query "Run an ADQL query" "Provide an adql query (-q), a start time (-s) and an end time (-e) as parameters. Remember to escape double quotes in the query." "-q 'SELECT eventTimestamp FROM transactions LIMIT 1' -s 2022-06-05T00:00:00.000Z -e 2022-06-16T06:00:00.000Z"
doc agents << EOF
List, Reset, Disable AppDynamics Agents
EOF
Expand Down Expand Up @@ -313,6 +313,13 @@ node_markhistorical() { apiCall -X POST '/controller/rest/mark-nodes-historical?
rde node_markhistorical "Mark nodes as historical." "Provide a comma separated list of node ids." "-n 45,46"
node_move() { apiCall -X POST '/controller/restui/nodeUiService/moveNode/{{n:node}}/{{t:tier}}' "$@" ; }
rde node_move "Move node." "Provide a node id (-n) and a tier id (-t) to move the given node to the given tier." "-n 1782418 -t 187811"
doc otel << EOF
Configure OpenTelemetry collector for AppDynamics
EOF
otel_getApiKey() { apiCall '/controller/restui/otel/getOtelApiKey' "$@" ; }
rde otel_getApiKey "Get OpenTelemetry API Key" "No parameter required." ""
otel_isEnabled() { apiCall '/controller/restui/otel/isOtelEnabled' "$@" ; }
rde otel_isEnabled "Check if OpenTelemetry enabled." "No parameter required." ""
doc policy << EOF
Import and export policies
EOF
Expand Down
19 changes: 17 additions & 2 deletions commands.yml
Original file line number Diff line number Diff line change
Expand Up @@ -174,8 +174,8 @@ adql:
description: These commands allow you to run ADQL queries agains the controller (not the event service!)
query:
title: Run an ADQL query
description:
example:
description: Provide an adql query (-q), a start time (-s) and an end time (-e) as parameters. Remember to escape double quotes in the query.
example: -q 'SELECT eventTimestamp FROM transactions LIMIT 1' -s 2022-06-05T00:00:00.000Z -e 2022-06-16T06:00:00.000Z
method: POST
endpoint: /controller/restui/analytics/adql/query
payload: {\"requests\":[{\"query\":\"{{q:query}}\",\"label\":\"DataQuery\",\"customResponseRequest\":true,\"responseConverter\":\"UIGRID\",\"responseType\":\"ORDERED\",\"start\":\"{{s:start}}\",\"end\":\"{{e:end}}\",\"chunk\":false,\"mode\":\"page\",\"scrollId\":\"\",\"size\":\"50000\",\"offset\":\"0\",\"limit\":\"1000000\"}],\"start\":\"\",\"end\":\"\",\"chunk\":false,\"mode\":\"none\",\"scrollId\":\"\",\"size\":\"\",\"offset\":\"\",\"limit\":\"1000000\",\"chunkDelayMillis\":\"\",\"chunkBreakDelayMillis\":\"\",\"chunkBreakBytes\":\"\",\"others\":\"false\",\"emptyOnError\":\"false\",\"token\":\"\",\"dashboardId\":0,\"warRoomToken\":\"\",\"warRoom\":false}
Expand Down Expand Up @@ -585,6 +585,21 @@ node:
example: -n 1782418 -t 187811
method: POST
endpoint: /controller/restui/nodeUiService/moveNode/{{n:node}}/{{t:tier}}
otel:
title: OpenTelemetry
description: Configure OpenTelemetry collector for AppDynamics
isEnabled:
title: Check if OpenTelemetry enabled.
description: No parameter required.
example:
method: GET
endpoint: /controller/restui/otel/isOtelEnabled
getApiKey:
title: Get OpenTelemetry API Key
description: No parameter required.
example:
method: GET
endpoint: /controller/restui/otel/getOtelApiKey
policy:
title: Policies API
description: Import and export policies
Expand Down
62 changes: 61 additions & 1 deletion postman-collection.json
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@
"path": ["controller","restui","analytics","adql","query"],
"query": []
},
"description": ""
"description": "Provide an adql query (-q), a start time (-s) and an end time (-e) as parameters. Remember to escape double quotes in the query."
}
}]},{"name": "agents","item": [{
"name": "Disable an app agent by id",
Expand Down Expand Up @@ -2548,6 +2548,66 @@
},
"description": "Provide a node id (-n) and a tier id (-t) to move the given node to the given tier."
}
}]},{"name": "otel","item": [{
"name": "Get OpenTelemetry API Key",
"request": {
"method": "GET",
"header": [
{
"key": "Content-Type",
"value": "application/json;charset=UTF-8",
"type": "text"
},
{
"key": "X-CSRF-TOKEN",
"value": "{{X-CSRF-TOKEN}}",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": ""
},
"url": {
"raw": "{{controller_host}}/controller/restui/otel/getOtelApiKey",
"host": [
"{{controller_host}}"
],
"path": ["controller","restui","otel","getOtelApiKey"],
"query": []
},
"description": "No parameter required."
}
},{
"name": "Check if OpenTelemetry enabled.",
"request": {
"method": "GET",
"header": [
{
"key": "Content-Type",
"value": "application/json;charset=UTF-8",
"type": "text"
},
{
"key": "X-CSRF-TOKEN",
"value": "{{X-CSRF-TOKEN}}",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": ""
},
"url": {
"raw": "{{controller_host}}/controller/restui/otel/isOtelEnabled",
"host": [
"{{controller_host}}"
],
"path": ["controller","restui","otel","isOtelEnabled"],
"query": []
},
"description": "No parameter required."
}
}]},{"name": "policy","item": [{
"name": "List all policies.",
"request": {
Expand Down

0 comments on commit eac4229

Please sign in to comment.