Company
Date Published
Author
Simon Crute
Word count
440
Language
English
Hacker News points
None

Summary

A recent inquiry from a customer about translating esoteric IDs or serial numbers into user-friendly names in Grafana led to an exploration of how this can be achieved using SQL, which Grafana now supports. The process involves storing data, such as service IDs and corresponding display names, in a data source accessible by Grafana, like MariaDB/MySQL or Postgres. Once the data is in the database, Grafana's Dashboard Settings allow for the creation of new variables, where the database column assigned to __text is used for display, and __value is used during queries. This approach enables the display of user-friendly names while using the original values for querying, and it works seamlessly across various dashboard elements, including dropdowns and graph titles. The article emphasizes attention to security in production environments and offers further guidance through the MySQL data source documentation, inviting additional inquiries about monitoring best practices.