Export telemetry to Grafana Cloud
This tutorial shows you how to export metrics from your Datum platform to Grafana Cloud using an ExportPolicy and Secret.
Before you begin
Section titled “Before you begin”This tutorial assumes you have already:
- Registered a Datum account
- Installed and configured the necessary tools
- Created a Datum project
- [Configured a kubeconfig context for your project]( “create-project#add-a-kubeconfig-context-for-your-project” >}} )
- A Grafana Cloud account with an active instance
Overview
Section titled “Overview”You will configure metric export by:
- Accessing your Grafana Cloud instance
- Generating Prometheus remote write configuration
- Creating Datum Secret and ExportPolicy resources
The process extracts connection details from Grafana Cloud’s generated configuration and creates the necessary Datum resources automatically.
Step 1: Access your Grafana Cloud instance
Section titled “Step 1: Access your Grafana Cloud instance”If you don’t have a Grafana Cloud account, create one at grafana.com.
- Sign in to Grafana Cloud
- Navigate to your desired instance
- Copy your instance URL (for example:
https://play.grafana.net
)
Step 2: Generate connection URL
Section titled “Step 2: Generate connection URL”Use this form to generate the Grafana Cloud connection URL:
Step 3: Get Prometheus configuration
Section titled “Step 3: Get Prometheus configuration”- Click the generated connection URL above
- Choose whether to create a new API token or use an existing one
- Complete the form and submit it
- Copy the generated Prometheus configuration YAML
The configuration looks similar to this:
remote_write: - url: https://prometheus-prod-56-prod-us-east-2.grafana.net/api/prom/push basic_auth: username: 123456 password: glc_eyJvIjoiNzA2...
Step 4: Generate and apply Datum resources
Section titled “Step 4: Generate and apply Datum resources”Paste your Prometheus configuration below to generate the Secret and ExportPolicy. Use the tabs to choose between applying from stdin or saving to files:
Datum Resource Generator
Secret
Provide your Prometheus configuration above to generate the Secret manifest
ExportPolicy
Provide your Prometheus configuration above to generate the Secret manifest
Provide your Prometheus configuration above to generate the ExportPolicy manifest
Step 5: Verify the configuration
Section titled “Step 5: Verify the configuration”Check that your resources were created successfully using the names you specified:
Verify the Secret:
kubectl get secret grafana-cloud-credentials
Verify the ExportPolicy:
kubectl get exportpolicy export-datum-telemetry
Step 6: View metrics in Grafana Cloud
Section titled “Step 6: View metrics in Grafana Cloud”- Return to your Grafana Cloud instance
- Navigate to Explore in the left sidebar
- Select your Prometheus data source
- Run a query like
{service_name="telemetry.miloapis.com"}
to see your metrics
Troubleshooting
Section titled “Troubleshooting”If you encounter issues:
- Check Secret encoding: Ensure username and password are correctly base64 encoded
- Verify endpoint URL: Confirm the Prometheus remote write endpoint is accessible
- Review ExportPolicy: Check that the
metricsql
selector matches your services - Check authentication: Verify your API token has write permissions for Prometheus
For additional help, consult the Grafana Cloud documentation.