The correction is integrated into the TP (See the green boxes)
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
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.
To do this, open the provided URL. On the GitHub page, just click 'Raw' and you'll get a new URL (https://raw.githubusercontent.com/RousselTM/grafana-formation/refs/heads/main/tp/data/projet3.json) in RAW format. This one can be used in Grafana.
INFO: the procedure may vary depending on the tool: GitLab, Azure DevOps, ...
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
Visualization type
You must choose a visualization that represents the data as a table
To do this, in the 'Visualization' section choose the 'Table' type, which displays the data as a table
Title and description
You must set the visualization's title to 'My first table' and its description to 'Description of my first table'
To do this, fill in the 'Title' and 'Description' fields in the 'Visualization' section
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.
There are several ways to do this, but best practice is to set the default alignment to 'center' and set a specific alignment for 'category'. To do this, in 'Visualization', select 'Center' in the 'Column alignment' option. Then you just need to create an override rule. There's an add button at the bottom of the 'Visualization' section, but in some versions you may find a tab button under 'Overrides'. Click 'Add field override' and follow these steps:
- Select 'Fields with name': since we already know the field name.
- Select 'category': as requested in the instructions
- Click 'Add override property'.
- Select 'Column alignment'.
- Select 'Right': as requested in the instructions
INFO: when you override an option, Grafana shows this by adding a colored dot (blue, orange, ...) right after the option's title.
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.
To do this, we'll add a new override rule. Since there's already a rule on this field, we won't add a new rule but will add a new property to the previous alignment rule instead. Click 'Add override property' and follow these steps:
- Select 'Standard options > Display name'.
- Enter 'Category': as requested in the instructions
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.
To do this, in the same 'Visualization' section, add a link with 'Add link' in the 'Data links and actions' section.
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.
To do this, in the same 'Visualization' section, add a link with 'Add value mappings' in the 'Value mappings' section. In the window that opens, add two mappings with these values respectively: - true:
- Value: true
- Display text: Yes
- Color: purple
- Value: false
- Display text: No
- Color: transparent
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.
To do this, in the same 'Visualization' section, in the 'Thresholds' section, add several 'Thresholds' with 'Base' set to red and each other color set to the requested value
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.
Since this applies to every column, there's no need to add an 'override' — apply it to the whole table instead. To do this, in the same 'Visualization' section, in 'Cell options', set 'Cell type' to 'Colored background' and enable 'Apply to entire row'
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
This can't be applied generally since it only concerns the 'Views' column. You must add an 'override' on it and set the 'Cell options > Cell type' property to 'Gauge'
Transformations #
What you will learn in this section
- Change the column order
- Hide a column
- Rename the columns
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?
Right next to the URL field, click the 'HTTP method, Query, Headers' button. Once the window opens, go to the 'Method & Body' tab and set the method that matches the endpoint given in the URL field.
Authentication
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:
How do you configure this parameter in Grafana for the Infinity plugin?- JSON: application/json
- CSV: text/csv
Right next to the URL field, click the 'HTTP method, Query, Headers' button. Once the window opens, go to the 'Headers' tab
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...