Skip to content

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.

This tutorial assumes you have already:

You will configure metric export by:

  1. Accessing your Grafana Cloud instance
  2. Generating Prometheus remote write configuration
  3. 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.

  1. Sign in to Grafana Cloud
  2. Navigate to your desired instance
  3. Copy your instance URL (for example: https://play.grafana.net)

Use this form to generate the Grafana Cloud connection URL:

Grafana Cloud Connection URL Generator

Connection URL (for Step 3):

  1. Click the generated connection URL above
  2. Choose whether to create a new API token or use an existing one
  3. Complete the form and submit it
  4. 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

Check that your resources were created successfully using the names you specified:

Verify the Secret:

Terminal window
kubectl get secret grafana-cloud-credentials

Verify the ExportPolicy:

Terminal window
kubectl get exportpolicy export-datum-telemetry
  1. Return to your Grafana Cloud instance
  2. Navigate to Explore in the left sidebar
  3. Select your Prometheus data source
  4. Run a query like {service_name="telemetry.miloapis.com"} to see your metrics

If you encounter issues:

  1. Check Secret encoding: Ensure username and password are correctly base64 encoded
  2. Verify endpoint URL: Confirm the Prometheus remote write endpoint is accessible
  3. Review ExportPolicy: Check that the metricsql selector matches your services
  4. Check authentication: Verify your API token has write permissions for Prometheus

For additional help, consult the Grafana Cloud documentation.