MYSQL datasource with No timestamp column - Moving time-series not generated

  • What Grafana version and what operating system are you using?
    version": “7.5.3”

  • What are you trying to achieve?
    Plot time-series with Metric as IPv4 address and Value as a Count (int)

Query -
SELECT
UNIX_TIMESTAMP() as time,
ipv4_addr as metric,
total_hits as value
FROM
Table_A
ORDER BY “time” ASC

  • How are you trying to achieve it?
    I created a time-series dashboard. Configured Mysql data source and issued the above query.

  • What happened?
    The query returns 100 data points; I see 100 dots on the graph vertically in the same line at the rightmost end of the graph. Line graph is not plotted and is not moving. It looks like below

  • What did you expect to happen?
    A proper line graph to be plotted instead of single dot for every data point

  • Can you copy/paste the configuration(s) that you are having problems with?
    Query -
    SELECT
    UNIX_TIMESTAMP() as time,
    ipv4_addr as metric,
    total_hits as value
    FROM
    Table_A
    ORDER BY “time” ASC

  • Did you receive any errors in the Grafana UI or in related logs? If so, please tell us exactly what they were.
    No errors

  • Did you follow any online instructions? If so, what is the URL?
    No

Its not a moving time series because you have only one timestamp for all of the metrics

I am new to Grafana. What is the right way to structure this query to plot a line graph? My understanding is the query will refresh at an interval and the UNIX timestamp value will change.

Time series might not be what you want because you have no series of time aka time series

whats the best way to visualize and generate alert for data.
My data in DBMS looks like this below

IP.     count
IP1.   20
IP2.  50
IP3.  5
IP4.  15

If the count is less than 10 generate alert.

I would go with maybe a stat chart or bar chart or gauge.

For alerts please open a different question

1 Like

Yes, that looks good. I decided to go with the Graph option because of the alert module that I can use to send alerts. I don’t see the alert tab for any other visualizations.

1 Like