Forum Stats

  • 3,757,136 Users
  • 2,251,200 Discussions
  • 7,869,738 Comments

Discussions

OEM-Grafana plug:How to increase the number of time-series metrics returned by restful API query ?

2»

Answers

  • User_KIUWR
    User_KIUWR Member Posts: 1 Green Ribbon

    Hi,

    any update on this issue ?

    Thanks

  • Kiwi712
    Kiwi712 Member Posts: 7 Blue Ribbon

    Had a forehead-slapping moment late last week and realized a simple subquery block can control the order in the SQL :

    WITH top_n AS

    (select * from (select collection_timestamp , value , key_value

    from sysman.mgmt$metric_current a, sysman.mgmt$target b

    where b.target_name = $oem_gf_target_name

    and b.target_guid=a.target_guid

    and a.metric_column = 'spaceAllocated'

    and a.metric_name='tbspAllocation'

    ORDER BY to_number(a.value) desc) where rownum < 11 )

    select a.rollup_timestamp as time_sec, a.average as value , a.key_value as metric

    from sysman.mgmt$metric_daily a, sysman.mgmt$target b, top_n y

    where b.target_name = $oem_gf_target_name

    and b.target_guid=a.target_guid

    and a.metric_column = 'spaceAllocated'

    and a.metric_name='tbspAllocation'

    and a.key_value = y.key_value

    ORDER BY 1 ASC;


    Given that the OEM-Grafana plugin is still limiting the effective number of time series to 10 via its restFUL SQL properties ( again from a practical perspective this makes sense ) , there is not much I can do with that but at least now I am able to control the (sort)

    order based on the metric value of interest being displayed such as allocated , used or used/allocated %. A bit frustrating it took me so long to realize the key was in the custom SQL itself but at least I got what I needed. Maybe this helps some others in the user community. - Brett.