Regression Analysis Question

  • What Grafana version and what operating system are you using?
    – Grafana v10.4.0 (03f502a94d) on Docker Container

  • What are you trying to achieve?
    – Regression Analysis and future proiection

  • How are you trying to achieve it?
    – Using Transformation

  • What happened?
    – I can’t accomplish what needed

  • What did you expect to happen?

  • Can you copy/paste the configuration(s) that you are having problems with?

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

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

Dear all,
I’m trying to use the Regression Analysis to try projecting the trend of a graph in the future. My goal is to esthimate when a particular value is reached.
In example in the graph below, I’m monitoring the free space. I would like that, setting the graph end time in the future, the regression line would be continue to let me know when the space will be zero or on what point is the free space at the end of the choosen period.

The regression line stops on the last value collected (now), but if I set the end date to 17 march, would be nice the red line continues based on the trend.
Is that possible?

In addiction, if that would be possible, could I setup an alert that checks i.e. the graph in a timeperiod that could be start: 1 month ago and end: 1 month in the future. If in this time range the regression line goes under a value, then trigger an alert.

Thanks for the help!

Simon

Hello,

I’m not sure you can display information that don’t have yet…
Maybe you can try to perform the different calculations you need for your estimation on a backend server, which will send the data at the time you want.
I’m doing this with a php server to perform some modification on data, then add a timestamp value and send it on a mysql database.

$timestamp = time();
$data1 = "some value";
$data2 = "some value";

// Connect to database
try {
    $pdo = new PDO("mysql:host=$DB_HOST;dbname=$DBNAME", $USER, $PASSWORD);
    $pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
} catch (PDOException $e) {
    die("Error: Could not connect to the database. " . $e->getMessage());
}


// Insert new values into database
try {
    $stmt = $pdo->prepare("INSERT INTO data (time, data1, data2) VALUES (?, ?, ?)");
    $stmt->execute([$timestamp, $data1, $data2]);
} catch (PDOException $e) {
    die("Error: Could not insert data into the database. " . $e->getMessage());
}

Maybe by making a for loop you could build different futur time?

Regards

Thank you, but I’ve a influxdbv2 behind and would not like to put into not real data. What happens then when the real data comes in?
So another solution would be better. Maybe it’s a feature request?
Thanks!
Simon

Hi all,
Nobody can suggest some hints on how to accomplish this?
Thanks!
Simon

Hello,

If you don’t care about resource consumption, you can create a new measurement, into which you’ll place your preventative data. Then build your dashboard with your original metric and the new one. This will generate double values, will require doubling every query you make and, I think, very difficult to set up, but it might work…
The suggestion of feature sounds good to me, you might want to post it in GitHub:

Regards