Error in condition in where clause in timescale db while visualising in grafana

174 views Asked by At

I am trying to visualise in Grafana from timescale db with the following query

SELECT $__timeGroup(timestamp,'30m'), sum(error) as Error
FROM userCounts
WHERE serviceid IN ($Service) AND ciclusterid IN ($CiClusterId)
  AND environment IN ($environment) AND filterid IN ($filterId)
  AND $__timeFilter("timestamp")
GROUP BY timestamp;

however it gives an error and no data shows when i add the filterid IN ($filterId) part

have checked the variable names a thousand times but not sure what is error. Logically if the filters for variables are working in other conditions , it should work here also. not sure what is going wrong. Can anyone give input ?

Edit:

The schema is like

timestamp                        | timestamp without time zone |           | not nul
l | 
 measurement                      | character varying(150)      |           |        
  | 
 filterid                         | character varying(150)      |           |        
  | 
 environment                      | character varying(150)      |           |        
  | 
 iscanary                         | boolean                     |           |        
  | 
 servicename                      | character varying(150)      |           |        
  | 
 serviceid                        | character varying(150)      |           |        
  | 
 ciclusterid                      | character varying(150)      |           |    

--more--   

In grafana , it is giving the error

pq: column "in_orgs_that_have_had_an_operational_connector" does not exist

Where filterId = IN_ORGS_THAT_HAVE_HAD_AN_OPERATIONAL_CONNECTOR is selected, it is a value and not a column so not sure why they mentioned that, also they are showing in lower case while the value is in uppercase

0

There are 0 answers