Forum Stats

  • 3,734,238 Users
  • 2,246,919 Discussions
  • 7,857,196 Comments

Discussions

OEM 13.4 & Grafana: get metrics from different target type than selected

raphi
raphi Member Posts: 9 Blue Ribbon
edited May 14, 2021 1:47PM in Enterprise Manager

Hi all,

I want to create some dashboards for our developers so they don't have to ask us DBAs how the DB is doing. Unfortunately most of the useful performance metrics belong to target type "oracle_database" but our devs know only the PDBs which their applications are using and don't necessarely know to which DB instance the PDB belongs.

So what I'm trying to do is to let the devs choose a target_name from a list of target_type = 'oracle_pdb' and then present some panels with metrics belonging to target_type = 'oracle_database' from the instance on which the selected PDB is running.

For example with this query (custom/repository) I can display the I/O mbs of the CDB on which the selected PDB is running:

SELECT COLLECTION_TIMESTAMP as time_sec, 
value as value,
metric_column as metric
FROM sysman.mgmt$metric_details
WHERE target_name = (SELECT member_target_name from mgmt$target_members
  WHERE aggregate_target_guid = (SELECT aggregate_target_guid
    FROM mgmt$target_members
    WHERE member_target_name = $oem_gf_target_name
    AND member_target_type = 'oracle_pdb'
    AND aggregate_target_type = 'rac_database')
  AND member_target_type = 'oracle_database')
AND metric_column = 'iombs_ps'
ORDER BY COLLECTION_TIMESTAMP ASC;

The problem with this query is that it allows only for one selected target. What do I need to change to be able to select multiple PDBs from different CDBs and have a line displayed for each CDB? I tried changing "WHERE ... =" into "WHERE ... IN" but it still shows only one line in the panel.

Any help is much appreciated ;)

raphael

Sign In or Register to comment.