Send Metrics to Grafana Cloud
Question
How to Collect your own Premetheus exporter metrics to Grafana Cloud with Grafana agent?
Install Grafana Agent
sudo mkdir -p /etc/apt/keyrings/
wget -q -O - https://apt.grafana.com/gpg.key | gpg --dearmor | sudo tee /etc/apt/keyrings/grafana.gpg > /dev/null
echo "deb [signed-by=/etc/apt/keyrings/grafana.gpg] https://apt.grafana.com stable main" | sudo tee /etc/apt/sources.list.d/grafana.list
sudo apt-get update
sudo apt-get install grafana-agent
add scrape_configs
Assume you have grafana agent installed on your server and your own Premetheus exporter run on 127.0.0.1:5000/metrics
, edit /etc/grafana-agent.yaml
and add the following configs after scrape_configs
scrape_configs:
- job_name: 'My-Own-Metrics'
static_configs:
- targets: ['127.0.0.1:5000']
Then restart grafana agent, you’ll see your own metrics in grafana cloud.
sudo systemctl status grafana-agent.service
Reference
https://grafana.com/docs/agent/latest/static/set-up/install/install-agent-linux/
https://prometheus.io/docs/prometheus/2.34/configuration/configuration/#scrape_config