RousselTMLEARNING

TP · Grafana: From Discovery to Expertise

Project 3: Working with data

What you will learn in this TP
  • Retrieve data in JSON format
  • Understand the notion of default settings
  • Override the default settings
  • Configure alignment based on a specific criterion
  • Display an image instead of its URL
  • Display a gauge instead of its value
  • Apply a 'Threshold'
  • Apply a 'Value mapping'
  • Add a dynamic link
  • Rename the columns
  • Change the column order
  • Hide a column
  • Rename the columns

Introduction #

This project aims to teach you how to work with the table visualization and apply various transformations to it: alignment, sorting, images...
INFO: the table visualization behaves like spreadsheets by default — for instance it will always align numbers to the right and text to the left.
To do this, we'll work with this data (See the data) and display it like this in Grafana (See the expected result)

Queries #

What you will learn in this section
  • Retrieve data in JSON format
  1. Retrieving the data

    You must use the Infinity data source to retrieve data from the repository at: https://github.com/RousselTM/grafana-formation/blob/main/tp/data/projet3.json.
    INFO: to be usable in JSON format, it must be converted to RAW.

Visualizations #

What you will learn in this section
  • Understand the notion of default settings
  • Override the default settings
  • Configure alignment based on a specific criterion
  • Display an image instead of its URL
  • Display a gauge instead of its value
  • Apply a 'Threshold'
  • Apply a 'Value mapping'
  • Add a dynamic link
  • Rename the columns
  1. Visualization type

    You must choose a visualization that represents the data as a table

  2. Title and description

    You must set the visualization's title to 'My first table' and its description to 'Description of my first table'

  3. Alignment

    You must change the default alignment to match the expected result image. All cell content is centered except the 'category' field, which is right-aligned.

  4. Renaming

    You must use the 'Visualization' section to rename the 'category' column to 'Category'.
    INFO: further down we'll see that the same thing can be done another way: with transformations.
  5. Links

    Grafana lets you add interactivity to your table with links. You must add a link so that clicking a row leads to the course page. The link must be in the form https://elearning.rousseltm.fr/training_chapter?id=ID, where 'ID' matches the content of the 'id' field.

  6. The 'Mapping'

    Grafana lets you transform how your data is displayed. You must create a mapping so Grafana turns the text 'true' into 'Yes' and 'false' into 'No'. You must also set 'Yes' values to the color 'purple' and 'No' to transparent. We'll also combine this with an 'override' to make Grafana color the entire row based on the 'certification' column's color.

  7. The 'Threshold'

    Grafana lets you color numbers based on their value. You must add 'Thresholds' so that numbers are colored as follows: red: default, orange: > 50000, yellow: > 700000, green: > 800000.

  8. Coloring mode

    Grafana lets you color (text or background) a cell or row based on a value. You must ask Grafana to color the row based on the content of 'certification' and apply it to the whole row. As a reminder, in the previous step we already defined two colors, so there's no need to specify them again.

  9. Gauge mode

    Grafana lets you display a number as a gauge to visually compare values. You must display the view count (Views column) as a gauge

Transformations #

What you will learn in this section
  • Change the column order
  • Hide a column
  • Rename the columns
  1. The HTTP method

    Depending on the call you want to make, the API documentation will tell you which method to use.
    INFO: by default Infinity sends your requests using the 'GET' method. Can you find the option to change it?
  2. Authentication

  3. The accept header

    Grafana relies on 'curl' to query your URLs for the Infinity plugin. Depending on the format you want to get back, you need to request it from the API via a header.
    INFO: we invite you to look into the different values, but in our case the key is 'accept' and the value is:
    • JSON: application/json
    • CSV: text/csv
    How do you configure this parameter in Grafana for the Infinity plugin?

Difficulty level : ●●●○○ (3/5)

Course Glossary

Alerting

The process of notifying teams (via email, Slack, Teams) when a specific event, threshold breach, or anomaly is detected.

HTTP Code 200 (OK)

An HTTP status code indicating that the client's request was successfully processed by the server.

HTTP Code 403 (Forbidden)

An HTTP status code indicating that the server understood the request but refuses to authorize it, usually due to a lack of permissions.

HTTP Code 404 (Not Found)

An HTTP status code indicating that the requested resource could not be found on the server.

Grafana

An open-source interactive data visualization platform that allows users to create, explore, and share analytic dashboards from multiple time-series d...

Recommended Articles

License consumption types

Understand the evolution of billing in Dynatrace: the difference between the old licensing model ...

Grafana Alloy: The importance of Self-Monitoring

Discover why and how to configure Grafana Alloy so that it monitors itself, collecting its own lo...

Grafana Alloy: Understanding and exploiting the User Interface (UI)

Discover how to enable, secure, and use Grafana Alloy's built-in web interface to visualize your ...

Grafana Alloy: Introduction and Architecture

Discover the fundamental concepts of Grafana Alloy, the transition from the static Agent to Alloy...

Grafana Alloy: Syntax and Configuration (Alloy Language: River)

As part of a Grafana training or observability training, master the declarative syntax of Grafana...

Grafana Alloy: Metrics Collection (Prometheus & Ecosystem)

Learn how to configure Grafana Alloy to collect, transform, and forward metrics using the Prometh...

Grafana Alloy: Log Management with Loki

Discover how to configure Grafana Alloy to read log files, journald, or network streams, process ...

Grafana Alloy: Trace Management with Tempo

Dive into distributed trace processing. Learn how to ingest OTLP, Jaeger, or Zipkin traces with G...

Grafana Alloy: Continuous Profiling with Pyroscope

Discover how to configure continuous profiling in your environments using Grafana Alloy and Pyros...

Grafana Alloy: Advanced Deployment and Clustering

Learn how to manage large-scale Grafana Alloy deployments. Configure Clustering mode for high ava...

Grafana Assistant: AI at the service of observability

Discover Grafana Assistant, the artificial intelligence integrated into Grafana Cloud. Learn how ...

Grafana Alloy vs OpenTelemetry Collector: Which One Should You Choose?

A detailed comparison between Grafana Alloy and the OpenTelemetry Collector. Discover the strengt...

Grafana Alloy vs Dynatrace ActiveGate: Which to choose?

Comparison between Grafana Alloy and Dynatrace ActiveGate. Understand the fundamental differences...