Configure GCP Private Service Connect
Note
Sending telemetry data to Grafana Cloud via GCP Private Service Connect is currently in public preview. Grafana Labs offers limited support, and breaking changes might occur prior to the feature being made generally available.
Send telemetry data from your GCP private network to Grafana Cloud via Private Service Connect, also known as PSC.
Sending your data via GCP PSC can:
- Reduce your GCP egress costs
- Improve security by keeping your data within the GCP network
To use this feature, configure a PSC endpoint in your GCP project.
Prerequisites
To use GCP PSC, you will need:
- A Grafana Cloud stack hosted on GCP. Check where your stack is hosted by navigating to it in the My Account section of Grafana Cloud and clicking on Details for a given service, like Prometheus or Loki. If the region matches one of the GCP regions where Grafana Cloud is hosted, then your stack is hosted on GCP.
A GCP network, where you create a PSC endpoint to forward your telemetry data.
A GCP Service Directory namespace, to allow PSC to automatically configure the private DNS zone and records for your PSC endpoints.
Use PSC to send telemetry between GCP regions
Grafana Cloud’s GCP PSC integration supports native cross-region connectivity, so you can connect to services hosted in other GCP Regions over PSC endpoints.
To set up cross-region connectivity, enable Global Access during PSC endpoint creation.
Set up a PSC Endpoint
You can create a PSC endpoint in the GCP console, or provision one using your preferred tool, like Terraform.
With the GCP Console
Open your GCP Console and navigate to Private Service Connect.
Click the Connected endpoints tab.
Click Connect endpoint.
For Target, select Published service.
For Target service, enter the service attachment URI from your Grafana Cloud stack. The service attachment URI is in this format:
projects/SERVICE_PROJECT/regions/REGION/serviceAttachments/SERVICE_NAME
- Contact Grafana Support to obtain the corresponding service attachment URI for you Grafana Cloud stack. Provide the service you want to connect (for example Loki) and your GCP project IDs from where you plan to connect from.
Enter provided value into the Target service field in the GCP console.
For Endpoint name, enter a name to use for the endpoint, for example
grafana-loki-us-central
. Note this is also the name for the DNS record.Select a Network and Subnetwork for the endpoint.
Select an IP address for the endpoint. If you need a new IP address, you can create one:
- Click the IP address drop-down menu and select Create IP address.
- Enter a Name and optional Description for the IP address. For example, as name you can use
psc-grafana-loki-us-central
- Select Assign automatically or Let me choose.
- If you selected Let me choose, enter the Custom IP address you want to use.
- Click Reserve.
To make the endpoint available from any region, select Enable global access. If you do not plan to use cross-region connectivity, you can leave this option disabled.
Open the Service Directory option and select a Namespace from the drop-down list; or, create a new namespace for the region. The Region is populated based on the selected
subnetwork
. Service Discovery configures a Private DNS zone forprod-psc.grafana.net
and create records for the endpoint, in this examplegrafana-loki-us-central.prod-psc.grafana.net
.Click Add endpoint.
The new PSC endpoint will be created.
After a short period of time, the endpoint is created and status is set to
Available
.Send telemetry to Grafana Cloud using the given private DNS name, in place of the normal
remote_write
endpoint or forwarding URL configured for Grafana Agent, Prometheus, Promtail, or other tools you use to connect your data. For more details refer to Grafana documentation.The Private DNS Name always follows the pattern
<endpoint name>.prod-psc.grafana.net
.Repeat this PSC Endpoint creation process for each type of telemetry you would like to send to Grafana Cloud. For example, create one PSC Endpoint each for Cloud Metrics, Logs, Traces, and Profiles.
With Terraform
Use the following snippet to automate PSC Endpoint setup in GCP using Terraform: