Skip to content

Commit eac4229

Browse files
committed
Add OpenTelemetry commands.
Signed-off-by: svrnm <[email protected]>
1 parent 4b793e4 commit eac4229

File tree

4 files changed

+99
-6
lines changed

4 files changed

+99
-6
lines changed

USAGE.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ These commands allow you to run ADQL queries agains the controller (not the even
7171

7272
| Command | Description | Example |
7373
| ------- | ----------- | ------- |
74-
| query | Run an ADQL query | `act.sh adql query ` |
74+
| 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` |
7575

7676

7777
## agents
@@ -140,6 +140,7 @@ The applications API lets you retrieve information about the monitored environme
140140
| export | Export an application. Provide an application id as parameter (-a) | `act.sh application export -a 29` |
141141
| get | Get an application. Provide an application id or name as parameter (-a). | `act.sh application get -a 15` |
142142
| list | List all applications. This command requires no further arguments. | `act.sh application list ` |
143+
| 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` |
143144

144145

145146
## audit
@@ -394,6 +395,16 @@ Retrieve nodes within a business application
394395
| 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` |
395396

396397

398+
## otel
399+
400+
Configure OpenTelemetry collector for AppDynamics
401+
402+
| Command | Description | Example |
403+
| ------- | ----------- | ------- |
404+
| getApiKey | Get OpenTelemetry API Key No parameter required. | `act.sh otel getApiKey ` |
405+
| isEnabled | Check if OpenTelemetry enabled. No parameter required. | `act.sh otel isEnabled ` |
406+
407+
397408
## policy
398409

399410
Import and export policies

act.sh

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22
ACT_VERSION="v22.4.0"
3-
ACT_LAST_COMMIT="401363b3bf068013122e8a9975b1af70be7dfbec"
3+
ACT_LAST_COMMIT="4b793e41e6df7ef1911b29e871c9046b99651441"
44
USER_CONFIG="$HOME/.appdynamics/act/config.sh"
55
GLOBAL_CONFIG="/etc/appdynamics/act/config.sh"
66
CONFIG_CONTROLLER_COOKIE_LOCATION="/tmp/appdynamics-controller-cookie.txt"
@@ -93,7 +93,7 @@ doc adql << EOF
9393
These commands allow you to run ADQL queries agains the controller (not the event service!)
9494
EOF
9595
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' "$@" ; }
96-
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"
96+
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"
9797
doc agents << EOF
9898
List, Reset, Disable AppDynamics Agents
9999
EOF
@@ -313,6 +313,13 @@ node_markhistorical() { apiCall -X POST '/controller/rest/mark-nodes-historical?
313313
rde node_markhistorical "Mark nodes as historical." "Provide a comma separated list of node ids." "-n 45,46"
314314
node_move() { apiCall -X POST '/controller/restui/nodeUiService/moveNode/{{n:node}}/{{t:tier}}' "$@" ; }
315315
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"
316+
doc otel << EOF
317+
Configure OpenTelemetry collector for AppDynamics
318+
EOF
319+
otel_getApiKey() { apiCall '/controller/restui/otel/getOtelApiKey' "$@" ; }
320+
rde otel_getApiKey "Get OpenTelemetry API Key" "No parameter required." ""
321+
otel_isEnabled() { apiCall '/controller/restui/otel/isOtelEnabled' "$@" ; }
322+
rde otel_isEnabled "Check if OpenTelemetry enabled." "No parameter required." ""
316323
doc policy << EOF
317324
Import and export policies
318325
EOF

commands.yml

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,8 +174,8 @@ adql:
174174
description: These commands allow you to run ADQL queries agains the controller (not the event service!)
175175
query:
176176
title: Run an ADQL query
177-
description:
178-
example:
177+
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.
178+
example: -q 'SELECT eventTimestamp FROM transactions LIMIT 1' -s 2022-06-05T00:00:00.000Z -e 2022-06-16T06:00:00.000Z
179179
method: POST
180180
endpoint: /controller/restui/analytics/adql/query
181181
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}
@@ -585,6 +585,21 @@ node:
585585
example: -n 1782418 -t 187811
586586
method: POST
587587
endpoint: /controller/restui/nodeUiService/moveNode/{{n:node}}/{{t:tier}}
588+
otel:
589+
title: OpenTelemetry
590+
description: Configure OpenTelemetry collector for AppDynamics
591+
isEnabled:
592+
title: Check if OpenTelemetry enabled.
593+
description: No parameter required.
594+
example:
595+
method: GET
596+
endpoint: /controller/restui/otel/isOtelEnabled
597+
getApiKey:
598+
title: Get OpenTelemetry API Key
599+
description: No parameter required.
600+
example:
601+
method: GET
602+
endpoint: /controller/restui/otel/getOtelApiKey
588603
policy:
589604
title: Policies API
590605
description: Import and export policies

postman-collection.json

Lines changed: 61 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@
296296
"path": ["controller","restui","analytics","adql","query"],
297297
"query": []
298298
},
299-
"description": ""
299+
"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."
300300
}
301301
}]},{"name": "agents","item": [{
302302
"name": "Disable an app agent by id",
@@ -2548,6 +2548,66 @@
25482548
},
25492549
"description": "Provide a node id (-n) and a tier id (-t) to move the given node to the given tier."
25502550
}
2551+
}]},{"name": "otel","item": [{
2552+
"name": "Get OpenTelemetry API Key",
2553+
"request": {
2554+
"method": "GET",
2555+
"header": [
2556+
{
2557+
"key": "Content-Type",
2558+
"value": "application/json;charset=UTF-8",
2559+
"type": "text"
2560+
},
2561+
{
2562+
"key": "X-CSRF-TOKEN",
2563+
"value": "{{X-CSRF-TOKEN}}",
2564+
"type": "text"
2565+
}
2566+
],
2567+
"body": {
2568+
"mode": "raw",
2569+
"raw": ""
2570+
},
2571+
"url": {
2572+
"raw": "{{controller_host}}/controller/restui/otel/getOtelApiKey",
2573+
"host": [
2574+
"{{controller_host}}"
2575+
],
2576+
"path": ["controller","restui","otel","getOtelApiKey"],
2577+
"query": []
2578+
},
2579+
"description": "No parameter required."
2580+
}
2581+
},{
2582+
"name": "Check if OpenTelemetry enabled.",
2583+
"request": {
2584+
"method": "GET",
2585+
"header": [
2586+
{
2587+
"key": "Content-Type",
2588+
"value": "application/json;charset=UTF-8",
2589+
"type": "text"
2590+
},
2591+
{
2592+
"key": "X-CSRF-TOKEN",
2593+
"value": "{{X-CSRF-TOKEN}}",
2594+
"type": "text"
2595+
}
2596+
],
2597+
"body": {
2598+
"mode": "raw",
2599+
"raw": ""
2600+
},
2601+
"url": {
2602+
"raw": "{{controller_host}}/controller/restui/otel/isOtelEnabled",
2603+
"host": [
2604+
"{{controller_host}}"
2605+
],
2606+
"path": ["controller","restui","otel","isOtelEnabled"],
2607+
"query": []
2608+
},
2609+
"description": "No parameter required."
2610+
}
25512611
}]},{"name": "policy","item": [{
25522612
"name": "List all policies.",
25532613
"request": {

0 commit comments

Comments
 (0)