Scraping, writing, and querying data with InfluxDB

fastai
Published

October 28, 2020

Scraping, writing, and querying data with InfluxDB

Scraping data

InfluxDB can scrape data - Can collect data in specified intervals - Saves data into a InfluxDB bucket - It collects data from endpoints that accept HTTP(S) and that provide data in the [prometheus data format][https://prometheus.io/docs/instrumenting/exposition_formats/].

Steps to scrape data

Here we will use a the sample metrics data what influxDB generates and can be accessed at http://localhost:8086/metrics

  1. Find the navigation menu and select Data
  2. There select the Scrapers tab
  3. Click on the Select Scraper button
  4. In the popup window, enter a name and select a bucket.
  5. For the Target URL add http://localhost:8086/metrics (or the url from where you would like to scrape your data)
  6. Click Create

Querying data

You can mainly query data in the following ways

  1. Flux, InfluxData’s functional scripting language
  2. The InfluxDB user interface
  3. The influx command line interface
  4. Directly through the InfluxDB API (/api/v2/query)
  5. Using one of the InfluxDB clients