Getting started

  1. To get started, we first need some data.

Click into the Integrations menu option.

Integrations menu optionIntegrations menu option

Integrations menu option

For this tutorial, we'll just use some JSON data sent over HTTP. Click on the HTTP integration.

HTTP integrationHTTP integration

HTTP integration

  1. We'll send a single data point with cURL to test. Copy paste the following snippet into a command line.

Replace <timestamp> with the current timestamp: https://www.unixtimestamp.com/index.php.
Replace <api-token> with the API token found in the app.

curl 
-d '{"name": "tutorial", "timestamp": <timestamp>, "tags": { "color": "red" }, "fields": { "cpu": 12.66 }}'
-H "Content-Type: application/json" 
-H "Authorization: Bearer <api-token>" 
-X POST https://ingest.terrastruct.com

After you've sent that request, go back to the integration modal and click on "Verify integration". It should show a successful badge, which means we've received the data.

Integration verified badgeIntegration verified badge

Integration verified badge

  1. Now that we have a data point, we need a way to query it.

Click into the Alias menu option

Alias menu optionAlias menu option

Alias menu option

And add a new Alias.

// TODO picture

We just want to grab the LAST value, so define the query like in the below picture, give it a name (e.g. tutorial_point), and click Save.

// TODO picture

  1. When you have query results mapped to an Alias, you can include that Alias anywhere you can include text, with template tags, like {{ tutorial_point }}. Try it out by dragging and dropping a text, and replace that text with the Alias template.

// TODO picture

When in Editor mode, this template is truncated.

// TODO picture

When in Presentation mode, the template is replaced with the live result.

// TODO picture

  1. The other way to use Alias's is to add a Transformer on a board object. A Transformer is code that takes Aliases as input, and sets properties on the board object in Presentation mode. For example, place a new square object onto the board, right click, click "Add Transformer", and enter the following code:

// TODO gif

When in Presentation mode, the Transformer is executed and the changes are made temporarily to the board object. Whenever there are changes to the Alias results, the Transformer is re-executed, so that the board object is kept up to date with live data.

// TODO gif

What's next

Arc can only be useful if the data is data you care about in your own software systems. Set up a real integration in less than 5 minutes: Integrations