-
Notifications
You must be signed in to change notification settings - Fork 45
/
720-pg_func.yml
51 lines (49 loc) · 1.66 KB
/
720-pg_func.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
##
# SYNOPSIS
# pg_func_*
#
# DESCRIPTION
# PostgreSQL function metrics
#
# OPTIONS
# Tags []
# TTL 10
# Priority 0
# Timeout 100ms
# Fatal false
# Version 90400 ~ higher
# Source 720-pg_func.yml
#
# METRICS
# datname (LABEL)
# Name of belonged database
# funcname (LABEL)
# Name of this function, may have multiple override
# calls (COUNTER)
# Number of times this function has been called
# total_time (COUNTER)
# Total time spent in this function and all other functions called by it, in seconds
# self_time (COUNTER)
# Total time spent in this function itself, not including other functions called by it, in seconds
#
pg_func:
desc: PostgreSQL function metrics
query: SELECT CURRENT_CATALOG AS datname, schemaname || '.' || funcname AS funcname, sum(calls) AS calls, sum(total_time) AS total_time, sum(self_time) AS self_time FROM pg_stat_user_functions GROUP BY 2 ORDER BY 4 DESC LIMIT 128;
ttl: 10
min_version: 090400
metrics:
- datname:
usage: LABEL
description: Name of belonged database
- funcname:
usage: LABEL
description: Name of this function, may have multiple override
- calls:
usage: COUNTER
description: Number of times this function has been called
- total_time:
usage: COUNTER
description: Total time spent in this function and all other functions called by it, in ms
- self_time:
usage: COUNTER
description: Total time spent in this function itself, not including other functions called by it, in ms