You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Prometheus-Sql is very helpful, especially the sub-metrics approach. However, sub-metrics doesn't support label fields yet. It makes prometheus-sql not be able to handle multi-row multi-metric scenarios.
Giving a query string as:
select group, subgroup, count, avg from test_table
and the result set as bellow:
group
subgroup
count
avg
a
a1
10
5
b
b1
7
6
We'd like to register metrics as bellow:
metric
value
xxx_count(group = 'a', subgroup='a1')
10
xxx_avg(group = 'a', subgroup='a1')
5
xxx_count(group = 'b', subgroup='b1')
7
xxx_avg(group = 'b', subgroup='b1')
6
To achieve this, shall we treat all fields not specified under sub-metrics as label fields for all sub metrics? e.g.
- xxx:
sql: > select group, subgroup, count, avg from test_tablesub-metrics: # group, subgroup become label fields for both xxx_count and xxx_avg metrics as abovecount: countavg: avginterval: 30s
What's your opinion?
The text was updated successfully, but these errors were encountered:
- pg_statio_user_tables:
data-source: pgmainsql: > SELECT 'MSK-MAIN' as stand, 'pgmain' as pg_instance, schemaname, relname, heap_blks_read, heap_blks_hit,coalesce(idx_blks_read,-1) as idx_blks_read, coalesce(idx_blks_hit,-1) as idx_blks_hit, coalesce(toast_blks_read,-1) as toast_blks_read, coalesce(toast_blks_hit,-1) as toast_blks_hit, coalesce(tidx_blks_read,-1) as tidx_blks_read, coalesce(tidx_blks_hit,-1) as tidx_blks_hit FROM pg_statio_user_tablesinterval: 5msub-metrics:
heap_blks_read: heap_blks_readheap_blks_hit: heap_blks_hit idx_blks_read: idx_blks_readidx_blks_hit: idx_blks_hittoast_blks_read: toast_blks_readtoast_blks_hit: toast_blks_hittidx_blks_read: tidx_blks_readtidx_blks_hit: tidx_blks_hit
in metrics:
# HELP query_result_pg_statio_user_tables_heap_blks_hit Result of an SQL query
# TYPE query_result_pg_statio_user_tables_heap_blks_hit gauge
query_result_pg_statio_user_tables_heap_blks_hit{pg_instance="pgmain",relname="activator_message",schemaname="queue",stand="msk-main"} 4.0721516415e+10
query_result_pg_statio_user_tables_heap_blks_hit{pg_instance="pgmain",relname="alarms",schemaname="state",stand="msk-main"} 198160
query_result_pg_statio_user_tables_heap_blks_hit{pg_instance="pgmain",relname="alarms_sources",schemaname="state",stand="msk-main"} 203279
Only 1 features need prom-sql its custom HELP for replace "Result of an SQL query"
Hi,
Prometheus-Sql is very helpful, especially the sub-metrics approach. However, sub-metrics doesn't support label fields yet. It makes prometheus-sql not be able to handle multi-row multi-metric scenarios.
Giving a query string as:
and the result set as bellow:
We'd like to register metrics as bellow:
To achieve this, shall we treat all fields not specified under sub-metrics as label fields for all sub metrics? e.g.
What's your opinion?
The text was updated successfully, but these errors were encountered: