In this post, we learn about monitoring states with InfluxDB. This TL;DR assumes that you already know how to create a check. If you are new to checks, please read this “TL;DR — Using Tasks and Checks for Monitoring with InfluxDB”.

Q: What ways can I monitor states with InfluxDB?
A: There are several ways to monitor states with InfluxDB. Some Flux functions for monitoring states include:

  • stateDuration(): allows you to determine how long a state persists.
  • stateCount(): allows you to count the number of consecutive states.
  • monitor.stateChanges(): allows you to detect changes in the _level column from one level to another specific level. …

In this post, we learn how to use tasks in combination with checks for monitoring with InfluxDB.

Q: What is the monitoring workflow for InfluxDB?
A: According to the documentation, the monitoring workflow involves the following steps:

  1. A check in InfluxDB queries data and assigns a status with a _level based on specific conditions.
  2. InfluxDB stores the output of a check in the statuses measurement in the _monitoring system bucket.
  3. Notification rules check data in the statuses measurement, and based on conditions set in the notification rule, send a message to a notification endpoint.
  4. InfluxDB stores notifications in the notifications measurement in the _monitoring system bucket. …

In this post, we share how to use the array.from() function to construct a table from an array of records with Flux. Flux is InfluxData’s scripting and functional query language.

This TL;DR assumes that you have either registered for a InfluxDB Cloud account — registering for a free account is the easiest way to get started with InfluxDB — or installed InfluxDB 2.0 OSS.

Q: How can I construct and write data to InfluxDB?
A: Users have the following options for construction and writing temporary data to InfluxDB:

  • Generate line protocol and write it manually to InfluxDB through the UI. Writing line protocol data to InfluxDB through the UI is easy, if you don’t need to include a specific timestamp. If a data point does not include a timestamp when it is received by the database, InfluxDB uses the current system time (UTC) of its host machine. However, if you need to add data with timestamps, you need to include Unix timestamps based on epoch time. This makes generating line protocol data a little difficult — you’ll most likely rely on a timestamp converter. …

In this post, we’ll review some common InfluxDB Cloud 2.0 errors for beginners. We’ll discuss probable causes as well as recommended fixes. This blog uses the Telegraf System Configuration and data as an example to illustrate the various errors you may encounter. Having some familiarity with this dataset is useful in understanding the issue and the resolution. However, you may run into these issues with your own time series data, and hopefully, these examples highlight how you can address them!

Error 1: specified column does not exist in table: _time

Possible causes: A likely cause of this error is using an aggregator Flux function. Many aggregators — including count(), mean(), and median() — drop the _time column because they combine rows. …


In this post, we learn how to use the reduce(), findColumn(), and findRecord() Flux functions to perform custom aggregations with InfluxDB.

This TL;DR assumes that you have either registered for an InfluxDB Cloud account — registering for a free account is the easiest way to get started with InfluxDB — or installed InfluxDB 2.0 OSS.

In order to easily demonstrate how these functions work, let’s use the array.from() function to build an ad hoc table to use in the query:

import "experimental/array"

data = array.from(rows: [{_time: 2020-01-01T00:00:00Z, mytag: "t0", _field: "f0", _value: "1.0"},
{_time: 2020-01-02T00:00:00Z, mytag: "t1", _field: "f1", _value: "1.5"},
{_time: 2020-01-02T00:00:00Z, mytag: "t0", _field: "f0", _value: "2.0"},
{_time: 2020-01-01T00:00:00Z, mytag: "t1", _field: "f1", _value: "2.5"}]) …


In this post we share how to use the InfluxDB CLI with InfluxDB Cloud. This TL;DR assumes that you have registered for an InfluxDB Cloud account — registering for a free account is the easiest way to get started with InfluxDB.

Q: What do I need to use the CLI on my machine to connect to InfluxDB Cloud?
A: You need to install InfluxDB 2.0 CLI locally. Please follow the documentation to install and configure the Influx CLI. Obtain the following authorization parameters for your InfluxDB Cloud Account:

  • URL: The URL of your InfluxDB Cloud Account. For example It might behttps://us-west-2-1.aws.cloud2.influxdata.com

In this post, we learn how to use the reduce(), findColumn(), and findRecord() Flux functions to perform custom aggregations with InfluxDB.

This TL;DR assumes that you have either registered for an InfluxDB Cloud account — registering for a free account is the easiest way to get started with InfluxDB — or installed InfluxDB 2.0 OSS.

In order to easily demonstrate how these functions work, let’s use the array.from() function to build an ad hoc table to use in the query:

import "experimental/array"

data = array.from(rows: [{_time: 2020-01-01T00:00:00Z, mytag: "t0", _field: "f0", _value: "1.0"},
{_time: 2020-01-02T00:00:00Z, mytag: "t1", _field: "f1", _value: "1.5"},
{_time: 2020-01-02T00:00:00Z, mytag: "t0", _field: "f0", _value: "2.0"},
{_time: 2020-01-01T00:00:00Z, mytag: "t1", _field: "f1", _value: "2.5"}]) …

Figuring out the best data layout for InfluxDB v2 is important in optimizing the resources used by InfluxDB, as well as improving ingestion rates and the performance of queries and tasks. You also want to consider developer and user experience (UX). This post will walk you through developing a schema for an IoT application example and answer the following questions:

  1. What are general recommendations for schema design and data layout for InfluxDB v2?
  2. What impacts computing resources such as memory, CPU, and storage? How do I optimize InfluxDB for the available resources?


This article was written by Gregory Scafarto, Data Scientist intern at Supralog, in collaboration with InfluxData’s DevRel Anais Dotis-Georgiou.

At InfluxData, we pride ourselves on our awesome InfluxDB Community. We’re grateful for all of your contributions and feedback. Whether it’s Telegraf plugins, community templates, awesome InfluxDB projects, or Third Party Flux Packages, your contributions continue to both impress and humble us. Today, let’s shine a spotlight on Gregory Scafarto from Supralog.

Gregory Scafarto built and maintains an online capacity planning pipeline with Kapacitor, Python, and InfluxDB. Gregory Scafarto is based in France and is finishing the last year of his Masters Degree in Computer Systems Networking and Telecommunication at ENSEIRB-MATMECA. …


Giraffe is the open source React-based visualization library that’s used to implement InfluxDB’s v2 UI. It employs clever algorithms to handle the challenge of visualizing the incredibly high volume of data that InfluxDB can ingest and query. We’ve just published documentation describing how developers can take advantage of this library and I’ve tried to create a companion tutorial to further illustrate the power of this library. This tutorial demonstrates how you can use Giraffe in conjunction with the JavaScript Client to build a line graph in the browser. The repo that accompanies this tutorial can be found here.

Tutorial assumptions

This project was initialized with Create React App. The emphasis of this tutorial is on how to use Giraffe with the JS client and not how to create a React App. For this reason, I am generating a very simple static site. We will be building a line graph that visualizes RAM usage from our local machine. Our site will look something like…

About

Anais Dotis

Developer Advocate at InfluxData

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store