Ship your metrics to Grafana Cloud without an integration
If you want to ship your Prometheus metrics to Grafana Cloud, but there isn’t an integration available, you can either use an existing Prometheus exporter, or write one of your own, and deploy Grafana Agent to scrape your local machine or service.
Find and install an exporter.
There are many open source Prometheus exporters available on GitHub. For a list of Prometheus exporters, see Third-party exporters in the Prometheus documentation. Note that this list is not complete, and you can find additional exporters on other sites.
If you can’t find an existing exporter for your service, you can write your own. For more information, see Writing exporters in the Prometheus documentation.
Configure the Agent
You can generate the Agent binary and configuration file for your service or machine in your Grafana Cloud stack.
In your Grafana Cloud stack, click the Integrations and Connections icon (lightening bolt).
Beneath the search field, click Filter by category and select Hosted data.
Click Hosted Prometheus metrics.
Select the following options:
Choose a method for forwarding metrics: Via Grafana Agent
Select this method if you do not already have a local Prometheus instance running.
Show instructions for: Standard
Choose your platform: Select the operating system of the machine or service.
If you don’t see your binary option displayed, see Agent releases and scroll down to the Assets list to install the binary manually. For more information on installing the Grafana binary, see Install the Grafana Agent binary.
Download and install the binary for your OS
Run the displayed commands in a terminal to download and install the binary if you’ve selected one.
Set the configuration
Select Create new config to create a new configuration file. Choose this option if this is your first time deploying the Agent.
If you are creating your first Agent configuration file, you can copy the command provided in the UI, adding your job name to the
job_namefield and the URL of your machine or service to the
targetsfield . Run this command from your terminal, in the directory where you installed the Agent binary.
Select Update existing config manually to generate the settings to add to an existing configuration file.
If you are adding
remote_writeto an existing configuration file, add the content generated in the UI to the
metricssection of the file. You must also add the
scrape_configdetails for this scrape job. If you already have
remote_writeenabled, and scrape jobs running, you may only need to add the scrape job details to
The following is an example of a simple Agent configuration file with
metrics: configs: - name: integrations remote_write: - basic_auth: password: username: url: https://prometheus-blocks-prod-us-central1.grafana.net/api/prom/push scrape_configs: - job_name: sglk static_configs: - targets: ['localhost:4001'] global: scrape_interval: 60s wal_directory: /tmp/grafana-agent-wal
Save your changes and restart the agent.
Related Grafana Cloud resources
How to set up and visualize synthetic monitoring at scale with Grafana Cloud
Learn how to use Kubernetes, Grafana Loki, and Grafana Cloud’s synthetic monitoring feature to set up your infrastructure's checks in this GrafanaCONline session.
Using Grafana Cloud to drive manufacturing plant efficiency
This GrafanaCONline session tells how Grafana helps a 75-year-old manufacturing company with product quality and equipment maintenance.