Skip to content

Grafana dashboard Variables are not interpolated #256

@kikillus

Description

@kikillus

Hi,
we are using Trino 428 with the official Trino datasource provided by Grafana in version 1.0.6

We have set some Dashboard variables in Grafana, e.g. variable1. However, using them in a Query they do not seem to be replaced.

A sample Query like the following

SELECT
    *
FROM
    table
WHERE
    $__timefilter(datetime) AND
    column1 = $variable1

Fails with (line no. won't match, above example)
error querying the database: trino: query failed (200 OK): "io.trino.sql.parser.ParsingException: line 11:19: mismatched input '$'. Expecting: 'ALL', 'ANY', 'SOME', <expression>"

The query actually sent to trino looks like the following.

SELECT
    *
FROM
    table
WHERE
    datetime BETWEEN TIMESTAMP '2024-02-01 13:00:00' AND TIMESTAMP  '2024-02-01 13:59:59'  AND
    column1 = $variable1

The timefilter Macro seems to be applied correctly, while the dashboard variable does not get replaced.

We have contacted the Support by Grafana, they said the problem was within the trino plugin as using other datasources the variables are interpolated correctly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions