Postgres: Switch the datasource plugin from lib/pq to pgx (#108443)

* Postgres: Switch the datasource plugin from lib/pq to pgx

* Fix lint
This commit is contained in:
Zoltán Bedi
2025-07-30 14:47:25 +02:00
committed by GitHub
parent b707cd28f1
commit 3ff4c6a2d2
26 changed files with 3179 additions and 147 deletions
+6
View File
@@ -1655,6 +1655,12 @@ var (
Owner: grafanaObservabilityTracesAndProfilingSquad,
FrontendOnly: true,
},
{
Name: "postgresDSUsePGX",
Description: "Enables using PGX instead of libpq for PostgreSQL datasource",
Stage: FeatureStageExperimental,
Owner: grafanaOSSBigTent,
},
{
Name: "tempoAlerting",
Description: "Enables creating alerts from Tempo data source",
+1
View File
@@ -215,6 +215,7 @@ localizationForPlugins,experimental,@grafana/plugins-platform-backend,false,fals
unifiedNavbars,GA,@grafana/plugins-platform-backend,false,false,true
logsPanelControls,preview,@grafana/observability-logs,false,false,true
metricsFromProfiles,experimental,@grafana/observability-traces-and-profiling,false,false,true
postgresDSUsePGX,experimental,@grafana/oss-big-tent,false,false,false
tempoAlerting,experimental,@grafana/observability-traces-and-profiling,false,false,true
pluginsAutoUpdate,experimental,@grafana/plugins-platform-backend,false,false,false
multiTenantFrontend,experimental,@grafana/grafana-frontend-platform,false,false,false
1 Name Stage Owner requiresDevMode RequiresRestart FrontendOnly
215 unifiedNavbars GA @grafana/plugins-platform-backend false false true
216 logsPanelControls preview @grafana/observability-logs false false true
217 metricsFromProfiles experimental @grafana/observability-traces-and-profiling false false true
218 postgresDSUsePGX experimental @grafana/oss-big-tent false false false
219 tempoAlerting experimental @grafana/observability-traces-and-profiling false false true
220 pluginsAutoUpdate experimental @grafana/plugins-platform-backend false false false
221 multiTenantFrontend experimental @grafana/grafana-frontend-platform false false false
+4
View File
@@ -871,6 +871,10 @@ const (
// Enables creating metrics from profiles and storing them as recording rules
FlagMetricsFromProfiles = "metricsFromProfiles"
// FlagPostgresDSUsePGX
// Enables using PGX instead of libpq for PostgreSQL datasource
FlagPostgresDSUsePGX = "postgresDSUsePGX"
// FlagTempoAlerting
// Enables creating alerts from Tempo data source
FlagTempoAlerting = "tempoAlerting"
+13
View File
@@ -2413,6 +2413,19 @@
"expression": "false"
}
},
{
"metadata": {
"name": "postgresDSUsePGX",
"resourceVersion": "1753174666056",
"creationTimestamp": "2025-05-26T06:54:18Z",
"deletionTimestamp": "2025-06-03T12:45:07Z"
},
"spec": {
"description": "Enables using PGX instead of libpq for PostgreSQL datasource",
"stage": "experimental",
"codeowner": "@grafana/oss-big-tent"
}
},
{
"metadata": {
"name": "preferLibraryPanelTitle",
@@ -163,7 +163,7 @@ func TestIntegrationPluginManager(t *testing.T) {
pr := prometheus.ProvideService(hcp)
tmpo := tempo.ProvideService(hcp)
td := testdatasource.ProvideService()
pg := postgres.ProvideService(cfg)
pg := postgres.ProvideService(cfg, features)
my := mysql.ProvideService()
ms := mssql.ProvideService(cfg)
db := db.InitTestDB(t, sqlstore.InitTestDBOpt{Cfg: cfg})