Best practices for data source configuration
When using private data source connect (PDC), Grafana sends data source queries via the PDC system. This means that PDC lifecycle events can have an impact on the TCP connections that data sources use for queries.
The PDC system has a graceful shutdown period set to slightly more than 5 minutes. Grafana doesn’t route new connections via a PDC component that’s shutting down but existing TCP connections, reused for more than the graceful shutdown period, risk interruption in the middle of a query.
In this scenario, the queries return an error with a message like Partial data response error
or db query error: invalid connection
.
Some data sources have configuration to reuse established connections. To avoid having queries by these data sources disrupted by PDC lifecycle events, reduce the maximum connection lifetime on these data sources to less than 5 minutes.
Affected data sources
The following table lists the affected data sources and the configuration field used to modify the maximum connection lifetime:
Data source | Configuration field |
---|---|
Microsoft SQL Server | Max lifetime |
MySQL | Max lifetime |
PostgreSQL | Max lifetime |
Was this page helpful?
Related resources from Grafana Labs
![Getting started with the Grafana LGTM Stack](/static/assets/featured/getting-started-with-grafana-lgtm-stack-amer_featured.png?w=200 200w, /static/assets/featured/getting-started-with-grafana-lgtm-stack-amer_featured.png?w=400 400w)
![Intro to Kubernetes monitoring in Grafana Cloud](/media/webinar/Screenshot-2024-02-12-at-4.09.30-PM.png?w=200 200w, /media/webinar/Screenshot-2024-02-12-at-4.09.30-PM.png?w=400 400w)
![Building advanced Grafana dashboards](/media/webinar/AMER_buildadv_notxt.png?w=200 200w, /media/webinar/AMER_buildadv_notxt.png?w=400 400w)