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
Copy file name to clipboardExpand all lines: custom-metrics-example/custom-metrics.toml
+6-2Lines changed: 6 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -1,19 +1,23 @@
1
1
[[metric]]
2
2
context = "slow_queries"
3
+
labels = [ "inst_id" ]
3
4
metricsdesc = { p95_time_usecs= "Gauge metric with percentile 95 of elapsed time.", p99_time_usecs= "Gauge metric with percentile 99 of elapsed time." }
4
5
request = '''
5
-
select percentile_disc(0.95) within group (order by elapsed_time) as p95_time_usecs, percentile_disc(0.99) within group (order by elapsed_time) as p99_time_usecs
6
+
select inst_id, percentile_disc(0.95) within group (order by elapsed_time) as p95_time_usecs, percentile_disc(0.99) within group (order by elapsed_time) as p99_time_usecs
6
7
from gv$sql
7
8
where last_active_time >= sysdate - 5/(24*60)
9
+
group by inst_id
8
10
'''
9
11
10
12
[[metric]]
11
13
context = "big_queries"
14
+
labels = [ "inst_id" ]
12
15
metricsdesc = { p95_rows= "Gauge metric with percentile 95 of returned rows.", p99_rows= "Gauge metric with percentile 99 of returned rows." }
13
16
request = '''
14
-
select percentile_disc(0.95) within group (order by rownum) as p95_rows, percentile_disc(0.99) within group (order by rownum) as p99_rows
17
+
select inst_id, percentile_disc(0.95) within group (order by rownum) as p95_rows, percentile_disc(0.99) within group (order by rownum) as p99_rows
15
18
from gv$sql
16
19
where last_active_time >= sysdate - 5/(24*60)
20
+
group by inst_id
17
21
'''
18
22
19
23
# User segment queries may return zero rows on certain database configurations
Copy file name to clipboardExpand all lines: site/docs/configuration/multiple-databases.md
+10-2Lines changed: 10 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -118,7 +118,7 @@ databases:
118
118
# label_name2: label_value2
119
119
```
120
120
121
-
### Only scraping metrics from specific databases
121
+
### Scraping specific metrics from specific databases
122
122
123
123
By default, metrics are scraped from every connected database. To expose only certain metrics on specific databases, configure the `databases` property of a metric. The following metric definition will only be scraped from databases "db2" and "db3":
124
124
@@ -133,4 +133,12 @@ SELECT platform_name, 1 as value FROM gv$database
133
133
databases = [ "db2", "db3" ]
134
134
```
135
135
136
-
If the `databases` array is empty or not provided for a metric, that metric will be scraped from all connected databases.
136
+
If the `databases` array is empty or not provided for a metric, that metric will be scraped from all connected databases.
137
+
138
+
### Duplicated database configurations
139
+
140
+
If one or more database configurations are "duplicated", that is, using the same URL and username, a WARN message is logged:
0 commit comments