liveBook · Manning

Grafana

As explained in Spring AI in Action

Grafana is an open-source platform for querying, visualizing, and alerting on data from monitoring and observability systems.

Grafana is an open-source platform for turning application metrics into interactive dashboards, graphs, and gauges. It provides a unified view of application health, performance, and activity by querying sources such as Prometheus. section 9.3

A practical Grafana setup for a Spring AI application follows these steps:

  • Start a Grafana server alongside the application, Qdrant, and Prometheus with Docker Compose. section 9.3
  • Open Grafana at http://localhost:3000 and sign in with the initial admin credentials. section 9.3
  • Add Prometheus as a data source and configure the Prometheus server URL. section 9.3
  • Submit requests to the application so metrics exist before creating dashboard panels and time-series graphs. section 9.3
services:

  # ...

  grafana:
    image: grafana/grafana
    container_name: grafana
    restart: unless-stopped
    ports:
      - '3000:3000'
    volumes:
      - grafana-storage:/var/lib/grafana
    networks:
      - net

# ...

volumes:
  # ...
  grafana-storage: {}

Use the Docker Compose service definition to run Grafana on port 3000 with persistent storage and the shared application network. section 9.3

How Spring AI in Action covers it

How deep it goes
Explains server startup, login, Prometheus connection, metric preparation, and dashboard construction.
Examples
Uses Spring AI metric panels, time-series graphs, and a dashboard displaying client operations.
What it assumes
Assumes Prometheus already scrapes application metrics and Docker Compose can start the supporting services.
What you can do after
Operate/configure Grafana to connect Prometheus and visualize metrics from a running Spring AI application.
How it connects
Connects Grafana with Prometheus, Micrometer, Spring AI metrics, Actuator, Docker Compose, and tracing tools.

Also explained in

Compare how 9 books explain Grafana →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Spring AI in Action. The section links point to the parts of the book it draws on.