Skip to content

Commit 8b956bf

Browse files
hgiasachasura-bot
authored andcommitted
server: add hasura_postgres_connection_error_total metric
PR-URL: hasura/graphql-engine-mono#11063 GitOrigin-RevId: 0e0f8b6e7759623f470893aaa6d6e68d205269b5
1 parent f68438b commit 8b956bf

File tree

4 files changed

+135
-367
lines changed

4 files changed

+135
-367
lines changed

community/boilerplates/observability/enterprise/grafana/dashboards/hasura/hasura-overview.json

+118-19
Original file line numberDiff line numberDiff line change
@@ -3453,7 +3453,7 @@
34533453
"type": "prometheus",
34543454
"uid": "${DS_PROMETHEUS}"
34553455
},
3456-
"description": "Total number of incoming requests for cache lookup",
3456+
"description": "Postgres connection errors from GraphQL Engine instances",
34573457
"fieldConfig": {
34583458
"defaults": {
34593459
"color": {
@@ -3501,6 +3501,10 @@
35013501
{
35023502
"color": "green",
35033503
"value": null
3504+
},
3505+
{
3506+
"color": "red",
3507+
"value": 1
35043508
}
35053509
]
35063510
},
@@ -3514,7 +3518,7 @@
35143518
"x": 12,
35153519
"y": 81
35163520
},
3517-
"id": 57,
3521+
"id": 66,
35183522
"options": {
35193523
"legend": {
35203524
"calcs": [],
@@ -3534,25 +3538,13 @@
35343538
"uid": "${DS_PROMETHEUS}"
35353539
},
35363540
"editorMode": "code",
3537-
"expr": "sum(rate(hasura_cache_request_count{job=~\"$job\",instance=~\"$instance\",status=\"hit\"}[$__rate_interval]))",
3538-
"legendFormat": "Cache Hit",
3539-
"range": true,
3540-
"refId": "Hit"
3541-
},
3542-
{
3543-
"datasource": {
3544-
"type": "prometheus",
3545-
"uid": "${DS_PROMETHEUS}"
3546-
},
3547-
"editorMode": "code",
3548-
"expr": "sum(rate(hasura_cache_request_count{job=~\"$job\",instance=~\"$instance\"}[$__rate_interval]))",
3549-
"hide": false,
3550-
"legendFormat": "Total",
3541+
"expr": "sum by (job, role,conn_info,source_name) (increase(hasura_postgres_connection_error_total{job=~\"$job\",instance=~\"$instance\"}[$__rate_interval])) ",
3542+
"legendFormat": "__auto",
35513543
"range": true,
3552-
"refId": "Total"
3544+
"refId": "A"
35533545
}
35543546
],
3555-
"title": "Cache Request Rate",
3547+
"title": "Postgres Connectionr Errors",
35563548
"type": "timeseries"
35573549
},
35583550
{
@@ -3748,6 +3740,113 @@
37483740
],
37493741
"title": "Postgres Pool Wait Time (P95)",
37503742
"type": "timeseries"
3743+
},
3744+
{
3745+
"datasource": {
3746+
"type": "prometheus",
3747+
"uid": "${DS_PROMETHEUS}"
3748+
},
3749+
"description": "Total number of incoming requests for cache lookup",
3750+
"fieldConfig": {
3751+
"defaults": {
3752+
"color": {
3753+
"mode": "palette-classic"
3754+
},
3755+
"custom": {
3756+
"axisBorderShow": false,
3757+
"axisCenteredZero": false,
3758+
"axisColorMode": "text",
3759+
"axisLabel": "",
3760+
"axisPlacement": "auto",
3761+
"barAlignment": 0,
3762+
"drawStyle": "line",
3763+
"fillOpacity": 0,
3764+
"gradientMode": "none",
3765+
"hideFrom": {
3766+
"legend": false,
3767+
"tooltip": false,
3768+
"viz": false
3769+
},
3770+
"insertNulls": false,
3771+
"lineInterpolation": "smooth",
3772+
"lineStyle": {
3773+
"fill": "solid"
3774+
},
3775+
"lineWidth": 1,
3776+
"pointSize": 1,
3777+
"scaleDistribution": {
3778+
"type": "linear"
3779+
},
3780+
"showPoints": "auto",
3781+
"spanNulls": false,
3782+
"stacking": {
3783+
"group": "A",
3784+
"mode": "none"
3785+
},
3786+
"thresholdsStyle": {
3787+
"mode": "off"
3788+
}
3789+
},
3790+
"mappings": [],
3791+
"thresholds": {
3792+
"mode": "absolute",
3793+
"steps": [
3794+
{
3795+
"color": "green",
3796+
"value": null
3797+
}
3798+
]
3799+
},
3800+
"unit": "none"
3801+
},
3802+
"overrides": []
3803+
},
3804+
"gridPos": {
3805+
"h": 7,
3806+
"w": 12,
3807+
"x": 0,
3808+
"y": 95
3809+
},
3810+
"id": 57,
3811+
"options": {
3812+
"legend": {
3813+
"calcs": [],
3814+
"displayMode": "list",
3815+
"placement": "bottom",
3816+
"showLegend": true
3817+
},
3818+
"tooltip": {
3819+
"mode": "single",
3820+
"sort": "none"
3821+
}
3822+
},
3823+
"targets": [
3824+
{
3825+
"datasource": {
3826+
"type": "prometheus",
3827+
"uid": "${DS_PROMETHEUS}"
3828+
},
3829+
"editorMode": "code",
3830+
"expr": "sum(rate(hasura_cache_request_count{job=~\"$job\",instance=~\"$instance\",status=\"hit\"}[$__rate_interval]))",
3831+
"legendFormat": "Cache Hit",
3832+
"range": true,
3833+
"refId": "Hit"
3834+
},
3835+
{
3836+
"datasource": {
3837+
"type": "prometheus",
3838+
"uid": "${DS_PROMETHEUS}"
3839+
},
3840+
"editorMode": "code",
3841+
"expr": "sum(rate(hasura_cache_request_count{job=~\"$job\",instance=~\"$instance\"}[$__rate_interval]))",
3842+
"hide": false,
3843+
"legendFormat": "Total",
3844+
"range": true,
3845+
"refId": "Total"
3846+
}
3847+
],
3848+
"title": "Cache Request Rate",
3849+
"type": "timeseries"
37513850
}
37523851
],
37533852
"refresh": "",
@@ -3832,6 +3931,6 @@
38323931
"timezone": "",
38333932
"title": "Hasura Overview",
38343933
"uid": "Of9GFjr7z",
3835-
"version": 2,
3934+
"version": 1,
38363935
"weekStart": ""
38373936
}

docs/docs/observability/enterprise-edition/prometheus/metrics.mdx

+10
Original file line numberDiff line numberDiff line change
@@ -485,6 +485,16 @@ The time taken to acquire a connection from the pool.
485485
| Labels | `source_name`: name of the database<br />`conn_info`: connection url string (password omitted) or name of the connection url environment variable<br />`role`: primary \| replica |
486486
| Unit | seconds |
487487

488+
#### Hasura Postgres Connection Errors Total
489+
490+
Total number of PostgreSQL connection errors.
491+
492+
| | |
493+
| ------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
494+
| Name | `hasura_postgres_connection_error_total` |
495+
| Type | Counter |
496+
| Labels | `source_name`: name of the database<br />`conn_info`: connection url string (password omitted) or name of the connection url environment variable<br />`role`: primary \| replica |
497+
488498
### Hasura source health
489499

490500
Health check status of a particular data source, corresponding to the output of `/healthz/sources`, with possible values

0 commit comments

Comments
 (0)