Grafana-Prometheus architecture

Hello everyone, I’m a big confused about the architecture. There’s a data flow diagram here: https://grafana.com/docs/grafana-cloud/metrics/prometheus/

Which seems like you install Prometheus in your network somewhere and let it talk to Grafana Cloud. But how does Grafana Cloud Agent come into it? Does it simply replace Prometheus on that diagram?

Yeah, Cloud Agent can replace Prometheus in that diagram if you choose to use it for sending the metrics to Grafana Cloud.

Ok so to summarize:

  1. I add code in all my apps to call metric.inc() lines
  2. Create a single (?) Cloud Agent, and configure it with the instance IPs of the metric servers, and a remote_write section in the configs pointing at my Grafana Cloud instance with API key
  3. Set up the charts in Grafana Cloud

Yup, that’s pretty much it. If you’re running a k8s cluster, you can follow this guide here - https://github.com/grafana/agent/blob/master/docs/getting-started.md#kubernetes-install-script.

Thanks, I’m not using k8s for this project

The readme for the agent says a lot of stuff about scalability. Is the intention that you can run several agents?

Yes, running several instances of an agent is expected. There are a couple different modes for sharding the load, check out the https://github.com/grafana/agent/blob/master/docs/operation-guide.md.