Grafana. Display dynamic workers time series and draw gaps in red

I am searching for the examples whether next time series is possible to be implemented in grafana:

enter image description here

another workers example I have found:

enter image description here

I have dynamic list of workers (proceses) that can be started multiple times and each execution is logged as start-end interval and should be connected and displayed.

Processes are dynamic and stored in the database as well:

CREATE TABLE log_table (
        id SERIAL PRIMARY KEY,
        process TEXT NOT NULL,
        execution TEXT NOT NULL,
        start_time TIMESTAMP NOT NULL,
        end_time TIMESTAMP NOT NULL
);

So far I have only found examples where y is harcoded as select in the SQL statement, but for me it can vary.

In addition, I would need to display idle times in red.

I would appreciate any links or examples.

  • 1

    I don’t think you can pass run number into your graph (what I presume in execution column); and read as process not run will be everywhere. But implementation of this is possible.

    – 

  • 2

    You need to generate list of equidistant timestamps (with step 1 minute, for example) between $__from and $__to (search for your DBMS, it might be something like recursive CTE or connect by), and then for each process return if it was run on each step or not.

    – 

Leave a Comment