1 Star 0 Fork 7

wgc1314/openGauss-prometheus-exporter

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
default_all.yml 112.31 KB
一键复制 编辑 原始数据 按行查看 历史
travelliu 提交于 2024-01-18 12:00 . Resubmit the code
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455
# ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
# ┃ pg_stat_database
# ┃ openGauss database statistics
# ┣┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈
# ┃ TTL ┆ -1
# ┃ Timeout ┆ 1s
# ┣┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈
# ┃ LABEL datid OID of a database
# ┃ LABEL datname Name of this database
# ┃ GAUGE numbackends Number of backends currently connected to this database. This is the only column in this view that returns a value reflecting current state; all other columns return the accumulated values since the last reset.
# ┃ COUNTER xact_commit Number of transactions in this database that have been committed
# ┃ COUNTER xact_rollback Number of transactions in this database that have been rolled back
# ┃ COUNTER blks_read Number of disk blocks read in this database
# ┃ COUNTER blks_hit Number of times disk blocks were found already in the buffer cache, so that a read was not necessary (this only includes hits in the openGauss buffer cache, not the operating system's file system cache)
# ┃ COUNTER tup_returned Number of rows returned by queries in this database
# ┃ COUNTER tup_fetched Number of rows fetched by queries in this database
# ┃ COUNTER tup_inserted Number of rows inserted by queries in this database
# ┃ COUNTER tup_updated Number of rows updated by queries in this database
# ┃ COUNTER tup_deleted Number of rows deleted by queries in this database
# ┃ COUNTER conflicts Number of queries canceled due to conflicts with recovery in this database. (Conflicts occur only on standby servers; see pg_stat_database_conflicts for details.)
# ┃ COUNTER temp_files Number of temporary files created by queries in this database. All temporary files are counted, regardless of why the temporary file was created (e.g., sorting or hashing), and regardless of the log_temp_files setting.
# ┃ COUNTER temp_bytes Total amount of data written to temporary files by queries in this database. All temporary files are counted, regardless of why the temporary file was created, and regardless of the log_temp_files setting.
# ┃ COUNTER deadlocks Number of deadlocks detected in this database
# ┃ COUNTER blk_read_time Time spent reading data file blocks by backends in this database, in milliseconds
# ┃ COUNTER blk_write_time Time spent writing data file blocks by backends in this database, in milliseconds
# ┃ COUNTER stats_reset Time at which these statistics were last reset
# ┣┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈
# ┃ pg_stat_database_numbackends{datid,datname} GAUGE Number of backends currently connected to this database. This is the only column in this view that returns a value reflecting current state; all other columns return the accumulated values since the last reset.
# ┃ pg_stat_database_xact_commit{datid,datname} COUNTER Number of transactions in this database that have been committed
# ┃ pg_stat_database_xact_rollback{datid,datname} COUNTER Number of transactions in this database that have been rolled back
# ┃ pg_stat_database_blks_read{datid,datname} COUNTER Number of disk blocks read in this database
# ┃ pg_stat_database_blks_hit{datid,datname} COUNTER Number of times disk blocks were found already in the buffer cache, so that a read was not necessary (this only includes hits in the openGauss buffer cache, not the operating system's file system cache)
# ┃ pg_stat_database_tup_returned{datid,datname} COUNTER Number of rows returned by queries in this database
# ┃ pg_stat_database_tup_fetched{datid,datname} COUNTER Number of rows fetched by queries in this database
# ┃ pg_stat_database_tup_inserted{datid,datname} COUNTER Number of rows inserted by queries in this database
# ┃ pg_stat_database_tup_updated{datid,datname} COUNTER Number of rows updated by queries in this database
# ┃ pg_stat_database_tup_deleted{datid,datname} COUNTER Number of rows deleted by queries in this database
# ┃ pg_stat_database_conflicts{datid,datname} COUNTER Number of queries canceled due to conflicts with recovery in this database. (Conflicts occur only on standby servers; see pg_stat_database_conflicts for details.)
# ┃ pg_stat_database_temp_files{datid,datname} COUNTER Number of temporary files created by queries in this database. All temporary files are counted, regardless of why the temporary file was created (e.g., sorting or hashing), and regardless of the log_temp_files setting.
# ┃ pg_stat_database_temp_bytes{datid,datname} COUNTER Total amount of data written to temporary files by queries in this database. All temporary files are counted, regardless of why the temporary file was created, and regardless of the log_temp_files setting.
# ┃ pg_stat_database_deadlocks{datid,datname} COUNTER Number of deadlocks detected in this database
# ┃ pg_stat_database_blk_read_time{datid,datname} COUNTER Time spent reading data file blocks by backends in this database, in milliseconds
# ┃ pg_stat_database_blk_write_time{datid,datname} COUNTER Time spent writing data file blocks by backends in this database, in milliseconds
# ┃ pg_stat_database_stats_reset{datid,datname} COUNTER Time at which these statistics were last reset
# ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
pg_stat_database:
name: pg_stat_database
desc: openGauss database statistics
query:
- name: pg_stat_database
sql: select * from pg_stat_database where datname NOT IN ('template0','template1')
version: '>=0.0.0'
timeout: 1
ttl: -1
status: enable
dbRole: ""
metrics:
- name: datid
description: OID of a database
usage: LABEL
- name: datname
description: Name of this database
usage: LABEL
- name: numbackends
description: Number of backends currently connected to this database. This is the only column in this view that returns a value reflecting current state; all other columns return the accumulated values since the last reset.
usage: GAUGE
- name: xact_commit
description: Number of transactions in this database that have been committed
usage: COUNTER
- name: xact_rollback
description: Number of transactions in this database that have been rolled back
usage: COUNTER
- name: blks_read
description: Number of disk blocks read in this database
usage: COUNTER
- name: blks_hit
description: Number of times disk blocks were found already in the buffer cache, so that a read was not necessary (this only includes hits in the openGauss buffer cache, not the operating system's file system cache)
usage: COUNTER
- name: tup_returned
description: Number of rows returned by queries in this database
usage: COUNTER
- name: tup_fetched
description: Number of rows fetched by queries in this database
usage: COUNTER
- name: tup_inserted
description: Number of rows inserted by queries in this database
usage: COUNTER
- name: tup_updated
description: Number of rows updated by queries in this database
usage: COUNTER
- name: tup_deleted
description: Number of rows deleted by queries in this database
usage: COUNTER
- name: conflicts
description: Number of queries canceled due to conflicts with recovery in this database. (Conflicts occur only on standby servers; see pg_stat_database_conflicts for details.)
usage: COUNTER
- name: temp_files
description: Number of temporary files created by queries in this database. All temporary files are counted, regardless of why the temporary file was created (e.g., sorting or hashing), and regardless of the log_temp_files setting.
usage: COUNTER
- name: temp_bytes
description: Total amount of data written to temporary files by queries in this database. All temporary files are counted, regardless of why the temporary file was created, and regardless of the log_temp_files setting.
usage: COUNTER
- name: deadlocks
description: Number of deadlocks detected in this database
usage: COUNTER
- name: blk_read_time
description: Time spent reading data file blocks by backends in this database, in milliseconds
usage: COUNTER
- name: blk_write_time
description: Time spent writing data file blocks by backends in this database, in milliseconds
usage: COUNTER
- name: stats_reset
description: Time at which these statistics were last reset
usage: COUNTER
status: enable
ttl: -1
timeout: 1
public: true
# ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
# ┃ pg_downstream
# ┃ openGauss replication client count group by state
# ┣┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈
# ┃ TTL ┆ 60
# ┃ Timeout ┆ 100ms
# ┣┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈
# ┃ LABEL state downstream state
# ┃ GAUGE count downstream count
# ┣┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈
# ┃ pg_downstream_count{state} GAUGE downstream count
# ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
pg_downstream:
name: pg_downstream
desc: openGauss replication client count group by state
query:
- name: pg_downstream
sql: |
SELECT l.state, coalesce(count, 0 ) AS count
FROM unnest(ARRAY ['Streaming','Startup','Catchup', 'Backup', 'Stopping']) l(state)
LEFT JOIN (SELECT state, count(*) AS count FROM pg_stat_replication GROUP BY state)r ON l.state = r.state
version: '>=0.0.0'
timeout: 0.1
ttl: 10
status: enable
dbRole: ""
metrics:
- name: state
description: downstream state
usage: LABEL
- name: count
description: downstream count
usage: GAUGE
status: enable
ttl: 60
timeout: 0.1
public: true
# ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
# ┃ pg_xact
# ┃ opengauss transaction identifier information
# ┣┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈
# ┃ TTL ┆ 5
# ┃ Timeout ┆ 1s
# ┣┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈
# ┃ GAUGE xmin earliest txid that is still active
# ┃ GAUGE xmax first as-yet-unassigned txid. txid >= this are invisible.
# ┃ GAUGE xnum current active transaction count
# ┣┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈
# ┃ pg_xact_xmin{} GAUGE earliest txid that is still active
# ┃ pg_xact_xmax{} GAUGE first as-yet-unassigned txid. txid >= this are invisible.
# ┃ pg_xact_xnum{} GAUGE current active transaction count
# ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
pg_xact:
name: pg_xact
desc: opengauss transaction identifier information
query:
- name: pg_xact
sql: |-
WITH snap(v) AS (SELECT txid_current_snapshot()),
xset(v) AS (SELECT txid_snapshot_xip(v) FROM snap),
xnum(v) AS (SELECT count(*) from xset),
xmin(v) AS (SELECT txid_snapshot_xmin(v) FROM snap),
xmax(v) AS (SELECT txid_snapshot_xmin(v) FROM snap)
SELECT xmin.v AS xmin, xmax.v AS xmax, xnum.v AS xnum FROM xmin, xmax, xnum;
version: '>=0.0.0'
timeout: 1
ttl: 5
status: enable
dbRole: ""
metrics:
- name: xmin
description: earliest txid that is still active
usage: GAUGE
- name: xmax
description: first as-yet-unassigned txid. txid >= this are invisible.
usage: GAUGE
- name: xnum
description: current active transaction count
usage: GAUGE
status: enable
ttl: 5
timeout: 1
public: true
# ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
# ┃ pg_stat_activity
# ┃ openGauss backend activity group by state
# ┣┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈
# ┃ TTL ┆ 60
# ┃ Timeout ┆ 1s
# ┣┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈
# ┃ LABEL datname Name of this database
# ┃ LABEL state connection state
# ┃ GAUGE count number of connections in this state
# ┃ GAUGE max_duration max duration since state change among (datname, state)
# ┃ GAUGE max_tx_duration max duration in seconds any active transaction has been running
# ┃ GAUGE max_conn_duration max backend session duration since state change among (datname, state)
# ┣┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈
# ┃ pg_stat_activity_count{datname,state} GAUGE number of connections in this state
# ┃ pg_stat_activity_max_duration{datname,state} GAUGE max duration since state change among (datname, state)
# ┃ pg_stat_activity_max_tx_duration{datname,state} GAUGE max duration in seconds any active transaction has been running
# ┃ pg_stat_activity_max_conn_duration{datname,state} GAUGE max backend session duration since state change among (datname, state)
# ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
pg_stat_activity:
name: pg_stat_activity
desc: openGauss backend activity group by state
query:
- name: pg_stat_activity
sql: |-
SELECT datname,
state,
coalesce(count, 0) AS count,
coalesce(max_duration, 0) AS max_duration,
coalesce(max_tx_duration, 0) AS max_tx_duration,
coalesce(max_conn_duration, 0) AS max_conn_duration
FROM (SELECT d.oid AS database, d.datname, a.state
FROM pg_database d,
unnest(ARRAY ['active','idle','idle in transaction','idle in transaction (aborted)','fastpath function call','disabled']) a(state)
WHERE d.datname NOT IN ('template0','template1')) base
LEFT JOIN (
SELECT datname, state,
count(*) AS count,
max(extract(epoch from now() - state_change)) AS max_duration,
max(extract(epoch from now() - xact_start)) AS max_tx_duration,
max(extract(epoch from now() - backend_start)) AS max_conn_duration
FROM pg_stat_activity WHERE pid <> pg_backend_pid()
GROUP BY datname, state
) a USING (datname, state);
version: '>=1.0.0'
timeout: 1
ttl: 60
status: enable
dbRole: ""
metrics:
- name: datname
description: Name of this database
usage: LABEL
- name: state
description: connection state
usage: LABEL
- name: count
description: number of connections in this state
usage: GAUGE
- name: max_duration
description: max duration since state change among (datname, state)
usage: GAUGE
- name: max_tx_duration
description: max duration in seconds any active transaction has been running
usage: GAUGE
- name: max_conn_duration
description: max backend session duration since state change among (datname, state)
usage: GAUGE
status: enable
ttl: 60
timeout: 1
public: true
# ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
# ┃ pg_replication_slots
# ┃
# ┣┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈
# ┃ TTL ┆ 60
# ┃ Timeout ┆ 1s
# ┣┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈
# ┃ LABEL slot_name Slot name
# ┃ LABEL plugin Logical plugin
# ┃ LABEL slot_type Slot type
# ┃ LABEL datoid Database oid
# ┃ LABEL database Database name
# ┃ LABEL active Is active
# ┃ LABEL xmin replication xid
# ┃ LABEL catalog_xmin logical decode xid
# ┃ LABEL restart_lsn Xlog info
# ┃ GAUGE delay_lsn delay lsn from pg_current_xlog_location()
# ┃ DISCARD dummy_standby Is real standby
# ┣┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈
# ┃ pg_replication_slots_delay_lsn{slot_name,plugin,slot_type,datoid,database,active,xmin,catalog_xmin,restart_lsn} GAUGE delay lsn from pg_current_xlog_location()
# ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
pg_replication_slots:
name: pg_replication_slots
query:
- name: pg_replication_slots
sql: |-
select slot_name,
database as datname,
coalesce(plugin,'_') as plugin,
slot_type,datoid,coalesce(database,'_') as database,
active,
coalesce(xmin,'_') as xmin,
coalesce(catalog_xmin,'_') as catalog_xmin,
restart_lsn,
pg_xlog_location_diff(pg_current_xlog_location(),restart_lsn) as delay_lsn,
dummy_standby,
pg_xlog_location_diff(restart_lsn ,'0/0'::text) AS restart_lsn,
pg_xlog_location_diff(CASE WHEN pg_is_in_recovery() THEN pg_last_xlog_receive_location()
ELSE pg_current_xlog_location() END , restart_lsn) AS retained_bytes
from pg_replication_slots;
version: '>=1.0.0'
timeout: 1
ttl: 60
status: enable
dbRole: ""
metrics:
- name: slot_name
description: Slot name
usage: LABEL
- name: plugin
description: Logical plugin
usage: LABEL
- name: slot_type
description: Slot type
usage: LABEL
- name: datoid
description: Database oid
usage: LABEL
- name: database
description: Database name
usage: LABEL
- name: active
description: Is active
usage: LABEL
- name: xmin
description: replication xid
usage: LABEL
- name: catalog_xmin
description: logical decode xid
usage: LABEL
- name: restart_lsn
description: Xlog info
usage: LABEL
- name: delay_lsn
description: delay lsn from pg_current_xlog_location()
usage: GAUGE
- name: dummy_standby
description: Is real standby
usage: DISCARD
status: enable
ttl: 60
timeout: 1
public: true
# ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
# ┃ pg_database
# ┃ openGauss Database size
# ┣┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈
# ┃ TTL ┆ 60
# ┃ Timeout ┆ 1s
# ┣┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈
# ┃ LABEL datname Name of this database
# ┃ GAUGE size_bytes Disk space used by the database
# ┃ GAUGE age database age calculated by age(datfrozenxid64)
# ┃ GAUGE is_template 1 for template db and 0 for normal db
# ┃ GAUGE allow_conn 1 allow connection and 0 does not allow
# ┃ GAUGE conn_limit connection limit, -1 for no limit
# ┃ GAUGE frozen_xid tuple with xmin below this will always be visable (until wrap around)
# ┣┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈
# ┃ pg_database_size_bytes{datname} GAUGE Disk space used by the database
# ┃ pg_database_age{datname} GAUGE database age calculated by age(datfrozenxid64)
# ┃ pg_database_is_template{datname} GAUGE 1 for template db and 0 for normal db
# ┃ pg_database_allow_conn{datname} GAUGE 1 allow connection and 0 does not allow
# ┃ pg_database_conn_limit{datname} GAUGE connection limit, -1 for no limit
# ┃ pg_database_frozen_xid{datname} GAUGE tuple with xmin below this will always be visable (until wrap around)
# ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
pg_database:
name: pg_database
desc: openGauss Database size
query:
- name: pg_database
sql: |-
SELECT datname,
pg_database_size(pg_database.datname) as size_bytes,
age(datfrozenxid64) AS age,
datistemplate AS is_template,
datallowconn AS allow_conn,
datconnlimit AS conn_limit,
datfrozenxid::TEXT::BIGINT as frozen_xid
FROM pg_database
where datname NOT IN ('template0','template1');
version: '>=0.0.0'
timeout: 1
ttl: 60
status: enable
dbRole: ""
metrics:
- name: datname
description: Name of this database
usage: LABEL
- name: size_bytes
description: Disk space used by the database
usage: GAUGE
- name: age
description: database age calculated by age(datfrozenxid64)
usage: GAUGE
- name: is_template
description: 1 for template db and 0 for normal db
usage: GAUGE
- name: allow_conn
description: 1 allow connection and 0 does not allow
usage: GAUGE
- name: conn_limit
description: connection limit, -1 for no limit
usage: GAUGE
- name: frozen_xid
description: tuple with xmin below this will always be visable (until wrap around)
usage: GAUGE
status: enable
ttl: 60
timeout: 1
public: true
pg_tables_size:
name: pg_tables_size
desc: OpenGauss tables size
query:
- name: pg_tables_size
sql: |-
SELECT CURRENT_CATALOG AS datname,nsp.nspname,rel.relname,
pg_total_relation_size(rel.oid) AS bytes,
pg_relation_size(rel.oid) AS relsize,
pg_indexes_size(rel.oid) AS indexsize,
pg_total_relation_size(reltoastrelid) AS toastsize
FROM pg_namespace nsp JOIN pg_class rel ON nsp.oid = rel.relnamespace
WHERE nspname NOT IN ('pg_catalog', 'information_schema','snapshot') AND rel.relkind = 'r'
order by 4 desc limit 100;
version: '>=0.0.0'
timeout: 10
ttl: 3600
dbRole: "primary"
status: enable
- name: pg_tables_size
sql: |-
SELECT CURRENT_CATALOG AS datname,nsp.nspname,rel.relname,
pg_total_relation_size(rel.oid) AS bytes,
pg_relation_size(rel.oid) AS relsize,
pg_indexes_size(rel.oid) AS indexsize,
pg_total_relation_size(reltoastrelid) AS toastsize
FROM pg_namespace nsp JOIN pg_class rel ON nsp.oid = rel.relnamespace
WHERE nspname NOT IN ('pg_catalog', 'information_schema','snapshot') AND rel.relkind = 'r'
order by 4 desc limit 100;
version: '>=0.0.0'
timeout: 10
ttl: 3600
dbRole: "standby"
status: disable
metrics:
- name: datname
description: database name of this relation
usage: LABEL
- name: nspname
description: schema name of this relation
usage: LABEL
- name: relname
description: relation name of this relation
usage: LABEL
- name: bytes
description: total size of this table (including toast, index, toast index)
usage: GAUGE
- name: relsize
description: size of this table itself (main, vm, fsm)
usage: GAUGE
- name: indexsize
description: size of all related indexes
usage: GAUGE
- name: toastsize
description: size of corresponding toast tables
usage: GAUGE
status: enable
ttl: 3600
timeout: 10
pg_indexes_size:
name: pg_indexes_size
desc: OpenGauss database indexes size
query:
- name: pg_indexes_size
sql: |-
select CURRENT_CATALOG AS datname,schemaname schema_name,relname table_name,indexrelname index_name,pg_table_size(indexrelid) as index_size
from pg_stat_user_indexes
where schemaname not in('pg_catalog', 'information_schema','snapshot')
order by 4 desc limit 100;
version: '>=0.0.0'
timeout: 10
ttl: 3600
dbRole: "primary"
status: enable
- name: pg_indexes_size
sql: |-
select CURRENT_CATALOG AS datname,schemaname schema_name,relname table_name,indexrelname index_name,pg_table_size(indexrelid) as index_size
from pg_stat_user_indexes
where schemaname not in('pg_catalog', 'information_schema','snapshot')
order by 4 desc limit 100;
version: '>=0.0.0'
timeout: 10
ttl: 3600
dbRole: "standby"
status: disable
metrics:
- name: datname
description: database name of this index
usage: LABEL
- name: schema_name
description: Schema name of index
usage: LABEL
- name: table_name
description: Table name of index
usage: LABEL
- name: index_name
description: Name of index
usage: LABEL
- name: index_size
description: Size of index
usage: GAUGE
status: enable
ttl: 3600
timeout: 10
# ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
# ┃ pg_checkpoint
# ┃ checkpoint information from pg_control_checkpoint since 10
# ┣┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈
# ┃ TTL ┆ 5
# ┃ Timeout ┆ 1s
# ┣┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈
# ┃ COUNTER checkpoint_lsn lsn of checkpoint
# ┃ COUNTER redo_lsn redo start LSN
# ┃ GAUGE tli current WAL timeline
# ┃ GAUGE prev_tli previous WAL timeline
# ┃ GAUGE full_page_writes is full page write enabled ?
# ┃ GAUGE next_xid_epoch next xid epoch since this checkpoint
# ┃ GAUGE next_xid next xid since this checkpoint
# ┃ GAUGE next_oid next object id since this checkpoint
# ┃ GAUGE next_multixact_id next multixact id of this checkpoint
# ┃ GAUGE next_multi_offset next multixact id offset of this checkpoint
# ┃ GAUGE oldest_xid oldest existing xid of the checkpoint
# ┃ GAUGE oldest_xid_dbid which db contains the oldest xid
# ┃ GAUGE oldest_active_xid oldest active xid of the checkpoint
# ┃ GAUGE oldest_multi_xid oldest active multi xid of the checkpoint
# ┃ GAUGE oldest_multi_dbid which db contins the oldest multi xid
# ┃ GAUGE oldest_commit_ts_xid xid with oldest commit ts by the checkpoint
# ┃ GAUGE newest_commit_ts_xid xid with newest commit ts by the checkpoint
# ┃ GAUGE time timestamp of this checkpoint
# ┃ GAUGE elapse time elapsed since this checkpoint in seconds
# ┣┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈
# ┃ pg_checkpoint_checkpoint_lsn{} COUNTER lsn of checkpoint
# ┃ pg_checkpoint_redo_lsn{} COUNTER redo start LSN
# ┃ pg_checkpoint_tli{} GAUGE current WAL timeline
# ┃ pg_checkpoint_prev_tli{} GAUGE previous WAL timeline
# ┃ pg_checkpoint_full_page_writes{} GAUGE is full page write enabled ?
# ┃ pg_checkpoint_next_xid_epoch{} GAUGE next xid epoch since this checkpoint
# ┃ pg_checkpoint_next_xid{} GAUGE next xid since this checkpoint
# ┃ pg_checkpoint_next_oid{} GAUGE next object id since this checkpoint
# ┃ pg_checkpoint_next_multixact_id{} GAUGE next multixact id of this checkpoint
# ┃ pg_checkpoint_next_multi_offset{} GAUGE next multixact id offset of this checkpoint
# ┃ pg_checkpoint_oldest_xid{} GAUGE oldest existing xid of the checkpoint
# ┃ pg_checkpoint_oldest_xid_dbid{} GAUGE which db contains the oldest xid
# ┃ pg_checkpoint_oldest_active_xid{} GAUGE oldest active xid of the checkpoint
# ┃ pg_checkpoint_oldest_multi_xid{} GAUGE oldest active multi xid of the checkpoint
# ┃ pg_checkpoint_oldest_multi_dbid{} GAUGE which db contins the oldest multi xid
# ┃ pg_checkpoint_oldest_commit_ts_xid{} GAUGE xid with oldest commit ts by the checkpoint
# ┃ pg_checkpoint_newest_commit_ts_xid{} GAUGE xid with newest commit ts by the checkpoint
# ┃ pg_checkpoint_time{} GAUGE timestamp of this checkpoint
# ┃ pg_checkpoint_elapse{} GAUGE time elapsed since this checkpoint in seconds
# ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
pg_checkpoint:
name: pg_checkpoint
desc: checkpoint information from pg_control_checkpoint since 10
query:
- name: pg_checkpoint
sql: |-
SELECT timeline_id AS tli,
full_page_writes,
next_oid::BIGINT,
next_multixact_id::text::BIGINT,
next_multi_offset::text::BIGINT,
oldest_xid::text::BIGINT,
oldest_xid_dbid::text::BIGINT,
oldest_active_xid::text::BIGINT,
checkpoint_time AS time,
extract(epoch from now() - checkpoint_time) AS elapse
FROM pg_control_checkpoint();
version: '>=0.0.0'
timeout: 1
ttl: 5
status: enable
dbRole: ""
metrics:
- name: checkpoint_lsn
description: lsn of checkpoint
usage: COUNTER
- name: redo_lsn
description: redo start LSN
usage: COUNTER
- name: tli
description: current WAL timeline
usage: GAUGE
- name: prev_tli
description: previous WAL timeline
usage: GAUGE
- name: full_page_writes
description: is full page write enabled ?
usage: GAUGE
- name: next_xid_epoch
description: next xid epoch since this checkpoint
usage: GAUGE
- name: next_xid
description: next xid since this checkpoint
usage: GAUGE
- name: next_oid
description: next object id since this checkpoint
usage: GAUGE
- name: next_multixact_id
description: next multixact id of this checkpoint
usage: GAUGE
- name: next_multi_offset
description: next multixact id offset of this checkpoint
usage: GAUGE
- name: oldest_xid
description: oldest existing xid of the checkpoint
usage: GAUGE
- name: oldest_xid_dbid
description: which db contains the oldest xid
usage: GAUGE
- name: oldest_active_xid
description: oldest active xid of the checkpoint
usage: GAUGE
- name: oldest_multi_xid
description: oldest active multi xid of the checkpoint
usage: GAUGE
- name: oldest_multi_dbid
description: which db contins the oldest multi xid
usage: GAUGE
- name: oldest_commit_ts_xid
description: xid with oldest commit ts by the checkpoint
usage: GAUGE
- name: newest_commit_ts_xid
description: xid with newest commit ts by the checkpoint
usage: GAUGE
- name: time
description: timestamp of this checkpoint
usage: GAUGE
- name: elapse
description: time elapsed since this checkpoint in seconds
usage: GAUGE
status: enable
ttl: 5
timeout: 1
public: true
# ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
# ┃ pg_stat_database_conflicts
# ┃ openGauss database statistics conflicts
# ┣┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈
# ┃ TTL ┆ 60
# ┃ Timeout ┆ 1s
# ┣┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈
# ┃ LABEL datid OID of a database
# ┃ LABEL datname Name of this database
# ┃ COUNTER confl_tablespace Number of queries in this database that have been canceled due to dropped tablespaces
# ┃ COUNTER confl_lock Number of queries in this database that have been canceled due to lock timeouts
# ┃ COUNTER confl_snapshot Number of queries in this database that have been canceled due to old snapshots
# ┃ COUNTER confl_bufferpin Number of queries in this database that have been canceled due to pinned buffers
# ┃ COUNTER confl_deadlock Number of queries in this database that have been canceled due to deadlocks
# ┣┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈
# ┃ pg_stat_database_conflicts_confl_tablespace{datid,datname} COUNTER Number of queries in this database that have been canceled due to dropped tablespaces
# ┃ pg_stat_database_conflicts_confl_lock{datid,datname} COUNTER Number of queries in this database that have been canceled due to lock timeouts
# ┃ pg_stat_database_conflicts_confl_snapshot{datid,datname} COUNTER Number of queries in this database that have been canceled due to old snapshots
# ┃ pg_stat_database_conflicts_confl_bufferpin{datid,datname} COUNTER Number of queries in this database that have been canceled due to pinned buffers
# ┃ pg_stat_database_conflicts_confl_deadlock{datid,datname} COUNTER Number of queries in this database that have been canceled due to deadlocks
# ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
pg_stat_database_conflicts:
name: pg_stat_database_conflicts
desc: openGauss database statistics conflicts
query:
- name: pg_stat_database_conflicts
sql: select * from pg_stat_database_conflicts where datname NOT IN ('template0','template1');
version: '>=0.0.0'
timeout: 1
ttl: 60
status: enable
dbRole: ""
metrics:
- name: datid
description: OID of a database
usage: LABEL
- name: datname
description: Name of this database
usage: LABEL
- name: confl_tablespace
description: Number of queries in this database that have been canceled due to dropped tablespaces
usage: COUNTER
- name: confl_lock
description: Number of queries in this database that have been canceled due to lock timeouts
usage: COUNTER
- name: confl_snapshot
description: Number of queries in this database that have been canceled due to old snapshots
usage: COUNTER
- name: confl_bufferpin
description: Number of queries in this database that have been canceled due to pinned buffers
usage: COUNTER
- name: confl_deadlock
description: Number of queries in this database that have been canceled due to deadlocks
usage: COUNTER
status: enable
ttl: 60
timeout: 1
public: true
# ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
# ┃ pg_stat_replication
# ┃
# ┣┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈
# ┃ TTL ┆ 60
# ┃ Timeout ┆ 1s
# ┣┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈
# ┃ LABEL pid unique walsender pid
# ┃ LABEL client_addr client address of wal receiver
# ┃ LABEL application_name application name of standby
# ┃ LABEL state replication state startup|catchup|streaming|backup|stopping
# ┃ LABEL sync_state replication sync state async|potential|sync|quorum
# ┃ COUNTER lsn current log position on this server
# ┃ GAUGE sent_diff last log position sent to this standby server diff with current lsn
# ┃ GAUGE write_diff last log position written to disk by this standby server diff with current lsn
# ┃ GAUGE flush_diff last log position flushed to disk by this standby server diff with current lsn
# ┃ GAUGE replay_diff last log position replayed into the database on this standby server diff with current lsn
# ┃ COUNTER sent_lsn last log position sent to this standby server
# ┃ COUNTER write_lsn last log position written to disk by this standby server
# ┃ COUNTER flush_lsn last log position flushed to disk by this standby server
# ┃ COUNTER replay_lsn last log position replayed into the database on this standby server
# ┃ GAUGE write_lag latest ACK lsn diff with write (sync-remote-write lag)
# ┃ GAUGE flush_lag latest ACK lsn diff with flush (sync-remote-flush lag)
# ┃ GAUGE replay_lag latest ACK lsn diff with replay (sync-remote-apply lag)
# ┃ GAUGE backend_uptime how long since standby connect to this server
# ┃ GAUGE backend_xmin this standby's xmin horizon reported by hot_standby_feedback.
# ┃ GAUGE sync_priority priority of being chosen as synchronous standby
# ┣┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈
# ┃ pg_stat_replication_lsn{pid,client_addr,application_name,state,sync_state} COUNTER current log position on this server
# ┃ pg_stat_replication_sent_diff{pid,client_addr,application_name,state,sync_state} GAUGE last log position sent to this standby server diff with current lsn
# ┃ pg_stat_replication_write_diff{pid,client_addr,application_name,state,sync_state} GAUGE last log position written to disk by this standby server diff with current lsn
# ┃ pg_stat_replication_flush_diff{pid,client_addr,application_name,state,sync_state} GAUGE last log position flushed to disk by this standby server diff with current lsn
# ┃ pg_stat_replication_replay_diff{pid,client_addr,application_name,state,sync_state} GAUGE last log position replayed into the database on this standby server diff with current lsn
# ┃ pg_stat_replication_sent_lsn{pid,client_addr,application_name,state,sync_state} COUNTER last log position sent to this standby server
# ┃ pg_stat_replication_write_lsn{pid,client_addr,application_name,state,sync_state} COUNTER last log position written to disk by this standby server
# ┃ pg_stat_replication_flush_lsn{pid,client_addr,application_name,state,sync_state} COUNTER last log position flushed to disk by this standby server
# ┃ pg_stat_replication_replay_lsn{pid,client_addr,application_name,state,sync_state} COUNTER last log position replayed into the database on this standby server
# ┃ pg_stat_replication_write_lag{pid,client_addr,application_name,state,sync_state} GAUGE latest ACK lsn diff with write (sync-remote-write lag)
# ┃ pg_stat_replication_flush_lag{pid,client_addr,application_name,state,sync_state} GAUGE latest ACK lsn diff with flush (sync-remote-flush lag)
# ┃ pg_stat_replication_replay_lag{pid,client_addr,application_name,state,sync_state} GAUGE latest ACK lsn diff with replay (sync-remote-apply lag)
# ┃ pg_stat_replication_backend_uptime{pid,client_addr,application_name,state,sync_state} GAUGE how long since standby connect to this server
# ┃ pg_stat_replication_backend_xmin{pid,client_addr,application_name,state,sync_state} GAUGE this standby's xmin horizon reported by hot_standby_feedback.
# ┃ pg_stat_replication_sync_priority{pid,client_addr,application_name,state,sync_state} GAUGE priority of being chosen as synchronous standby
# ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
pg_stat_replication:
name: pg_stat_replication
query:
- name: pg_stat_replication
sql: |-
select
pid,
client_addr,
application_name,
state,
sync_state,
lsn,
lsn - sent_lsn as sent_diff,
lsn - write_lsn as write_diff,
lsn - flush_lsn as flush_diff,
lsn - replay_lsn as replay_diff,
sent_lsn,
write_lsn,
flush_lsn,
replay_lsn,
backend_uptime,
sync_priority
from
(
select
pr.pid,
client_addr,
application_name,
pr.state,
pr.sync_state,
pg_xlog_location_diff (case when pg_is_in_recovery() then pg_last_xlog_receive_location() else pg_current_xlog_location() end, '0/0') as lsn,
pg_xlog_location_diff(pr.sender_sent_location,'0/0') as sent_lsn,
pg_xlog_location_diff(pr.receiver_write_location,'0/0') as write_lsn,
pg_xlog_location_diff(pr.receiver_flush_location,'0/0') as flush_lsn,
pg_xlog_location_diff(pr.receiver_replay_location,'0/0') as replay_lsn,
pg_xlog_location_diff(pr.receiver_replay_location, pg_current_xlog_location()) as replay_lag,
extract(EPOCH from now() - backend_start) as backend_uptime,
pr.sync_priority
from
pg_stat_replication pr
);
version: '>=1.0.0'
timeout: 1
ttl: 60
status: enable
dbRole: ""
metrics:
- name: pid
description: unique walsender pid
usage: LABEL
- name: client_addr
description: client address of wal receiver
usage: LABEL
- name: application_name
description: application name of standby
usage: LABEL
- name: state
description: replication state startup|catchup|streaming|backup|stopping
usage: LABEL
- name: sync_state
description: replication sync state async|potential|sync|quorum
usage: LABEL
- name: lsn
description: current log position on this server
usage: COUNTER
- name: sent_diff
description: last log position sent to this standby server diff with current lsn
usage: GAUGE
- name: write_diff
description: last log position written to disk by this standby server diff with current lsn
usage: GAUGE
- name: flush_diff
description: last log position flushed to disk by this standby server diff with current lsn
usage: GAUGE
- name: replay_diff
description: last log position replayed into the database on this standby server diff with current lsn
usage: GAUGE
- name: sent_lsn
description: last log position sent to this standby server
usage: COUNTER
- name: write_lsn
description: last log position written to disk by this standby server
usage: COUNTER
- name: flush_lsn
description: last log position flushed to disk by this standby server
usage: COUNTER
- name: replay_lsn
description: last log position replayed into the database on this standby server
usage: COUNTER
- name: write_lag
description: latest ACK lsn diff with write (sync-remote-write lag)
usage: GAUGE
- name: flush_lag
description: latest ACK lsn diff with flush (sync-remote-flush lag)
usage: GAUGE
- name: replay_lag
description: latest ACK lsn diff with replay (sync-remote-apply lag)
usage: GAUGE
- name: backend_uptime
description: how long since standby connect to this server
usage: GAUGE
- name: backend_xmin
description: this standby's xmin horizon reported by hot_standby_feedback.
usage: GAUGE
- name: sync_priority
description: priority of being chosen as synchronous standby
usage: GAUGE
status: enable
ttl: 60
timeout: 1
public: true
# ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
# ┃ pg_stat_bgwriter
# ┃ openGauss background writer metrics
# ┣┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈
# ┃ TTL ┆ -1
# ┃ Timeout ┆ 1s
# ┣┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈
# ┃ COUNTER checkpoints_timed scheduled checkpoints that have been performed
# ┃ COUNTER checkpoints_req requested checkpoints that have been performed
# ┃ COUNTER checkpoint_write_time time spending on writing files to disk, in µs
# ┃ COUNTER checkpoint_sync_time time spending on syncing files to disk, in µs
# ┃ COUNTER buffers_checkpoint buffers written during checkpoints
# ┃ COUNTER buffers_clean buffers written by the background writer
# ┃ COUNTER buffers_backend buffers written directly by a backend
# ┃ COUNTER maxwritten_clean times that bgwriter stopped a cleaning scan
# ┃ COUNTER buffers_backend_fsync times a backend had to execute its own fsync
# ┃ COUNTER buffers_alloc buffers allocated
# ┃ COUNTER stats_reset time when statistics were last reset
# ┣┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈
# ┃ pg_stat_bgwriter_checkpoints_timed{} COUNTER scheduled checkpoints that have been performed
# ┃ pg_stat_bgwriter_checkpoints_req{} COUNTER requested checkpoints that have been performed
# ┃ pg_stat_bgwriter_checkpoint_write_time{} COUNTER time spending on writing files to disk, in µs
# ┃ pg_stat_bgwriter_checkpoint_sync_time{} COUNTER time spending on syncing files to disk, in µs
# ┃ pg_stat_bgwriter_buffers_checkpoint{} COUNTER buffers written during checkpoints
# ┃ pg_stat_bgwriter_buffers_clean{} COUNTER buffers written by the background writer
# ┃ pg_stat_bgwriter_buffers_backend{} COUNTER buffers written directly by a backend
# ┃ pg_stat_bgwriter_maxwritten_clean{} COUNTER times that bgwriter stopped a cleaning scan
# ┃ pg_stat_bgwriter_buffers_backend_fsync{} COUNTER times a backend had to execute its own fsync
# ┃ pg_stat_bgwriter_buffers_alloc{} COUNTER buffers allocated
# ┃ pg_stat_bgwriter_stats_reset{} COUNTER time when statistics were last reset
# ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
pg_stat_bgwriter:
name: pg_stat_bgwriter
desc: openGauss background writer metrics
query:
- name: pg_stat_bgwriter
sql: |-
SELECT checkpoints_timed,
checkpoints_req,
checkpoint_write_time,
checkpoint_sync_time,
buffers_checkpoint,
buffers_clean,
buffers_backend,
maxwritten_clean,
buffers_backend_fsync,
buffers_alloc,
stats_reset
FROM pg_stat_bgwriter
version: '>=0.0.0'
timeout: 1
ttl: -1
status: enable
dbRole: ""
metrics:
- name: checkpoints_timed
description: scheduled checkpoints that have been performed
usage: COUNTER
- name: checkpoints_req
description: requested checkpoints that have been performed
usage: COUNTER
- name: checkpoint_write_time
description: time spending on writing files to disk, in µs
usage: COUNTER
- name: checkpoint_sync_time
description: time spending on syncing files to disk, in µs
usage: COUNTER
- name: buffers_checkpoint
description: buffers written during checkpoints
usage: COUNTER
- name: buffers_clean
description: buffers written by the background writer
usage: COUNTER
- name: buffers_backend
description: buffers written directly by a backend
usage: COUNTER
- name: maxwritten_clean
description: times that bgwriter stopped a cleaning scan
usage: COUNTER
- name: buffers_backend_fsync
description: times a backend had to execute its own fsync
usage: COUNTER
- name: buffers_alloc
description: buffers allocated
usage: COUNTER
- name: stats_reset
description: time when statistics were last reset
usage: COUNTER
status: enable
ttl: -1
timeout: 1
public: true
# ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
# ┃ pg_run_times
# ┃ openGauss database run times
# ┣┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈
# ┃ TTL ┆ 60
# ┃ Timeout ┆ 1s
# ┣┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈
# ┃ LABEL run_name Name of cluster
# ┃ GAUGE db_role Role of database
# ┃ GAUGE run_time Run times of cluster
# ┣┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈
# ┃ pg_run_times_db_role{run_name} GAUGE Role of database
# ┃ pg_run_times_run_time{run_name} GAUGE Run times of cluster
# ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
pg_run_times:
name: pg_run_times
desc: openGauss database run times
query:
- name: pg_run_times
sql: select 'cluster_runtime' as run_name,(case pg_is_in_recovery() when 'f' then 1 else 0 end) as db_role,extract(epoch from(now() - pg_postmaster_start_time())) as run_time;
version: '>=0.0.0'
timeout: 1
ttl: 60
status: enable
dbRole: ""
metrics:
- name: run_name
description: Name of cluster
usage: LABEL
- name: db_role
description: Role of database
usage: GAUGE
- name: run_time
description: Run times of cluster
usage: GAUGE
status: enable
ttl: 60
timeout: 1
public: true
# ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
# ┃ pg
# ┃ openGauss basic information
# ┣┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈
# ┃ TTL ┆ 60
# ┃ Timeout ┆ 100ms
# ┣┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈
# ┃ GAUGE timestamp current database timestamp in unix epoch
# ┃ GAUGE uptime seconds since postmaster start
# ┃ GAUGE boot_time postmaster boot timestamp in unix epoch
# ┃ COUNTER lsn log sequence number, current write location
# ┃ COUNTER insert_lsn primary only, location of current wal inserting
# ┃ COUNTER write_lsn primary only, location of current wal writing
# ┃ COUNTER flush_lsn primary only, location of current wal syncing
# ┃ COUNTER receive_lsn replica only, location of wal synced to disk
# ┃ COUNTER replay_lsn replica only, location of wal applied
# ┃ GAUGE conf_reload_time seconds since last configuration reload
# ┃ GAUGE last_replay_time time when last transaction been replayed
# ┃ GAUGE lag replica only, replication lag in seconds
# ┃ GAUGE is_in_recovery 1 if in recovery mode
# ┃ GAUGE is_wal_replay_paused 1 if wal play is paused
# ┣┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈
# ┃ pg_timestamp{} GAUGE current database timestamp in unix epoch
# ┃ pg_uptime{} GAUGE seconds since postmaster start
# ┃ pg_boot_time{} GAUGE postmaster boot timestamp in unix epoch
# ┃ pg_lsn{} COUNTER log sequence number, current write location
# ┃ pg_insert_lsn{} COUNTER primary only, location of current wal inserting
# ┃ pg_write_lsn{} COUNTER primary only, location of current wal writing
# ┃ pg_flush_lsn{} COUNTER primary only, location of current wal syncing
# ┃ pg_receive_lsn{} COUNTER replica only, location of wal synced to disk
# ┃ pg_replay_lsn{} COUNTER replica only, location of wal applied
# ┃ pg_conf_reload_time{} GAUGE seconds since last configuration reload
# ┃ pg_last_replay_time{} GAUGE time when last transaction been replayed
# ┃ pg_lag{} GAUGE replica only, replication lag in seconds
# ┃ pg_is_in_recovery{} GAUGE 1 if in recovery mode
# ┃ pg_is_wal_replay_paused{} GAUGE 1 if wal play is paused
# ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
pg:
name: pg
desc: openGauss basic information
query:
- name: pg
desc: 'primary database '
sql: |
SELECT extract(EPOCH FROM CURRENT_TIMESTAMP) AS timestamp,
extract(EPOCH FROM now() - pg_postmaster_start_time()) AS uptime,
extract(EPOCH FROM pg_postmaster_start_time()) AS boot_time,
pg_xlog_location_diff(pg_current_xlog_location() , '0/0') AS lsn,
pg_xlog_location_diff(pg_current_xlog_insert_location(),'0/0') AS insert_lsn,
pg_xlog_location_diff(pg_current_xlog_location() , '0/0') AS write_lsn,
pg_xlog_location_diff(pg_current_xlog_location() , '0/0') AS flush_lsn,
NULL::BIGINT AS receive_lsn,
NULL::BIGINT AS replay_lsn,
extract(EPOCH FROM now() - pg_conf_load_time()) AS conf_reload_time,
NULL::FLOAT AS last_replay_time,
0::FLOAT AS lag,
pg_is_in_recovery() AS is_in_recovery,
FALSE AS is_wal_replay_paused
-- ,
--pg_is_in_backup() AS is_in_backup,
--extract(EPOCH FROM now() - pg_backup_start_time()) AS backup_time
;
version: '>=0.0.0'
timeout: 0.1
ttl: 10
status: enable
dbRole: primary
- name: pg
desc: 'standby database '
sql: |
SELECT extract(EPOCH FROM CURRENT_TIMESTAMP) AS timestamp,
extract(EPOCH FROM now() - pg_postmaster_start_time()) AS uptime,
extract(EPOCH FROM pg_postmaster_start_time()) AS boot_time,
pg_xlog_location_diff(pg_last_xlog_receive_location() , '0/0') AS lsn,
NULL::BIGINT AS insert_lsn,
NULL::BIGINT AS write_lsn,
NULL::BIGINT AS flush_lsn,
pg_xlog_location_diff(pg_last_xlog_receive_location() , '0/0') AS receive_lsn,
pg_xlog_location_diff(pg_last_xlog_receive_location() , '0/0') AS replay_lsn,
extract(EPOCH FROM now() - pg_conf_load_time()) AS conf_reload_time,
extract(EPOCH FROM pg_last_xact_replay_timestamp()) AS last_replay_time,
--CASE
-- WHEN pg_last_xlog_receive_location() = pg_last_xlog_replay_location() THEN 0
-- ELSE EXTRACT(EPOCH FROM now() - pg_last_xact_replay_timestamp()) END AS lag,
pg_is_in_recovery() AS is_in_recovery
--pg_is_wal_replay_paused() AS is_wal_replay_paused
--,
--pg_is_in_backup() AS is_in_backup,
--extract(EPOCH FROM now() - pg_backup_start_time()) AS backup_time
;
version: '>=0.0.0'
timeout: 0.1
ttl: 10
status: enable
dbRole: standby
metrics:
- name: timestamp
description: current database timestamp in unix epoch
usage: GAUGE
- name: uptime
description: seconds since postmaster start
usage: GAUGE
- name: boot_time
description: postmaster boot timestamp in unix epoch
usage: GAUGE
- name: lsn
description: log sequence number, current write location
usage: COUNTER
- name: insert_lsn
description: primary only, location of current wal inserting
usage: COUNTER
- name: write_lsn
description: primary only, location of current wal writing
usage: COUNTER
- name: flush_lsn
description: primary only, location of current wal syncing
usage: COUNTER
- name: receive_lsn
description: replica only, location of wal synced to disk
usage: COUNTER
- name: replay_lsn
description: replica only, location of wal applied
usage: COUNTER
- name: conf_reload_time
description: seconds since last configuration reload
usage: GAUGE
- name: last_replay_time
description: time when last transaction been replayed
usage: GAUGE
- name: lag
description: replica only, replication lag in seconds
usage: GAUGE
- name: is_in_recovery
description: 1 if in recovery mode
usage: GAUGE
- name: is_wal_replay_paused
description: 1 if wal play is paused
usage: GAUGE
status: enable
ttl: 60
timeout: 0.1
public: true
# ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
# ┃ pg_sync_standby
# ┃ openGauss synchronous standby status and names
# ┣┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈
# ┃ TTL ┆ 60
# ┃ Timeout ┆ 100ms
# ┣┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈
# ┃ LABEL names a list of standby servers that can support synchronous replication, empty if not enabled
# ┃ GAUGE disabled 1 if disabled, 0 if enabled
# ┃ GAUGE enabled 1 if enabled, 0 if disabled
# ┣┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈
# ┃ pg_sync_standby_disabled{names} GAUGE 1 if disabled, 0 if enabled
# ┃ pg_sync_standby_enabled{names} GAUGE 1 if enabled, 0 if disabled
# ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
pg_sync_standby:
name: pg_sync_standby
desc: openGauss synchronous standby status and names
query:
- name: pg_sync_standby
sql: |
SELECT CASE names WHEN NULL THEN '""' WHEN '' THEN 'null' ELSE names END AS names,
CASE names WHEN NULL THEN 1 WHEN '' THEN 1 ELSE 0 END AS disabled,
CASE names WHEN NULL THEN 0 WHEN '' THEN 0 ELSE 1 END AS enabled
FROM (SELECT current_setting('synchronous_standby_names') AS names) t;
version: '>=0.0.0'
timeout: 0.1
ttl: 10
status: enable
dbRole: ""
metrics:
- name: names
description: a list of standby servers that can support synchronous replication, empty if not enabled
usage: LABEL
- name: disabled
description: 1 if disabled, 0 if enabled
usage: GAUGE
- name: enabled
description: 1 if enabled, 0 if disabled
usage: GAUGE
status: enable
ttl: 60
timeout: 0.1
public: true
# ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
# ┃ pg_lock
# ┃ openGauss lock distribution by mode
# ┣┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈
# ┃ TTL ┆ 60
# ┃ Timeout ┆ 1s
# ┣┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈
# ┃ LABEL datname Name of this database
# ┃ LABEL mode Type of Lock
# ┃ GAUGE count Number of locks
# ┣┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈
# ┃ pg_lock_count{datname,mode} GAUGE Number of locks
# ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
pg_lock:
name: pg_lock
desc: openGauss lock distribution by mode
query:
- name: pg_lock
sql: |-
SELECT datname, mode, coalesce(count, 0) AS count
FROM (
SELECT d.oid AS database, d.datname, l.mode
FROM pg_database d,unnest(ARRAY ['AccessShareLock','RowShareLock','RowExclusiveLock','ShareUpdateExclusiveLock','ShareLock','ShareRowExclusiveLock','ExclusiveLock','AccessExclusiveLock']) l(mode)
WHERE d.datname NOT IN ('template0','template1')) base
LEFT JOIN (SELECT database, mode, count(1) AS count
FROM pg_locks
WHERE database IS NOT NULL GROUP BY database, mode) cnt
USING (database, mode);
version: '>=0.0.0'
timeout: 1
ttl: 60
status: enable
dbRole: ""
metrics:
- name: datname
description: Name of this database
usage: LABEL
- name: mode
description: Type of Lock
usage: LABEL
- name: count
description: Number of locks
usage: GAUGE
status: enable
ttl: 60
timeout: 1
public: true
pg_lock_detail:
name: pg_lock_detail
desc: OpenGauss lock sqls
query:
- name: pg_lock_detail
sql: |-
with tl as (select usename,a.pid,granted,locktag,query_start,query
from pg_locks l,pg_stat_activity a
where l.pid=a.pid and locktag in(select locktag from pg_locks where granted='f'))
select ts.usename locker_user,ts.pid locker_user_pid,ts.query_start locker_query_start,ts.granted locker_granted,ts.query locker_query,tt.query locked_query,tt.query_start locked_query_start,tt.granted locked_granted,tt.usename locked_user,tt.pid locked_user_pid,extract(epoch from now() - tt.query_start) as locked_times
from (select * from tl where granted='t') as ts,(select * from tl where granted='f') tt
where ts.locktag=tt.locktag order by 2;
version: '>=0.0.0'
timeout: 1
ttl: 60
status: enable
dbRole: ""
metrics:
- name: locker_user
description: locker user
usage: LABEL
- name: locker_user_pid
description: locker user pid
usage: LABEL
- name: locked_user
description: locked user
usage: LABEL
- name: locked_user_pid
description: locked user pid
usage: LABEL
- name: locker_granted
description: locker granted
usage: LABEL
- name: locked_granted
description: locked granted
usage: LABEL
- name: locker_query_start
description: locker query start
usage: LABEL
- name: locked_query_start
description: locked query start
usage: LABEL
- name: locked_times
description: Total wait times
usage: GAUGE
- name: locker_query
description: locker query
usage: LABEL
- name: locked_query
description: locked query
usage: LABEL
status: enable
ttl: 60
timeout: 1
public: true
pg_locker:
name: pg_locker
desc: OpenGauss locker count
query:
- name: pg_locker
sql: |-
with tl as (select usename,granted,locktag,query_start,query
from pg_locks l,pg_stat_activity a
where l.pid=a.pid and query_start is not null and locktag in(select locktag from pg_locks where granted='f'))
select usename,query_start,granted,query,count(query) count
from tl where granted='t' group by usename,query_start,granted,query order by 5 desc;
version: '>=0.0.0'
timeout: 1
ttl: 60
status: enable
dbRole: ""
metrics:
- name: usename
description: locker user name
usage: LABEL
- name: granted
description: locker granted
usage: LABEL
- name: query_start
description: locker query start
usage: LABEL
- name: count
description: locker user count
usage: GAUGE
- name: query
description: locker query
usage: LABEL
status: enable
ttl: 60
timeout: 1
public: true
pg_sql_history:
name: pg_sql_history
desc: openGauss history query statement
query:
- name: pg_sql_history
sql: select unique_sql_id,n_calls,cpu_time,min_elapse_time,max_elapse_time,total_elapse_time,query from dbe_perf.statement order by total_elapse_time desc limit 10;
version: '>=0.0.0'
timeout: 1
status: enable
metrics:
- name: unique_sql_id
description: Name of database
usage: LABEL
- name: n_calls
description: Name of user
usage: GAUGE
- name: cpu_time
description: Client address
usage: GAUGE
- name: min_elapse_time
description: Query start time
usage: LABEL
- name: max_elapse_time
description: Query running time
usage: GAUGE
- name: total_elapse_time
description: Start time of transaction
usage: GAUGE
- name: query
description: transaction running time
usage: LABEL
status: enable
ttl: -1
timeout: 1
public: true
pg_active_slowsql:
name: pg_active_slowsql
desc: openGauss active slow query
query:
- name: pg_active_slowsql
sql: select datname,usename,client_addr,pid,query_start::text,extract(epoch from (now() - query_start)) as query_runtime,xact_start::text,extract(epoch from(now() - xact_start)) as xact_runtime,state,query from pg_stat_activity where state not in('idle') and query_start is not null;
version: '>=0.0.0'
timeout: 1
status: enable
metrics:
- name: datname
description: Name of database
usage: LABEL
- name: usename
description: Name of user
usage: LABEL
- name: client_addr
description: Client address
usage: LABEL
- name: pid
description: Client address
usage: LABEL
- name: query_start
description: Query start time
usage: LABEL
- name: query_runtime
description: Query running time
usage: GAUGE
- name: xact_start
description: Start time of transaction
usage: LABEL
- name: xact_runtime
description: transaction running time
usage: LABEL
- name: state
description: Query state
usage: LABEL
- name: query
description: Query sql
usage: LABEL
status: enable
ttl: -1
timeout: 1
public: true
gauss_query_statement:
name: gauss_query_statement
desc: openGauss Buffer metrics
query:
- name: gauss_query_statement
sql: select sum(n_blocks_hit)/sum(n_blocks_fetched) as cache_hit_rate from dbe_perf.statement;
version: '>=0.0.0'
timeout: 1
ttl: 60
status: enable
metrics:
- name: cache_hit_rate
description: Buffer block access count
usage: GAUGE
status: enable
ttl: 60
timeout: 1
public: true
gauss_stat_activity:
name: gauss_stat_activity
desc: openGauss User connection metrics
query:
- name: gauss_stat_activity
sql: select (select count(*) from pg_stat_activity) as total_count, count(*) as idle_status_counts from pg_stat_activity where state like '%idle%';
version: '>=0.0.0'
timeout: 1
ttl: 60
status: enable
metrics:
- name: idle_status_counts
description: Idle status connection counts
usage: GAUGE
- name: total_count
description: Connection total counts
usage: GAUGE
status: enable
ttl: 60
timeout: 1
public: true
gauss_thread_wait_status:
name: gauss_thread_wait_status
desc: openGauss database thread metrics
query:
- name: gauss_thread_wait_status
sql: select (select count(*) from pg_thread_wait_status) as thread_total_count, count(*) as wait_thread_count from pg_thread_wait_status where wait_status = 'none' or wait_status = 'wait_cmd';
version: '>=0.0.0'
timeout: 1
ttl: 60
status: enable
metrics:
- name: thread_total_count
description: Thread total count
usage: GAUGE
- name: wait_thread_count
description: Wait thread total count
usage: GAUGE
status: enable
ttl: 60
timeout: 1
public: true
gs_session_memory_detail:
name: gs_session_memory_detail
desc: all kinds of memorytype and detail
query:
- name: gs_session_memory_detail
sql: |-
select contextname,
sum(totalsize)/1024/1024 as totalsize,
sum(freesize)/1024/1024 as freesize,
count(*) count
from gs_session_memory_detail group by contextname
order by totalsize desc limit 10;
version: '>=0.0.0'
timeout: 1
status: enable
metrics:
- name: contextname
description: memory context name
usage: LABEL
- name: totalsize
description: current memory context total memory, unit byte
usage: GAUGE
- name: freesize
description: total number of memory freed in the current memory context, unit byte
usage: COUNTER
- name: count
description: numbers of counts
usage: COUNTER
status: enable
ttl: 5
timeout: 1
public: true
pg_connections:
name: pg_connections
desc: openGauss database connections
query:
- name: pg_connections
sql: select max_conn,used_conn,max_conn-used_conn res_for_normal from (select count(*) used_conn from pg_stat_activity) t1,(select setting::int max_conn from pg_settings where name='max_connections') t2;
version: '>=0.0.0'
timeout: 1
status: enable
metrics:
- name: max_conn
description: total of connections
usage: GAUGE
- name: used_conn
description: used of connections
usage: GAUGE
- name: res_for_normal
description: reserve of connections
usage: GAUGE
status: enable
ttl: 60
timeout: 1
public: true
gauss_global_session_stat:
name: gauss_global_session_stat
desc: openGuass database setting info metrics
query:
- name: gauss_global_session_stat
sql: select node_name, sessid, statid, statname, statunit, value from dbe_perf.global_session_stat;
version: '>=0.0.0'
timeout: 1
status: enable
metrics:
- name: node_name
description: Database process name
usage: LABEL
- name: sessid
description: Thread start time
usage: LABEL
- name: statname
description: Statistics session name
usage: LABEL
- name: statunit
description: Statistics session unit
usage: LABEL
- name: value
description: Statistics session value
usage: GAUGE
status: enable
ttl: 5
timeout: 1
public: true
gauss_stat_bad_block:
name: gauss_stat_bad_block
desc: openGauss node start read data fail metrics
query:
- name: gauss_stat_bad_block
sql: SELECT nodename, databaseid, tablespaceid, relfilenode, bucketid, forknum, error_count, first_time, last_time FROM pg_stat_bad_block;
version: '>=0.0.0'
timeout: 1
ttl: 60
status: enable
metrics:
- name: nodename
description:
usage: LABEL
- name: databaseid
description:
usage: LABEL
- name: tablespaceid
description:
usage: LABEL
- name: relfilenode
description:
usage: LABEL
- name: bucketid
description:
usage: LABEL
- name: forknum
description:
usage: LABEL
- name: error_count
description:
usage: GAUGE
- name: first_time
description:
usage: GAUGE
- name: last_time
description:
usage: GAUGE
status: enable
ttl: 60
timeout: 1
public: true
gauss_redo_stat:
name: gauss_redo_stat
desc: openGauss statistics thread logs playback situation metrics
query:
- name: gauss_redo_stat
sql: select phywrts, phyblkwrt, writetim, avgiotim, lstiotim, miniotim, maxiowtm,1 as value from gs_redo_stat;
version: '>=0.0.0'
timeout: 1
status: enable
metrics:
- name: phywrts
description: Logs playback process write data number of times
usage: LABEL
- name: phyblkwrt
description: Logs playback process write data number of blocks
usage: LABEL
- name: writetim
description: Logs playback process write total time
usage: LABEL
- name: avgiotim
description: Logs playback process write once data average time
usage: LABEL
- name: lstiotim
description: Logs playback process last once write data consume time
usage: LABEL
- name: miniotim
description: Logs playback process single write data consume least time
usage: LABEL
- name: maxiowtm
description: Logs playback process single write data consume max time
usage: LABEL
- name: value
usage: GAUGE
status: enable
ttl: 5
timeout: 1
public: true
gauss_available_extension_versions:
name: gauss_available_extension_versions
desc: openGauss database characteristic expand info metrics
query:
- name: gauss_available_extension_versions
sql: select name, version, installed, superuser, relocatable, schema, requires, comment, 1 as value from pg_available_extension_versions;
version: '>=0.0.0'
timeout: 1
ttl: 60
status: enable
metrics:
- name: name
description: Extension name
usage: LABEL
- name: version
description: Default version name
usage: LABEL
- name: installed
description: Extension current install version
usage: LABEL
- name: superuser
description: Extension file comment string
usage: LABEL
- name: relocatable
description: Extension file comment string
usage: LABEL
- name: schema
description: Extension file comment string
usage: LABEL
- name: requires
description: Extension file comment string
usage: LABEL
- name: comment
description: Extension file comment string
usage: LABEL
- name: value
description: Extension file comment string
usage: GAUGE
status: enable
ttl: 60
timeout: 1
public: true
gauss_global_shared_memory_detail:
name: gauss_global_shared_memory_detail
desc: openGauss all normal node shared used memory info metrics
query:
- name: gauss_global_shared_memory_detail
sql: select node_name, sum(totalsize) as totalsize, sum(freesize) as freesize, sum(usedsize) as usedsize from dbe_perf.global_shared_memory_detail group by node_name;
version: '>=0.0.0'
timeout: 1
ttl: 60
status: enable
metrics:
- name: node_name
description: Database process name
usage: LABEL
- name: totalsize
description: Shared memory total (unit:byte)
usage: GAUGE
- name: freesize
description: Shared memory surplus size(unit:byte)
usage: GAUGE
- name: usedsize
description: Shared memory used size(unit:byte)
usage: GAUGE
status: enable
ttl: 60
timeout: 1
public: true
gauss_workload_sql_count:
name: gauss_workload_sql_count
desc: openGauss the distribution of the number of SQL on the node workload metrics
query:
- name: gauss_workload_sql_count
sql: select workload, ddl_count, dml_count, dcl_count from dbe_perf.workload_sql_count;
version: '>=0.0.0'
timeout: 1
ttl: 60
status: enable
metrics:
- name: workload
description: Load name
usage: LABEL
- name: ddl_count
description: Ddl count
usage: GAUGE
- name: dml_count
description: Dml count
usage: GAUGE
- name: dcl_count
description: Dcl count
usage: GAUGE
status: enable
ttl: 60
timeout: 1
public: true
pg_wait_events:
name: pg_wait_events
desc: openGauss wait event statements
query:
- name: pg_wait_events
sql: select nodename,type,event,wait,failed_wait,total_wait_time from dbe_perf.wait_events where wait !=0 order by total_wait_time desc;
version: '>=0.0.0'
timeout: 1
status: enable
metrics:
- name: nodename
description: Name of node
usage: LABEL
- name: type
description: Type of wait events
usage: LABEL
- name: event
description: Event name
usage: LABEL
- name: wait
description: Numbers of wait
usage: COUNTER
- name: failed_wait
description: failed wait
usage: LABEL
- name: total_wait_time
description: Total wait times
usage: COUNTER
status: enable
ttl: 60
timeout: 1
public: true
gauss_user_login:
name: gauss_user_login
desc: openGauss information on the number of user logins and logouts metrics
query:
- name: gauss_user_login
sql: select node_name, user_name, user_id, login_counter, logout_counter from dbe_perf.user_login;
version: '>=0.0.0'
timeout: 1
ttl: 60
status: enable
metrics:
- name: node_name
description: Database process name
usage: LABEL
- name: user_name
description: User name
usage: LABEL
- name: user_id
description: User Oid
usage: LABEL
- name: login_counter
description: Number of logins
usage: GAUGE
- name: logout_counter
description: Number of logouts
usage: GAUGE
status: enable
ttl: 60
timeout: 1
public: true
gauss_global_pagewriter_status:
name: gauss_global_pagewriter_status
desc: openGauss refresh information and checkpoint information
query:
- name: gauss_global_pagewriter_status
sql: SELECT node_name,pgwr_actual_flush_total_num,pgwr_last_flush_num,remain_dirty_page_num,queue_head_page_rec_lsn,queue_rec_lsn,current_xlog_insert_lsn,ckpt_redo_point FROM pg_catalog.local_pagewriter_stat();
version: '>=0.0.0'
timeout: 1
ttl: 60
status: enable
metrics:
- name: node_name
description: Database process name
usage: LABEL
- name: pgwr_actual_flush_total_num
description: Total number of dirty pages flushed from the start to the current time
usage: GAUGE
- name: pgwr_last_flush_num
description: The number of dirty pages in the previous batch
usage: GAUGE
- name: remain_dirty_page_num
description: The current estimate of how many dirty pages are left.
usage: GAUGE
- name: queue_head_page_rec_lsn
description: Recovery_lsn of the first dirty page in the dirty page queue of the current instance
usage: LABEL
- name: queue_rec_lsn
description: The recovery_lsn of the dirty page queue of the current instance.
usage: LABEL
- name: current_xlog_insert_lsn
description: The location where the current instance XLog is written
usage: LABEL
- name: ckpt_redo_point
description: Checkpoint of current instance
usage: LABEL
status: enable
ttl: 60
timeout: 1
public: true
og_memory_info:
name: og_memory_info
desc: openGauss memory usage informations
query:
- name: og_memory_info
sql: select memorytype,memorymbytes from pv_total_memory_detail();
version: '>=0.0.0'
timeout: 1
status: enable
metrics:
- name: memorytype
description: Name of memorytype
usage: LABEL
- name: memorymbytes
description: memorymbytes
usage: GAUGE
status: enable
ttl: 60
timeout: 1
public: true
gauss_global_ckpt_status:
name: gauss_global_ckpt_status
desc: openGauss all instance checkpoints and log flushing metrics
query:
- name: gauss_global_ckpt_status
sql: SELECT node_name,ckpt_redo_point,ckpt_clog_flush_num,ckpt_csnlog_flush_num,ckpt_multixact_flush_num,ckpt_predicate_flush_num,ckpt_twophase_flush_num,1 as value FROM pg_catalog.local_ckpt_stat();
version: '>=0.0.0'
timeout: 1
ttl: 60
status: enable
metrics:
- name: node_name
description: Database process name
usage: LABEL
- name: ckpt_redo_point
description: Checkpoint of current instance
usage: LABEL
- name: ckpt_clog_flush_num
description: The number of clog flush pages from start to current time
usage: LABEL
- name: ckpt_csnlog_flush_num
description: The number of csnlog flashing pages from startup to the current time
usage: LABEL
- name: ckpt_multixact_flush_num
description: The number of multixact flashing pages from the start to the current time
usage: LABEL
- name: ckpt_predicate_flush_num
description: The number of predicate refresh pages from start to current time
usage: LABEL
- name: ckpt_twophase_flush_num
description: The number of pages refreshed by twophase from the start to the current time
usage: LABEL
- name: value
usage: GAUGE
status: enable
ttl: 60
timeout: 1
public: true
gauss_global_double_write_status:
name: gauss_global_double_write_status
desc: openGauss all instance file double writing metrics
query:
- name: gauss_global_double_write_status
sql: SELECT node_name, curr_dwn, curr_start_page, file_trunc_num, file_reset_num, total_writes, low_threshold_writes, high_threshold_writes, total_pages, low_threshold_pages, high_threshold_pages, 1 as value FROM pg_catalog.local_double_write_stat();
version: '>=0.0.0'
timeout: 1
ttl: 60
status: enable
metrics:
- name: node_name
description: Database process name
usage: LABEL
- name: curr_dwn
description: The serial number of the current double-written file
usage: LABEL
- name: curr_start_pag
description: The current double-write file restores the actual page
usage: LABEL
- name: file_trunc_num
description: The current double-write file reuse times
usage: LABEL
- name: file_reset_num
description: The number of resets after the current double-write file is full
usage: LABEL
- name: total_writes
description: The total I/O times of the current double-write file
usage: LABEL
- name: low_threshold_writes
description: Low-efficiency write double write file IO number
usage: LABEL
- name: high_threshold_writes
description: High-efficiency write double write file IO times
usage: LABEL
- name: total_pages
description: The total number of pages from the current page to the double-write file area
usage: LABEL
- name: low_threshold_pages
description: Number of pages refreshed inefficiently
usage: LABEL
- name: high_threshold_pages
description: Number of pages refreshed efficiently
usage: LABEL
- name: value
usage: GAUGE
status: enable
ttl: 60
timeout: 1
public: true
gs_total_memory_detail:
name: gs_total_memory_detail
desc: all kinds of memorytype and detail
query:
- name: gs_total_memory_detail
sql: |-
select * from gs_total_memory_detail;
version: '>=0.0.0'
timeout: 1
status: enable
metrics:
- name: nodename
description: every node in this cluster
usage: LABEL
- name: memorytype
description: Name of memorytype
usage: LABEL
- name: memorymbytes
description: memory type allocates memory size
usage: GAUGE
status: enable
ttl: 5
timeout: 1
public: true
gauss_summary_file_iostat:
name: gauss_summary_file_iostat
desc: openGauss all normal node shared used memory info metrics
query:
- name: gauss_summary_file_iostat
sql: select sum(phyblkrd) as total_phyblkrd, sum(phyblkwrt) as total_phyblkwrt from dbe_perf.summary_file_iostat;
version: '>=0.0.0'
timeout: 1
ttl: 60
status: enable
metrics:
- name: total_phyblkrd
description: Read the number of physical file blocks
usage: GAUGE
- name: total_phyblkwrt
description: Number of physical file blocks written
usage: GAUGE
status: enable
ttl: 60
timeout: 1
public: true
gauss_statio_user_tables:
name: gauss_statio_user_tables
desc: openGauss IO status of all user relationship tables metrics
query:
- name: gauss_statio_user_tables
sql: select relid, schemaname, relname, heap_blks_read, heap_blks_hit, idx_blks_read, idx_blks_hit, toast_blks_read, toast_blks_hit, tidx_blks_read, tidx_blks_hit, 1 as value from dbe_perf.statio_user_tables;
version: '>=0.0.0'
timeout: 1
ttl: 60
status: enable
metrics:
- name: relid
description: Table OID
usage: LABEL
- name: schemaname
description: The table schema name
usage: LABEL
- name: relname
description: Table Name
usage: LABEL
- name: heap_blks_read
description: Number of disk blocks read from this table
usage: LABEL
- name: heap_blks_hit
description: The number of cache hits for this table
usage: LABEL
- name: idx_blks_read
description: The number of disk blocks read from all indexes in the table
usage: LABEL
- name: idx_blks_hit
description: The number of cache hits for all indexes in the table
usage: LABEL
- name: toast_blks_read
description: The number of disk blocks read by the TOAST table of this table
usage: LABEL
- name: toast_blks_hit
description: The number of hit buffers in the TOAST table of this table
usage: LABEL
- name: tidx_blks_read
description: The number of disk blocks read by the TOAST table index of the table
usage: LABEL
- name: tidx_blks_hit
description: The number of hits in the TOAST table index of the table
usage: LABEL
- name: value
usage: GAUGE
status: enable
ttl: 60
timeout: 1
public: true
gauss_complex_count:
name: gauss_complex_count
desc: openGauss node is ready for a two-phase commit transaction metrics
query:
- name: gauss_complex_count
sql: select count(*) from dbe_perf.statement_wlmstat_complex_runtime where attribute = 'Complicated';
version: '>=0.0.0'
timeout: 1
ttl: 60
status: enable
metrics:
- name: count
usage: GAUGE
status: enable
ttl: 60
timeout: 1
public: true
gauss_cpu_time:
name: gauss_cpu_time
query:
- name: gauss_cpu_time
sql: select value from dbe_perf.instance_time where stat_name = 'CPU_TIME';
version: '>=0.0.0'
timeout: 1
ttl: 60
status: enable
metrics:
- name: value
usage: GAUGE
status: enable
ttl: 60
timeout: 1
public: true
gauss_global_os_runtime_idle:
name: gauss_global_os_runtime_idle
query:
- name: gauss_global_os_runtime_idle
sql: select name,(value/100)as value from dbe_perf.os_runtime where name = 'IDLE_TIME' or name = 'AVG_IDLE_TIME';
version: '>=0.0.0'
timeout: 1
ttl: 60
status: enable
metrics:
- name: name
usage: LABEL
- name: value
usage: GAUGE
status: enable
ttl: 60
timeout: 1
public: true
gauss_top_event:
name: gauss_top_event
query:
- name: gauss_top_event
sql: SELECT to_char(sample_time,'HH24:MI:SS') start_time,event,count(*) cnt FROM get_local_active_session() WHERE sample_time > now() - 15/(24*60*60) group by to_char(sample_time,'HH24:MI:SS'),event order by 1,2;
version: '>=0.0.0'
timeout: 1
ttl: 60
status: enable
metrics:
- name: start_time
usage: LABEL
- name: event
usage: LABEL
- name: cnt
usage: GAUGE
status: enable
ttl: 60
timeout: 1
public: true
gauss_top_tt:
name: gauss_top_tt
query:
- name: gauss_top_tt
sql: SELECT to_char(sample_time,'HH24:MI:SS') start_time,event,count(*) cnt FROM get_local_active_session() WHERE sample_time > now() - 15/(24*60*60) group by to_char(sample_time,'HH24:MI:SS'),event order by 1,2;
version: '>=0.0.0'
timeout: 1
ttl: 60
status: enable
metrics:
- name: start_time
usage: LABEL
- name: event
usage: LABEL
- name: cnt
usage: GAUGE
status: enable
ttl: 60
timeout: 1
public: true
gauss_slow_sql_ai:
name: gauss_slow_sql_ai
query:
- name: gauss_slow_sql_ai
sql: select schema_name,db_name,query,template_id,start_at,duration_time,hit_ratio,fetch_ratio,cpu_time,data_io_time,root_cause,suggestion,floor(random()*(100000-1)) as value from tb_slow_queries order by start_at desc limit 10;
version: '>=0.0.0'
timeout: 1
ttl: 60
status: enable
metrics:
- name: schema_name
usage: LABEL
- name: db_name
usage: LABEL
- name: query
usage: LABEL
- name: template_id
usage: LABEL
- name: start_at
usage: LABEL
- name: duration_time
usage: LABEL
- name: hit_ratio
usage: LABEL
- name: fetch_ratio
usage: LABEL
- name: cpu_time
usage: LABEL
- name: data_io_time
usage: LABEL
- name: root_cause
usage: LABEL
- name: suggestion
usage: LABEL
- name: value
usage: GAUGE
status: enable
ttl: 60
timeout: 1
public: true
pg_table:
name: pg_table
desc: opengauss table statistics, db level, normal version
query:
- name: pg_table
sql: |-
SELECT CURRENT_CATALOG AS datname,psut.schemaname AS nspname,psut.relname,
seq_scan,seq_tup_read,idx_scan,idx_tup_fetch,(seq_scan + idx_scan) AS tbl_scan,(seq_tup_read + idx_tup_fetch) AS tup_read,
n_tup_ins,n_tup_upd,n_tup_del,(n_tup_ins + n_tup_upd + n_tup_del) AS n_tup_mod,
n_tup_hot_upd,n_live_tup,n_dead_tup,
nvl(last_vacuum::text,'1970-01-01') as last_vacuum,nvl(last_autovacuum::text,'1970-01-01') as last_autovacuum,nvl(last_analyze::text,'1970-01-01') as last_analyze,nvl(last_autoanalyze::text,'1970-01-01') as last_autoanalyze,vacuum_count,autovacuum_count,analyze_count,autoanalyze_count,
extract(epoch from now() -(case when nvl(last_vacuum,'1970-01-01')>nvl(last_autovacuum,'1970-01-01') then nvl(last_vacuum,'1970-01-01') else nvl(last_autovacuum,'1970-01-01') end))::int vacuum_delay,
extract(epoch from now() -(case when nvl(last_analyze,'1970-01-01')>nvl(last_autoanalyze,'1970-01-01') then nvl(last_analyze,'1970-01-01') else nvl(last_autoanalyze,'1970-01-01') end))::int analyze_delay,
heap_blks_read,heap_blks_hit,idx_blks_read,idx_blks_hit,
toast_blks_read,toast_blks_hit,tidx_blks_read,tidx_blks_hit
FROM pg_stat_user_tables psut,pg_statio_user_tables psio
WHERE psio.relid = psut.relid and psio.schemaname not in ('pg_catalog', 'information_schema','snapshot') and (n_live_tup+n_dead_tup)>10000;
version: '>=0.0.0'
timeout: 10
ttl: 60
status: enable
dbRole: "primary"
- name: pg_table
sql: |-
SELECT CURRENT_CATALOG AS datname,psut.schemaname AS nspname,psut.relname,
seq_scan,seq_tup_read,idx_scan,idx_tup_fetch,(seq_scan + idx_scan) AS tbl_scan,(seq_tup_read + idx_tup_fetch) AS tup_read,
n_tup_ins,n_tup_upd,n_tup_del,(n_tup_ins + n_tup_upd + n_tup_del) AS n_tup_mod,
n_tup_hot_upd,n_live_tup,n_dead_tup,
nvl(last_vacuum::text,'1970-01-01') as last_vacuum,nvl(last_autovacuum::text,'1970-01-01') as last_autovacuum,nvl(last_analyze::text,'1970-01-01') as last_analyze,nvl(last_autoanalyze::text,'1970-01-01') as last_autoanalyze,vacuum_count,autovacuum_count,analyze_count,autoanalyze_count,
extract(epoch from now() -(case when nvl(last_vacuum,'1970-01-01')>nvl(last_autovacuum,'1970-01-01') then nvl(last_vacuum,'1970-01-01') else nvl(last_autovacuum,'1970-01-01') end))::int vacuum_delay,
extract(epoch from now() -(case when nvl(last_analyze,'1970-01-01')>nvl(last_autoanalyze,'1970-01-01') then nvl(last_analyze,'1970-01-01') else nvl(last_autoanalyze,'1970-01-01') end))::int analyze_delay,
heap_blks_read,heap_blks_hit,idx_blks_read,idx_blks_hit,
toast_blks_read,toast_blks_hit,tidx_blks_read,tidx_blks_hit
FROM pg_stat_user_tables psut,pg_statio_user_tables psio
WHERE psio.relid = psut.relid and psio.schemaname not in ('pg_catalog', 'information_schema','snapshot') and (n_live_tup+n_dead_tup)>10000;
version: '>=0.0.0'
timeout: 10
ttl: 60
status: disable
dbRole: "standby"
metrics:
- name: datname
description: database name of this relation
usage: LABEL
- name: nspname
description: schema name of this relation
usage: LABEL
- name: relname
description: relation name of this relation
usage: LABEL
- name: seq_scan
description: sequential scans initiated on this table
usage: COUNTER
- name: seq_tup_read
description: live rows fetched by sequential scans
usage: COUNTER
- name: idx_scan
description: index scans initiated on this table
usage: COUNTER
- name: idx_tup_fetch
description: rows fetched by index scans
usage: COUNTER
- name: tbl_scan
description: total table scan = index scan + seq scan
usage: COUNTER
- name: tup_read
description: total tuples read = index fetch + seq read
usage: COUNTER
- name: n_tup_ins
description: rows inserted
usage: COUNTER
- name: n_tup_upd
description: rows updated
usage: COUNTER
- name: n_tup_del
description: rows deleted
usage: COUNTER
- name: n_tup_mod
description: rows modified (insert + update + delete)
usage: COUNTER
- name: n_tup_hot_upd
description: rows updated in HOT mode
usage: COUNTER
- name: n_live_tup
description: estimated live rows
usage: GAUGE
- name: n_dead_tup
description: estimated dead rows
usage: GAUGE
- name: n_mod_since_analyze
description: rows changed since last analyze
usage: GAUGE
- name: last_vacuum
description: when table was manually vacuumed last time (FULL not count)
usage: LABEL
- name: last_autovacuum
description: when table was automatically vacuumed last time
usage: LABEL
- name: last_analyze
description: when table was manually analyzed last time
usage: LABEL
- name: last_autoanalyze
description: when table was automatically analyzed last time
usage: LABEL
- name: vacuum_delay
description: delay from last vacuum time
usage: GAUGE
- name: analyze_delay
description: delay from last analyze time
usage: GAUGE
- name: vacuum_count
description: manual vacuum count (FULL not count)
usage: COUNTER
- name: autovacuum_count
description: automatic vacuum count
usage: COUNTER
- name: analyze_count
description: manual analyze count
usage: COUNTER
- name: autoanalyze_count
description: automatic analyze count
usage: COUNTER
- name: heap_blks_read
description: relation heap read
usage: COUNTER
- name: heap_blks_hit
description: relation heap hit
usage: COUNTER
- name: idx_blks_read
description: index read
usage: COUNTER
- name: idx_blks_hit
description: index hit
usage: COUNTER
- name: toast_blks_read
description: toast heap read
usage: COUNTER
- name: toast_blks_hit
description: toast heap hit
usage: COUNTER
- name: tidx_blks_read
description: toast index read
usage: COUNTER
- name: tidx_blks_hit
description: toast index hit
usage: COUNTER
status: enable
ttl: 60
timeout: 10
public: true
pg_index:
name: pg_index
desc: opengauss index statistics, db level, normal version
query:
- name: pg_index
sql: |-
SELECT CURRENT_CATALOG AS datname,psui.schemaname AS schemaname,psui.relname AS relname,psui.indexrelname AS indexrelname,idx_scan,idx_tup_read,idx_tup_fetch,idx_blks_read,idx_blks_hit
FROM pg_stat_user_indexes psui,pg_statio_user_indexes psio
WHERE psio.indexrelid = psui.indexrelid and psui.schemaname not in ('pg_catalog', 'information_schema','snapshot')
order by idx_scan desc limit 100;
version: '>=0.0.0'
timeout: 10
ttl: 3600
dbRole: "primary"
status: enable
- name: pg_index
sql: |-
SELECT CURRENT_CATALOG AS datname,psui.schemaname AS schemaname,psui.relname AS relname,psui.indexrelname AS indexrelname,idx_scan,idx_tup_read,idx_tup_fetch,idx_blks_read,idx_blks_hit
FROM pg_stat_user_indexes psui,pg_statio_user_indexes psio
WHERE psio.indexrelid = psui.indexrelid and psui.schemaname not in ('pg_catalog', 'information_schema','snapshot')
order by idx_scan desc limit 100;
version: '>=0.0.0'
timeout: 10
ttl: 3600
dbRole: "standby"
status: disable
metrics:
- name: datname
description: database name of this relation
usage: LABEL
- name: schemaname
description: schema name of this relation
usage: LABEL
- name: relname
description: relation name of this relation
usage: LABEL
- name: indexrelname
description: index name of this relation
usage: LABEL
- name: idx_scan
description: index scans initiated on this index
usage: GAUGE
- name: idx_tup_read
description: index entries returned by scans on this index
usage: COUNTER
- name: idx_tup_fetch
description: live table rows fetched by simple index scans using this index
usage: COUNTER
- name: idx_blks_read
description: blocks been read from disk of this index
usage: COUNTER
- name: idx_blks_hit
description: blocks hit from cache of this index
usage: COUNTER
status: enable
ttl: 10
timeout: 1
public: true
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/wgc1314/opengauss-prometheus-exporter.git
[email protected]:wgc1314/opengauss-prometheus-exporter.git
wgc1314
opengauss-prometheus-exporter
openGauss-prometheus-exporter
master

搜索帮助