diff --git a/apps/studio/components/interfaces/Observability/DatabaseInfrastructureSection.tsx b/apps/studio/components/interfaces/Observability/DatabaseInfrastructureSection.tsx index 9c92aac9781..3eef8058608 100644 --- a/apps/studio/components/interfaces/Observability/DatabaseInfrastructureSection.tsx +++ b/apps/studio/components/interfaces/Observability/DatabaseInfrastructureSection.tsx @@ -100,10 +100,8 @@ export const DatabaseInfrastructureSection = ({ [infraData, maxConnectionsData] ) - const errorMessage = - infraError && typeof infraError === 'object' && 'message' in infraError - ? String(infraError.message) - : 'Error loading data' + // Show a friendly, static message instead of leaking the raw API error to the user + const metricErrorState = Unable to load // Generate database report URL with time range parameters const getDatabaseReportUrl = () => { @@ -175,7 +173,7 @@ export const DatabaseInfrastructureSection = ({ {infraError ? ( -
{errorMessage}
+ metricErrorState ) : connections.max > 0 ? ( {connections.peak}/{connections.max} @@ -196,7 +194,7 @@ export const DatabaseInfrastructureSection = ({ {infraError ? ( -
{errorMessage}
+ metricErrorState ) : metrics ? ( {metrics.disk.current.toFixed(0)}% ) : ( @@ -215,7 +213,7 @@ export const DatabaseInfrastructureSection = ({ {infraError ? ( -
{errorMessage}
+ metricErrorState ) : metrics ? ( {metrics.diskIo.current.toFixed(0)}% ) : ( @@ -234,7 +232,7 @@ export const DatabaseInfrastructureSection = ({ {infraError ? ( -
{errorMessage}
+ metricErrorState ) : metrics ? ( {metrics.ram.current.toFixed(0)}% ) : ( @@ -253,7 +251,7 @@ export const DatabaseInfrastructureSection = ({ {infraError ? ( -
{errorMessage}
+ metricErrorState ) : metrics ? ( {metrics.cpu.current.toFixed(0)}% ) : (