[[spring-cloud-data-flow-samples-micrometer-prometheus-overview]]
:sectnums:
:docs_dir: ../..

=== SCDF metrics with Prometheus and Grafana

In this demonstration, you will learn how to monitor your http://cloud.spring.io/spring-cloud-dataflow/[Spring Cloud Data Flow] Streams using  http://prometheus.io[Prometheus] and https://grafana.com/grafana[Grafana].

Starting with 2.0, Data Flow provides built-in support for monitoring with Prometheus.
Following the reference manual instructions for how to get started with Prometheus:

* http://docs.spring.io/spring-cloud-dataflow/docs/2.0.0.BUILD-SNAPSHOT/reference/htmlsingle/#streams-monitoring-local-prometheus[Prometheus with SCDF-Local]
* http://docs.spring.io/spring-cloud-dataflow/docs/2.0.0.BUILD-SNAPSHOT/reference/htmlsingle/#streams-monitoring-kubernetes-prometheus[Prometheus with SCDF-Kubernetes]

Following diagram (Fig.4) illustrates the metrics collection flows for monitoring with prometheus on a Local SCDF platform:

image::scdf-micrometer-prometheus-grafana-architecture.png[title="SCDF metrics analyzis with Prometheus and Grafana", scaledwidth="50%"]

Out of the box, SCSt sends https://docs.spring.io/spring-boot/docs/2.0.1.RELEASE/reference/htmlsingle/#production-ready-metrics-meter[core metrics] such as `CPU`, `Memory`, `MVC` and `Health` to name some. Among those the https://docs.spring.io/spring-integration/docs/current/reference/html/system-management-chapter.html#micrometer-integration[Spring Integration metrics] allows computing the `Rate` and the `Latency` of the messages in the SCDF streams.

Once you deploy the stream you should see dashboards similar to these.

image:https://raw.githubusercontent.com/spring-cloud/spring-cloud-dataflow/master/spring-cloud-dataflow-docs/src/main/asciidoc/images/grafana-prometheus-scdf-applications-dashboard.png[SCDF Prometheus Dashboard]
