grafana-aws-athena-datasource
grafana-aws-athena-datasource copied to clipboard
Query / Get Data Issue
I tried the latest version locally on Mac.
Table View
- without any parameter set, I see only data for a few rows
- when I set as Legend Format "{{ }}" I can see all rows => I think this is ok, that is a working workaround
Graph View
- I am not able to get the graph to show data, it always says "Unable to graph data, switch to table view"
- when I use the QueryInspector and set for Legend "{{ }}" , then I can see in the "data" tab all fields, but it will not use them in the graph
- this is really a blocker for me, it seems the query parameter somehow affect if the data is accepted in the graph
Here is how my query and response object looks like, does the response section maybe need to contain something in the "series" field. Does the below look correct?
Object request:Object url:"api/ds/query" method:"POST" data:Object queries:Array[1] 0:Object format:"timeserie" region:"default" workgroup:"" queryExecutionId:"3d3318f6-92a0-45fc-bff9-78ebd5139970" timestampColumn:"datetime" valueColumn:"totalrequests" legendFormat:"{{ }}" timeFormat:"" maxRows:"-1" cacheDuration:"3000s" queryString:"" refId:"A" datasource:"AWS Athena datasource" inputs:Array[1] outputLocation:undefined datasourceId:11 intervalMs:120000 maxDataPoints:990 orgId:1 range:Object from:"1592642122545" to:"1592814922545" response:Object results:Object A:Object refId:"A" series:null tables:null dataframes:Array[1] 0:"QVJST1cxAAD/////CAMAABAAAAAAAAoADgAMAAsABAAKAAAAFAAAAAAAAAEDAAoADAAAAAgABAAKAAAACAAAAJ
Meta Queries
- using one variable as part of the next variable seems not to work always, but i think that s nature of Grafana
- all queries work, except my query "query_execution_ids_by_name", I will debug this, maybe it needs some trimming of whitespaces
The "query_execution_ids_by_name" does not work for me, because I have a pretty complicated SQL query, which basically destroys the regex comparison.
You could add a flag to do a exact string comparison (exactStringMatch bool):
func (ds *AwsAthenaDatasource) getQueryExecutions(ctx context.Context, pluginContext backend.PluginContext, region string, workGroup string, pattern string, to time.Time, exactStringMatch bool) ([]*athena.QueryExecution, error) {
And then check this in the comparison:
if (exactStringMatch && (pattern == *q.Query)) || r.MatchString(*q.Query) { fbo = append(fbo, q) }
This works for me.