Reader small image

You're reading from  Building IoT Visualizations using Grafana

Product typeBook
Published inJul 2022
PublisherPackt
ISBN-139781803236124
Edition1st Edition
Right arrow
Author (1)
Rodrigo Juan Hernández
Rodrigo Juan Hernández
author image
Rodrigo Juan Hernández

Rodrigo Juan Hernández is an electronic engineer passionate about IoT even before it existed. He has been working on tech for more than 18 years until now. For several years he has been focusing on the IoT ecosystem. He is currently giving consultation about IoT systems to clients around the world. He also produces content online about IoT and related subjects and the content is available on his blog, Youtube channel, and social networks - mainly LinkedIn. He also writes for companies that need good quality content about their products and services. His main objective nowadays is helping others to understand and implement IoT solutions.
Read more about Rodrigo Juan Hernández

Right arrow

Writing data in an OpenTSDB database

In this section, we will see the data schema of an OpenTSDB database. You will also learn how to write data.

Data schema

The data schema of OpenTSDB is based on the following elements:

  • metric: This is a name that is used to identify TSD, for example, lab.freezer.sensor, server.cpu.user, or asset.location.
  • timestamp: As its name implies, this is a timestamp in seconds or milliseconds.
  • value: This is a numeric value that represents some variable and it’s stored associated with a timestamp. It can be an integer or a floating-point value.
  • tags: These are a key-value pair. All the data points must have at least one tag assigned.

Let’s see how metrics and tags work together.

Imagine that you have a fleet of trucks and you want to store data on location, speed, and fuel consumption. Then, you can create the truck.location, truck.speed, and truck.fuel metrics.

But, how do you identify each of the trucks...

lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
Building IoT Visualizations using Grafana
Published in: Jul 2022Publisher: PacktISBN-13: 9781803236124

Author (1)

author image
Rodrigo Juan Hernández

Rodrigo Juan Hernández is an electronic engineer passionate about IoT even before it existed. He has been working on tech for more than 18 years until now. For several years he has been focusing on the IoT ecosystem. He is currently giving consultation about IoT systems to clients around the world. He also produces content online about IoT and related subjects and the content is available on his blog, Youtube channel, and social networks - mainly LinkedIn. He also writes for companies that need good quality content about their products and services. His main objective nowadays is helping others to understand and implement IoT solutions.
Read more about Rodrigo Juan Hernández