You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2021/08/13 14:23:07 UTC

[GitHub] [superset] mancubus77 commented on issue #2686: [feature] Prometheus (or other TSDB) as data source

mancubus77 commented on issue #2686:
URL: https://github.com/apache/superset/issues/2686#issuecomment-898493711


   For people who wants connect superset with Prom and other TSDBs. It's possible with Trino/Starburst.  
   ```
   trino> PREPARE my_select1 FROM SELECT * FROM prometheus.default.prometheus_sd_updates_total;
   PREPARE
   trino> DESCRIBE OUTPUT my_select1;
    Column Name |  Catalog   | Schema  |            Table            |            Type             | Type Size | Aliased
   -------------+------------+---------+-----------------------------+-----------------------------+-----------+---------
    labels      | prometheus | default | prometheus_sd_updates_total | map(varchar, varchar)       |         0 | false
    timestamp   | prometheus | default | prometheus_sd_updates_total | timestamp(3) with time zone |         8 | false
    value       | prometheus | default | prometheus_sd_updates_total | double                      |         8 | false
   (3 rows)
   ```
   Unfortunately PromQL won't be available and you might need to use presto SQL, for example:
   ```
   trino> SELECT count(element_at(labels, 'code')) FROM prometheus.default.prometheus_http_requests_total where  element_at(labels, 'code') = '200';
    _col0
   -------
      671
   (1 row)
   ```
   this SQL above count all label `code=200` from `prometheus_http_requests_total` metric


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org