Hey guys so I have a custom datasource plugin. What im trying to do is make an http request to an outside source for each ‘x’ number of elements inside of a switch statement. After the results I want to add that information to the ‘data’ frame so I can further use that data to be rendered in a table.
My issue is that the value being showed in the table in [object promise]
Here is where it the issue occurs
logs.map(async (log) => {
switch (log._source.route) {
case '/heatmap':
resolveHeatmap(log._source.request_parameters, log._source.entity_ids ,'Geospatial insight').
then((resolvedEntities) => {
console.log(resolvedEntities)
data[0].add({
client: log._source.client_name,
allowed_types: log._source.request_types,
request_time: log._source.request_time,
resolved_entities: resolvedEntities })
});
break;
default:
}
In my grafana table I end up with an empty object of a promise in my ‘resolved_entities’ column.