Skip to main content

Configuration Reference

This document provides a complete reference of all pgX configuration options.

Configuration Page


Accessing Configuration​

  1. Navigate to Administration → Plugins in Grafana
  2. Search for "pgX"
  3. Click on the plugin
  4. Select the Configuration tab

Configuration Options​

Data Source Settings​

Datasource UID​

PropertyValue
SettingclickhouseDataSourceUid
TypeString
RequiredYes
Default-

The UID of your Scout Telemetry Data Lake datasource in Grafana. This datasource must be configured and working before pgX can display metrics.

How to find:

  1. Go to Connections → Data Sources
  2. Click on your Scout Telemetry Data Lake datasource
  3. The UID is in the URL or datasource settings

Database Name​

PropertyValue
SettingclickhouseDatabaseName
TypeString
RequiredNo
Defaultdefault

The database containing your PostgreSQL metrics tables.

Metrics Table Name​

PropertyValue
SettingmetricsTableName
TypeString
RequiredNo
Defaultotel_metrics_gauge

The name of the table containing PostgreSQL metrics in OpenTelemetry format.


Environment Settings​

Environments​

PropertyValue
Settingenvironments
TypeString (comma-separated)
RequiredNo
Defaultstaging,production

Comma-separated list of environment names to show in the environment dropdown.

Examples:

  • staging,production
  • dev,staging,prod
  • us-east,us-west,eu-west

Environment Attribute Key​

PropertyValue
SettingenvironmentAttributeKey
TypeString
RequiredNo
Defaultenvironment

The resource attribute key used to filter metrics by environment. This should match the attribute used when collecting metrics.

Common values:

  • environment
  • env
  • deployment.environment

Service Names​

PropertyValue
SettingserviceNames
TypeString (comma-separated)
RequiredNo
Defaultpgdashex

Comma-separated list of service names that identify your PostgreSQL metrics collector.


Query Settings​

Max Time Range​

PropertyValue
SettingmaxTimeRange
TypeString (duration)
RequiredNo
Default1h

Maximum time range allowed for queries. Limits how far back users can query to prevent expensive queries.

Format: Duration string (e.g., 30m, 1h, 6h, 1d)

Examples:

  • 30m - 30 minutes
  • 1h - 1 hour
  • 6h - 6 hours
  • 1d - 1 day

Max Variable Options​

PropertyValue
SettingmaxVariableOptions
TypeNumber
RequiredNo
Default100

Maximum number of options to load in template variable dropdowns. Increase if you have many databases/tables/indexes.


Access Control​

Enable RBAC Service Name Filtering​

PropertyValue
SettingenableRBACServiceNameFiltering
TypeBoolean
RequiredNo
Defaultfalse

When enabled, filters metrics based on service names the user has access to. Requires Grafana Enterprise RBAC configuration.


Deployment Type​

PostgreSQL Deployment Type​

PropertyValue
SettingpostgresDeploymentType
TypeEnum
RequiredNo
Defaultself-hosted

The type of PostgreSQL deployment being monitored.

ValueDescriptionFeatures
self-hostedPostgreSQL on your own infrastructureAll features
rdsAmazon RDS for PostgreSQLIncludes Resources dashboard
cloud-sqlGoogle Cloud SQL for PostgreSQLComing soon

Impact:

  • self-hosted: Standard metrics, no cloud resource metrics
  • rds: Enables AWS CloudWatch metrics in Resources dashboard
  • cloud-sql: Future support for GCP metrics

RDS Settings​

These settings only apply when postgresDeploymentType is set to rds.

RDS Service Name​

PropertyValue
SettingrdsServiceName
TypeString
RequiredNo (for RDS)
Defaultaws-cloudwatch-stream

The service name used for CloudWatch metrics collection.

RDS Metrics Prefix​

PropertyValue
SettingrdsMetricsPrefix
TypeString
RequiredNo (for RDS)
Defaultamazonaws.com/AWS/RDS/

The prefix used for CloudWatch RDS metric names.

RDS Metrics Table Name​

PropertyValue
SettingrdsMetricsTableName
TypeString
RequiredNo (for RDS)
Defaultotel_metrics_summary

The table containing CloudWatch metrics.

RDS Attribute Format​

PropertyValue
SettingrdsAttributeFormat
TypeEnum
RequiredNo (for RDS)
Defaultnested

How CloudWatch dimension attributes are stored in the data lake.

ValueDescription
nestedAttributes stored as nested JSON objects. Access via JSONExtract. Example: Attributes['Dimensions'] contains '{"DBInstanceIdentifier": "prod-db"}'
flatAttributes stored with dot-notation keys. Direct access. Example: Attributes['Dimensions.DBInstanceIdentifier'] contains 'prod-db'

Configuration Examples​

Basic Self-Hosted Configuration​

{
"clickhouseDataSourceUid": "your-clickhouse-uid",
"clickhouseDatabaseName": "default",
"metricsTableName": "otel_metrics_gauge",
"environments": "staging,production",
"postgresDeploymentType": "self-hosted"
}

AWS RDS Configuration​

{
"clickhouseDataSourceUid": "your-clickhouse-uid",
"clickhouseDatabaseName": "metrics",
"metricsTableName": "otel_metrics_gauge",
"environments": "staging,production",
"postgresDeploymentType": "rds",
"rdsServiceName": "aws-cloudwatch-stream",
"rdsMetricsPrefix": "amazonaws.com/AWS/RDS/",
"rdsMetricsTableName": "otel_metrics_summary",
"rdsAttributeFormat": "nested"
}

Multi-Region Configuration​

{
"clickhouseDataSourceUid": "your-clickhouse-uid",
"clickhouseDatabaseName": "default",
"metricsTableName": "otel_metrics_gauge",
"environments": "us-east-1,us-west-2,eu-west-1",
"environmentAttributeKey": "aws.region",
"maxTimeRange": "6h",
"maxVariableOptions": 200,
"postgresDeploymentType": "rds"
}

Enterprise Configuration with RBAC​

{
"clickhouseDataSourceUid": "your-clickhouse-uid",
"clickhouseDatabaseName": "metrics",
"metricsTableName": "otel_metrics_gauge",
"environments": "dev,staging,production",
"enableRBACServiceNameFiltering": true,
"serviceNames": "pgdashex-dev,pgdashex-staging,pgdashex-prod",
"maxTimeRange": "1h",
"postgresDeploymentType": "self-hosted"
}

Default Values Reference​

SettingDefault Value
clickhouseDatabaseNamedefault
metricsTableNameotel_metrics_gauge
maxVariableOptions100
environmentsstaging,production
environmentAttributeKeyenvironment
enableRBACServiceNameFilteringfalse
maxTimeRange1h
serviceNamespgdashex
postgresDeploymentTypeself-hosted
rdsServiceNameaws-cloudwatch-stream
rdsMetricsPrefixamazonaws.com/AWS/RDS/
rdsMetricsTableNameotel_metrics_summary
rdsAttributeFormatnested

Troubleshooting​

No Data Appearing​

  1. Check datasource: Verify Scout Telemetry Data Lake datasource is working
  2. Verify table name: Ensure metricsTableName matches your actual table
  3. Check service name: Ensure serviceNames matches your collector
  4. Review time range: Data may not exist in selected time range

Environment Dropdown Empty​

  1. Check environments setting: Verify environments is set correctly
  2. Check attribute key: Ensure environmentAttributeKey matches your data
  3. Verify data exists: Check the data lake for the expected attribute values

RDS Metrics Not Showing​

  1. Check deployment type: Ensure postgresDeploymentType is rds
  2. Verify RDS table: Check rdsMetricsTableName is correct
  3. Check attribute format: Ensure rdsAttributeFormat matches your data
  4. Verify CloudWatch collection: Ensure metrics are being collected

Performance Issues​

  1. Reduce time range: Lower maxTimeRange setting
  2. Limit variables: Reduce maxVariableOptions
  3. Check query patterns: Review query performance in the data lake

Was this page helpful?