Skip to content

Commit

Permalink
DOCS-1798: Add performance metrics capture
Browse files Browse the repository at this point in the history
  • Loading branch information
npentrel committed Mar 1, 2024
1 parent 14fa48d commit ccfe4e3
Show file tree
Hide file tree
Showing 4 changed files with 72 additions and 1 deletion.
Binary file added assets/data/sensor-data.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes.
71 changes: 71 additions & 0 deletions docs/data/capture/performance-metrics.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
---
title: "Performance Monitoring Data Capture"
linkTitle: "Monitor Performance"
description: "Capture and sync data about your machines' performance."
weight: 12
type: "docs"
tags: ["data management", "cloud", "sync"]
icon: true
images: ["/services/icons/data-capture.svg"]
aliases:
- "/services/data/capture/"
# SME: Alexa Greenberg
---

You can capture and monitor the following metrics about the performance of individual machines or your entire fleet:

- **Wireless Signal Strength and Quality**: signal level, link quality, and noise level
- **Memory Usage**: memory statistics, including total available memory, used percentage, and specifics on various types of memory (cached, free, slab, etc.)
- **CPU Utilization**: CPU usage across different states (user, system, idle, etc.)
- **Disk I/O**: Metrics on read and write operations, including bytes transferred and operation times
- **Network Traffic**: Detailed network statistics, including bytes sent and received, packet information, and error counts, provide a deep dive into a device's network performance.

## Requirements

To capture data from a machine, you need to [create a machine in Viam](https://docs.viam.com/manage/fleet/machines/#add-a-new-machine) and follow the setup instruction to install `viam-server` and connect it to the Viam app.

## Add sensor to measure performance metrics

To obtain performance metrics about your machine, use the [`viam-telegraf-sensor`](https://app.viam.com/module/viam/viam-telegraf-sensor) module from the [Viam registry](/registry/).
The module provides a `sensor` that allows you to obtain readings containing your machine's performance metrics.

1. Go to your machine's **Config** page and click **Create component**.
2. Then select the `viam:viam-sensor:telegrafsensor` model from the [`viam-telegraf-sensor` module](https://app.viam.com/module/viam/viam-telegraf-sensor).
3. Click **Add module**, then enter a name for your sensor, for example `my-telegrafsensor`, and click **Create**.

In the next step you will configure the data manager to capture and sync the performance metrics from your configured sensor.

For more information, see [add a module from the Viam Registry](https://docs.viam.com/registry/configure/#add-a-modular-resource-from-the-viam-registry).

### Test sensor data

After you configure your sensor, navigate to the [Control tab](/fleet/machines/#control) and select the **Sensors** dropdown panel.
To access detailed readings from your sensor, click on the **Get Readings** button.

## Configure data manager to capture and sync sensor data

To capture the data from your configured sensor, you need to add the data management service and configure it to capture and sync the sensor data:

1. On your machine's **Config** page, go to the **Services** subtab and click **Create service**.
2. Select the **data management** service and give it a name.
For example `data_manager`.
3. Click **Create**.
4. Go to the **Components** subtab and find your telegrafsensor.
In the **Data capture configuration** section of the sensor's config, click **Add method**, select the `Readings` **Type** and set the **Frequency** to 0.2Hz.
5. Click **Save config**.

### View data

View your sensor data on the [**Data** tab](https://app.viam.com/data/view?view=sensors).

![View of sensor data](/data/sensor-data.png)

### Next steps

The data you obtain about your machines is associated with metadata about the machine and time of capture.
Once you have captures data about your machines, you can query your captured data with any tools that with SQL or MQL or visualize your data with tools like Grafana:

{{< cards >}}
{{% card link="/data/query/" %}}
{{% card link="/data/visualize" %}}
{{< /cards >}}
2 changes: 1 addition & 1 deletion static/include/components/test-control/sensor-control.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

After you configure your sensor, navigate to the [Control tab](/fleet/machines/#control) and select the **Sensors** dropdown panel.
If you have multiple sensors configured, your sensor will be listed here among others.
To access detailed readings from your sensor, select the **Get Readings** button.
To access detailed readings from your sensor, click on the **Get Readings** button.

{{<imgproc src="/components/sensor/sensor-control-tab.png" resize="800x" declaredimensions=true alt="The sensor component in the control tab">}}

0 comments on commit ccfe4e3

Please sign in to comment.