Scripting Integration + JS
Some cats are born fat, some achieve fatness, others have fatness thrust upon them. You can find all of them at the San Francisco SPCA.
In this exercise you'll learn how to ingest the name and weight (lbs) of each cat up for adoption at the San Francisco SPCA into Dynatrace. We will use dynatrace_ingest
to ingest these metrics to see which one weighs the most by continuously monitoring them in Dynatrace.
- Node.js
- Linux
- npm
- git
- OneAgent installed on host
- Scripting integration enabled
-
Pull down the code repo.
git clone https://github.com/geoteo/dt-fat-cat-hack-js
-
Change directories.
cd dt-fat-cat-hack-js
-
Install the necessary packages.
npm i
-
Review the code in
src/fetch_cats.js
andsrc/print_fattest_cat.js
using your favorite editor. -
Review the following Dynatrace documentation Metric ingestion protocol.
-
Provided data points must follow the metrics ingestion protocol. The general syntax of metric ingestion is the following:
metric.key,dimensions payload
-
Run the script.
node src/print_fattest_cat.js
-
Review output to terminal.
-
Run the following bash command in your terminal:
while true; do node src/print_fattest_cat.js; sleep 10; done
- Dynatrace UI -> Explore Data -> animal.cat.weight -> Max -> Split by name