Docs

Grafana Integration

Learn how to export Observability Kit metrics, traces, and logs to a Grafana stack.

Grafana is an observability stack with support for metrics, traces, and logs, viewed together in a single tool. A typical stack pairs Grafana with Prometheus for metrics, Tempo for traces, and Loki for logs. It can be self-hosted or used as the managed Grafana Cloud service.

This page covers the application-side configuration — getting the kit’s telemetry into those backing stores. For standing up the stores themselves, follow the Grafana documentation; Grafana Cloud also exposes a single OTLP gateway that accepts both metrics and traces.

Configure the Application

Add Actuator and the Prometheus registry for metrics, and a tracing bridge with an OTLP exporter for traces:

Source code
pom.xml
<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
    <groupId>io.micrometer</groupId>
    <artifactId>micrometer-registry-prometheus</artifactId>
</dependency>
<dependency>
    <groupId>io.micrometer</groupId>
    <artifactId>micrometer-tracing-bridge-otel</artifactId>
</dependency>
<dependency>
    <groupId>io.opentelemetry</groupId>
    <artifactId>opentelemetry-exporter-otlp</artifactId>
</dependency>
Source code
application.properties
spring.application.name=vaadin

# Metrics: scraped by Prometheus from Actuator
management.endpoints.web.exposure.include=prometheus

# Traces: pushed to Tempo over OTLP
management.otlp.tracing.endpoint=http://localhost:4318/v1/traces
management.tracing.sampling.probability=1.0

Point management.otlp.tracing.endpoint at your Tempo (or collector) OTLP endpoint, and configure Prometheus to scrape the application at /actuator/prometheus — see the Prometheus page.

Logs reach Loki through your logging pipeline rather than the kit; see the Loki documentation for the available options.

Viewing Data

Data is explored through Grafana’s Explore view, selecting the data source for each signal. See the Grafana documentation for details.

Viewing Traces

Open the Explore view and select Tempo as the data source. Change the Query type to Search, select your service name from the Service name menu, then click the refresh button in the top-right to search for traces.

Use the Tags option to filter for specific span attributes. For example, to find traces that contain errors, filter on outcome=error.

Clicking a trace ID brings up a side panel with detailed information about the trace, such as its nested spans and their attributes.

Viewing Metrics

Open the Explore view and select Prometheus as the data source. Select a metric from the Metric drop-down — for example vaadin_sessions_active — then click the refresh button in the top-right to display it.

Viewing Logs

Open the Explore view and select Loki as the data source. Under Labels, configure a label for service_name with your application’s service name, then click the refresh button in the top-right to search for logs.

Updated