Skip to content
This repository has been archived by the owner on Dec 11, 2022. It is now read-only.

Dynamic row variable it's not well interpolated #376

Closed
miguelangelmorenochacon opened this issue Sep 23, 2021 · 0 comments
Closed

Dynamic row variable it's not well interpolated #376

miguelangelmorenochacon opened this issue Sep 23, 2021 · 0 comments

Comments

@miguelangelmorenochacon
Copy link

miguelangelmorenochacon commented Sep 23, 2021

Bug Report

When using Repeating Rows, based on a variable called $cloud_run_services which contain mulltiple values ['abc-api', 'xyz-api', 'aaa-api'], a panel inside one of this auto-generated rows the variable interpolated in the SQL query it's not well interpolated.

SQL query

SELECT
  timestamp,
  httpRequest.protocol,
  httpRequest.requestMethod,
  httpRequest.status,
  httpRequest.responseSize,
  httpRequest.latency,
  httpRequest.requestUrl
FROM
  carto-monitoring-gcp.cloud_native_log_sink.run_googleapis_com_requests
WHERE
  resource.labels.service_name = $accounts_cloud_run_services AND
  $__timeFilter(timestamp)

Expected Behavior

"SELECT
  timestamp,
  httpRequest.protocol,
  httpRequest.requestMethod,
  httpRequest.status,
  httpRequest.responseSize,
  httpRequest.latency,
  httpRequest.requestUrl
FROM
  carto-monitoring-gcp.cloud_native_log_sink.run_googleapis_com_requests
WHERE
  resource.labels.project_id = 'carto-acc-us-east1-1' AND
  resource.labels.service_name = 'abc-api' AND
  `timestamp` BETWEEN TIMESTAMP_MILLIS (1632384379085) AND TIMESTAMP_MILLIS (1632395179085)
 LIMIT 2126"

where abc-api is the value of the generated row out of the $cloud_run_services variable

This is the behavior for example in StackDriver data source

Actual Behavior

"SELECT
  timestamp,
  httpRequest.protocol,
  httpRequest.requestMethod,
  httpRequest.status,
  httpRequest.responseSize,
  httpRequest.latency,
  httpRequest.requestUrl
FROM
  carto-monitoring-gcp.cloud_native_log_sink.run_googleapis_com_requests
WHERE
  resource.labels.project_id = 'carto-acc-us-east1-1' AND
  resource.labels.service_name = 'abc-api', 'xyz-api', 'aaa-api' AND
  `timestamp` BETWEEN TIMESTAMP_MILLIS (1632384379085) AND TIMESTAMP_MILLIS (1632395179085)
 LIMIT 2126"

where 'abc-api', 'xyz-api', 'aaa-api' are the values of ALL generated rows out of $cloud_run_services variable

Steps to Reproduce the Problem

  1. Create a new Grafana variable containing multiple values
  2. Create Repeating Rows based on step 1 variable
  3. Create a BigQuery query with a WHERE clause using the step 1 variable

Specifications

  • Version: 2.0.2
  • Platform: Grafana Cloud
  • Grafana Version: Grafana v8.1.4 (6855cdff7c)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant