Non-numeric value field

Grafana: 5.0.3 (I think, where does one check this?)
Grafana host: Windows 7 Pro, 64 bit
MySQL server: Maria DB 10.2, Debian Jessie 64 bit

I’m building my first dashboard.

I have a data source in MySQL that is a single table of hourly ping test results for my servers covering several years worth of data.

The table structure is simple-

+-------------+-------------------------------
| Field       | Type
+-------------+-------------------------------
| id          | int(10) unsigned
| source      | enum(<list of source hostnames>)
| target      | enum('<list of ping targets>)
| packet_size | smallint(4)
| start       | datetime
| min         | decimal(5,1)        
| mean        | decimal(5,1)
| max         | decimal(5,1)
| %_lost      | decimal(5,1)
+-------------+--------------------------------

I set up a single horizontal time series chart for the min / mean / max values (Chart A), with another below (Chart B) for % packet loss. This all works well. If I hover the cursor over a chart I see the specific numeric value at that time. All good so far.

Issue
Over time I have used different ping target addresses, so the numbers aren’t strictly comparable from one time period to another.

I was hoping to simply add the target value as a new “line source” on the chart, then hide the chart line display, but still have the ping target name appear in the hover data popup.

Unfortunately, I assume because the target is a string value not a number, this field is just being ignored.

(Note the generated SQL query is non-aggregated, so there’s no issue with trying to aggregate a string/enum column).

Im wondering if i’m going about this the wrong way. Is there a better way to achieve what i’m aiming for?

Hi,

A bit unsure what you’re trying to accomplish here since you have targets (which seems to be a list of ping targets according to table schema) - doesn’t make sense to me. Nevertheless, instead of hiding your target line you may be able to use Series specific overrides and customize the plot of the target series.

Marcus

What I have in effect is an “annotation” for every data point, as text, that says what the ping target was. This value changes only rarely, but it makes a difference to what “best case” minimum ping you can expect.

There is vastly too much of this data to label every point, but I was hoping to make it available in the on-hover popup when one hovers over a data line.

I came to the conclusion that time series charts only support numerical data, so the best I have been able to come up with is a calculated query column that outputs a value of 1 whenever the ping target changes in the data, and zero otherwise. By plotting this on the secondary axis I can get a “witness line” on the chart to show where the ping target changed, but I can’t display what it changed to.

Note- I also get a spurious “changed” line at the left hand side of the chart because the first ping target is considered a change from NULL as the previous value, but i can live with that.