PDC agent CLI reference
This document provides a reference for all command-line flags available when running the PDC agent.
Usage
pdc [FLAGS]Replace [FLAGS] with one or more of the flags described below.
Required flags
The following flags are required to connect the PDC agent to Grafana Cloud.
Optional flags
The following flags are optional and can be used to customize the PDC agent behavior.
Environment variables
The required flags can also be set using environment variables. If both an environment variable and a flag are set, the flag takes precedence.
Examples
The following examples show common ways to run the PDC agent.
Basic usage
Run the PDC agent with the required flags:
./pdc -token ${GCLOUD_PDC_SIGNING_TOKEN} -cluster ${GCLOUD_PDC_CLUSTER} -gcloud-hosted-grafana-id ${GCLOUD_HOSTED_GRAFANA_ID}Restrict accessible endpoints
Use the -ssh-flag option with the PermitRemoteOpen SSH option to restrict which hosts and ports the PDC agent can connect to:
./pdc -token ${GCLOUD_PDC_SIGNING_TOKEN} \
-cluster ${GCLOUD_PDC_CLUSTER} \
-gcloud-hosted-grafana-id ${GCLOUD_HOSTED_GRAFANA_ID} \
-ssh-flag='-o PermitRemoteOpen=mysql.example.com:3306 prometheus.example.com:443'Enable debug logging
Turn on debug logging to get more information about the PDC agent’s activity, including OpenSSH debug logs:
./pdc -token ${GCLOUD_PDC_SIGNING_TOKEN} \
-cluster ${GCLOUD_PDC_CLUSTER} \
-gcloud-hosted-grafana-id ${GCLOUD_HOSTED_GRAFANA_ID} \
-log.level=debugIncrease parallel connections
Increase the number of parallel SSH connections to improve throughput:
./pdc -token ${GCLOUD_PDC_SIGNING_TOKEN} \
-cluster ${GCLOUD_PDC_CLUSTER} \
-gcloud-hosted-grafana-id ${GCLOUD_HOSTED_GRAFANA_ID} \
-connections=3Note
The total number of connections across all PDC agents for a single PDC network is limited to 50. If you need more connections, contact Grafana Support to request an increase.
Increase connection timeout
If the PDC agent intermittently fails to connect to the PDC server, increase the SSH connection timeout:
./pdc -token ${GCLOUD_PDC_SIGNING_TOKEN} \
-cluster ${GCLOUD_PDC_CLUSTER} \
-gcloud-hosted-grafana-id ${GCLOUD_HOSTED_GRAFANA_ID} \
-ssh-flag='-o ConnectTimeout=5'Use environment variables
Instead of passing flags on the command line, set the required values as environment variables:
export GCLOUD_PDC_SIGNING_TOKEN="your-token"
export GCLOUD_HOSTED_GRAFANA_ID="your-instance-id"
export GCLOUD_PDC_CLUSTER="your-cluster"
./pdcUse a custom SSH key file
Specify a custom location for the SSH key file:
./pdc -token ${GCLOUD_PDC_SIGNING_TOKEN} \
-cluster ${GCLOUD_PDC_CLUSTER} \
-gcloud-hosted-grafana-id ${GCLOUD_HOSTED_GRAFANA_ID} \
-ssh-key-file=/etc/pdc/keys/grafana_pdcProduction-ready configuration
Combine multiple flags for a production deployment with endpoint restrictions, multiple connections, and increased timeout:
./pdc -token ${GCLOUD_PDC_SIGNING_TOKEN} \
-cluster ${GCLOUD_PDC_CLUSTER} \
-gcloud-hosted-grafana-id ${GCLOUD_HOSTED_GRAFANA_ID} \
-connections=3 \
-ssh-flag='-o PermitRemoteOpen=mysql.example.com:3306 prometheus.example.com:443' \
-ssh-flag='-o ConnectTimeout=5'Run with Docker
Pass the required flags when running the PDC agent Docker image:
docker run --name pdc-agent grafana/pdc-agent:latest \
-token ${GCLOUD_PDC_SIGNING_TOKEN} \
-cluster ${GCLOUD_PDC_CLUSTER} \
-gcloud-hosted-grafana-id ${GCLOUD_HOSTED_GRAFANA_ID}Or use environment variables:
docker run --name pdc-agent \
-e GCLOUD_PDC_SIGNING_TOKEN=${GCLOUD_PDC_SIGNING_TOKEN} \
-e GCLOUD_HOSTED_GRAFANA_ID=${GCLOUD_HOSTED_GRAFANA_ID} \
-e GCLOUD_PDC_CLUSTER=${GCLOUD_PDC_CLUSTER} \
grafana/pdc-agent:latestDeploy on Kubernetes
For Kubernetes deployments, refer to Configure private data source connect (PDC) for complete setup instructions, including creating secrets and deployment manifests.
Related documentation
- Configure private data source connect (PDC) - Setup and deployment instructions
- Troubleshoot PDC - Common errors, log interpretation, and exit codes
- PDC agent metrics - Available Prometheus metrics
- PDC scalability and security - Resource requirements and security considerations



