pgexporter_ext functions
pgexporter_get_functions
Description: Prints out all the functions available in pgexporter_ext.
Output Format:
fnametext: Name of the function.has_inputboolean: True (t) if the function takes in arguments. False (f) otherwise.descriptiontext: Description of the function.ftypetext (values:"gauge"|""): Mentions the type of Prometheus metric its output is of.
SELECT * FROM pgexporter_get_functions();SELECT * FROM pgexporter_get_functions();| fname | has_input | description | ftype |
+--------------------------+-----------+--------------------------------------+-------+
| pgexporter_version_ext | f | pgexporter extension version | gauge |
| pgexporter_is_supported | t | Is the pgexporter function supported | |
| pgexporter_get_functions | f | Get the pgexporter functions | |
| pgexporter_used_space | t | Get the used disk space | gauge |
| pgexporter_free_space | t | Get the free disk space | gauge |
| pgexporter_total_space | t | Get the total disk space | gauge |
| pgexporter_os_info | f | The OS information | gauge |
| pgexporter_cpu_info | f | The CPU information | gauge |
| pgexporter_memory_info | f | The memory information | gauge |
| pgexporter_network_info | f | The network information | gauge |
| pgexporter_load_avg | f | The load averages | gauge |
(11 rows)| fname | has_input | description | ftype |
+--------------------------+-----------+--------------------------------------+-------+
| pgexporter_version_ext | f | pgexporter extension version | gauge |
| pgexporter_is_supported | t | Is the pgexporter function supported | |
| pgexporter_get_functions | f | Get the pgexporter functions | |
| pgexporter_used_space | t | Get the used disk space | gauge |
| pgexporter_free_space | t | Get the free disk space | gauge |
| pgexporter_total_space | t | Get the total disk space | gauge |
| pgexporter_os_info | f | The OS information | gauge |
| pgexporter_cpu_info | f | The CPU information | gauge |
| pgexporter_memory_info | f | The memory information | gauge |
| pgexporter_network_info | f | The network information | gauge |
| pgexporter_load_avg | f | The load averages | gauge |
(11 rows)pgexporter_version_ext
Description: Provides the enabled version of pgexporter_ext:
Output Format:
pgexporter_version_exttext: Enabled version ofpgexporter_ext.
SELECT * FROM pgexporter_version_ext();SELECT * FROM pgexporter_version_ext();pgexporter_version_ext
------------------------
0.3.0
(1 row)pgexporter_version_ext
------------------------
0.3.0
(1 row)pgexporter_is_supported
Description: Checks if provided function name is one of the pgexporter_ext's functions.
Input Arguments:
fnametext: Name of the function.
Output Format:
pgexporter_is_supportedboolean: True (t) if the function is one of the supported functions ofpgexporter_ext. False (f) otherwise.
SELECT * FROM pgexporter_is_supported('hello_world');SELECT * FROM pgexporter_is_supported('hello_world');pgexporter_is_supported
-------------------------
f
(1 row)pgexporter_is_supported
-------------------------
f
(1 row)SELECT * FROM pgexporter_is_supported('pgexporter_version_ext');SELECT * FROM pgexporter_is_supported('pgexporter_version_ext');pgexporter_is_supported
-------------------------
t
(1 row)pgexporter_is_supported
-------------------------
t
(1 row)pgexporter_used_space
Description: Get the used disk space of a directory.
SELECT * FROM pgexporter_used_space('/dev');SELECT * FROM pgexporter_used_space('/dev');pgexporter_used_space
-----------------------
1127424
(1 row)pgexporter_used_space
-----------------------
1127424
(1 row)pgexporter_free_space
Description: Get the free disk space of a directory.
SELECT * FROM pgexporter_free_space('/dev');SELECT * FROM pgexporter_free_space('/dev');pgexporter_free_space
-----------------------
4194304
(1 row)pgexporter_free_space
-----------------------
4194304
(1 row)Input Arguments:
dir_pathtext: Directory path.
SELECT * from pgexporter_free_space('/home');SELECT * from pgexporter_free_space('/home');pgexporter_free_space
-----------------------
285776547840
(1 row)pgexporter_free_space
-----------------------
285776547840
(1 row)pgexporter_total_space
Description: Get the free disk space of a directory.
Input Arguments:
dir_pathtext: Directory path.
SELECT * from pgexporter_total_space('/home');SELECT * from pgexporter_total_space('/home');pgexporter_free_space
-----------------------
285776547840
(1 row)pgexporter_free_space
-----------------------
285776547840
(1 row)pgexporter_os_info
Description: Gives information about the current operating system.
Output Format:
nametext: Name of the Operating System.versiontext: Version of the kernel.architecturetext: CPU architecture of the machine.host_nametext: Host name of the machine.domain_nametext: Domain name of the machine.process_countinteger: Number of active process running on the machine.uptime_secondsinteger: Uptime of the OS in seconds.
SELECT * FROM pgexporter_os_info();SELECT * FROM pgexporter_os_info();| name | version | architecture | host_name | domain_name | process_count | uptime_seconds |
+----------------------------------+-----------------------------+--------------+-----------+-------------+---------------+----------------+
| Fedora release 38 (Thirty Eight) | Linux 6.4.4-200.fc38.x86_64 | x86_64 | fedora | (none) | 357 | 2417 |
(1 row)| name | version | architecture | host_name | domain_name | process_count | uptime_seconds |
+----------------------------------+-----------------------------+--------------+-----------+-------------+---------------+----------------+
| Fedora release 38 (Thirty Eight) | Linux 6.4.4-200.fc38.x86_64 | x86_64 | fedora | (none) | 357 | 2417 |
(1 row)pgexporter_cpu_info
Description: Gives information about the CPU of the system.
Output Format:
vendortext: CPU Vendor name.model_nametext: CPU Model name.number_of_coresinteger: Number of cores the CPU has.clock_speed_hzbigint: Clock speed of the CPU in Hertz.l1dcache_sizeinteger: Size of L1 D-Cache (Data Cache) of the CPU.l1icache_sizeinteger: Size of L1 I-Cache (Instruction Cache) of the CPU.l2cache_sizeinteger: Size of L2 Cache of the CPU.l3cache_sizeinteger: Size of L3 Cache of the CPU.
SELECT * FROM pgexporter_cpu_info();SELECT * FROM pgexporter_cpu_info();| vendor | model_name | number_of_cores | clock_speed_hz | l1dcache_size | l1icache_size | l2cache_size | l3cache_size |
+--------------+------------------------------------------------+-----------------+----------------+---------------+---------------+--------------+--------------+
| GenuineIntel | 11th Gen Intel(R) Core(TM) i5-1135G7 @ 2.40GHz | 4 | 752459008 | 48 | 32 | 1280 | 8192 |
(1 row)| vendor | model_name | number_of_cores | clock_speed_hz | l1dcache_size | l1icache_size | l2cache_size | l3cache_size |
+--------------+------------------------------------------------+-----------------+----------------+---------------+---------------+--------------+--------------+
| GenuineIntel | 11th Gen Intel(R) Core(TM) i5-1135G7 @ 2.40GHz | 4 | 752459008 | 48 | 32 | 1280 | 8192 |
(1 row)pgexporter_memory_info
Description: Gives information about the primary memory, swap space and cache of the system.
Output Format:
total_memorybigint: Total size of the memory.used_memorybigint: Memory in use currently.free_memorybigint: Free memory left to use.swap_totalbigint: Total swap space memory.swap_usedbigint: Swap space memory in use currently.swap_freebigint: Free swap space memory left to use.cache_totalbigint: Total cache memory.
SELECT * FROM pgexporter_memory_info();SELECT * FROM pgexporter_memory_info();| total_memory | used_memory | free_memory | swap_total | swap_used | swap_free | cache_total|
--------------+-------------+-------------+------------+-----------+-----------+-------------+
| 7834600 | 5267188 | 399432 | 12027896 | 0 | 12008184 | 3807456|
(1 row)| total_memory | used_memory | free_memory | swap_total | swap_used | swap_free | cache_total|
--------------+-------------+-------------+------------+-----------+-----------+-------------+
| 7834600 | 5267188 | 399432 | 12027896 | 0 | 12008184 | 3807456|
(1 row)pgexporter_network_info
Description: Network statistics.
Output Format:
interface_nametext: Name of the network interface. (eg.lo,docker0,enp2s0, etc.).ip_addresstext: Private IP of the network interface.tx_bytesbigint: Number of bytes transmitted.tx_packetsbigint: Number of packets transmitted.tx_errorsbigint: Number of errors during transmission.tx_droppedbigint: Number of packets dropped during transmission.rx_bytesbigint: Number of bytes received.rx_packetsbigint: Number of packets received.rx_errorsbigint: Number of errors during receiving.rx_droppedbigint: Number of packets dropped during receiving.link_speed_mbpsinteger: Speed of the link in Mbps
pgexporter_load_avg
Description: Load averages.
SELECT * FROM pgexporter_load_avg();SELECT * FROM pgexporter_load_avg();load_avg_one_minute | load_avg_five_minutes | load_avg_ten_minutes
---------------------+-----------------------+----------------------
0.23 | 0.21 | 0.15
(1 row)load_avg_one_minute | load_avg_five_minutes | load_avg_ten_minutes
---------------------+-----------------------+----------------------
0.23 | 0.21 | 0.15
(1 row)