Nowadays, every single modern application, system or solution does expose a RESTful API. On one hand, this is absolutely great and it has led to where we are today, having hundreds of other solutions or applications that can leverage these APIs, extend them, or even build on top of them.
On the other hand, we have difficulty monitoring these new and modern systems, applications or solutions.
In this session, we will learn how to query the data first using Swagger, when available, extract and parse the data that’s useful for us, store it in InfluxDB, and finally how to create beautiful and meaningful dashboards to have everything on a single pane of glass.
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
RESTful API – How to Consume, Extract, Store and Visualize Data with InfluxDB and Grafana
1. Jorge de la Cruz
@jorgedlcruz
https://jorgedelacruz.es || https://jorgedelacruz.uk
RESTful API – How to
Consume, Extract, Store,
and Visualize Data with
InfluxDB and Grafana
2. Agenda
• Introduction and Quick Overview of a RESTfulAPI
• Components and diagram of the How-To
• Deep-dive in Swagger
• Deep-dive on Bash Shell and JQ
• Deep-Dive on InfluxDB 1.xQueries, using Grafana as
a Dashboard system
3. From zero to time-series
Introduction and Quick
Overview -RESTful API
4. What is an API?
Application Programming Interface
Think of an API as a waitress, you have a menu and
you select some food, the waitress takes that order
to the kitchen, who prepares the food, and the
waitress delivers the order to your table
Request
Response
You Server
API
7. What is a REST API?
• REpresentational State Transfer (REST)
• Architectural style based on web standards and the HTTP protocol
• Everything is a resource
• CRUD or HTTP methods
Server-client model
8. GET
HTTP Methods
Most popular protocol used for RESTful implementations is HTTP
REST architecture uses HTML verbs to make requests
Uniquely address data using a uniform and minimal set of
commands
POST
DELETE
PUT
Read data or resources
Create data or resources
Delete data or resources
Update data or resources
9. HTTP response status code
Informational Codes
Redirection Codes
Server ErrorCodes
SuccessfulCodes
Client Error Codes
10. Talking with an API
Use existing tools:
• POSTMAN (GoogleChrome)
• RESTClient (Mozilla Firefox)
• Swagger (when available)
• CURL (for the command-line geek)
12. InfluxDB Server
Database Server to save metrics
Bash Shell Script.sh
Bash Script to collect data
COLLECTOR VISUALIZATION
From RESTful API, to InfluxDB, toVisual
29. Grafana – JSON API Plugin
• By Marcus Olsson
• A great way to query, and parse a JSON on the fly, and show it on
Grafana:
• https://grafana.com/grafana/plugins/marcusolsson-json-datasource
• A non-production ready yet, awesome plugin
30. October 11-12, 2021
Hands-On Flux Training
October 26-27, 2021
Virtual Experience
We look forward to bringing together our
community of developers to learn, interact and
share tips and use cases.
https://www.influxdays.com/influxdays-north-america-2021-virtual-experience/