Grafana Overview
Learning Objectives
- Explain Grafana's role as a pure visualisation layer in xScaler
- Describe how Grafana datasources connect to xScaler backends
- Understand the difference between platform-metrics and xMetrics datasources
- Read the pre-provisioned datasource YAML from the repository
Grafana in the xScaler Architecture
Grafana is a visualisation and alerting layer — it does not store data. It queries the xScaler backends via datasource plugins and renders dashboards.
Grafana's role:
- Dashboard creation and display
- Alert rule evaluation and routing
- Cross-signal correlation (trace → log → metric)
- User access control (RBAC)
Grafana does NOT do:
- Store any metrics, logs, or traces
- Ingest or collect telemetry
- Manage tenants or API keys (use portal-api for this)
Datasource Model
Each xScaler signal requires its own Grafana datasource:
| Signal | Datasource Type | URL | Auth Headers |
|---|---|---|---|
| Metrics | Prometheus | https://euw1-01.m.xscalerlabs.com/prometheus | Authorization: Bearer xag_... + X-Scope-OrgID |
| Logs | xLogs | https://euw1-01.l.xscalerlabs.com | Authorization: Bearer xag_... + X-Scope-OrgID |
| Traces | xTraces | https://euw1-01.t.xscalerlabs.com | Authorization: Bearer xag_... + X-Scope-OrgID |
System vs Client Datasources
The local dev Grafana has four pre-provisioned datasources:
# deploy/observability/grafana/provisioning/datasources/datasource.yml
datasources:
- name: platform-metrics
type: prometheus
url: http://platform-metrics:9010/prometheus
jsonData:
httpHeaderName1: X-Scope-OrgID
secureJsonData:
httpHeaderValue1: system-monitoring
# Used by: xScaler platform operators
# Shows: xMetrics internals, Envoy stats, proxy-auth metrics
- name: xMetrics
type: prometheus
url: http://xMetrics:9009/prometheus
jsonData:
httpHeaderName1: X-Scope-OrgID
secureJsonData:
httpHeaderValue1: <your-tenant-id>
# Used by: tenant users
# Shows: their own application metrics
- name: xLogs
type: loki
url: http://xLogs:3100
jsonData:
httpHeaderName1: X-Scope-OrgID
secureJsonData:
httpHeaderValue1: <your-tenant-id>
- name: tempo
type: tempo
url: http://tempo:3200
jsonData:
httpHeaderName1: X-Scope-OrgID
secureJsonData:
httpHeaderValue1: <your-tenant-id>
In the local dev stack, Envoy is not in the path for Grafana queries — Grafana connects directly to xMetrics/xLogs/xTraces. In production, Grafana queries go through Envoy and require Authorization: Bearer xag_....
Cross-Signal Correlation
One of Grafana's most powerful features is correlating the three signals:
Trace-to-Logs Configuration
# xTraces datasource
jsonData:
tracesToLogs:
datasourceUid: xscaler-logs
filterByTraceID: true
filterBySpanID: false
tags: ["service.name", "deployment.environment"]
Trace-to-Metrics Configuration
# xTraces datasource
jsonData:
tracesToMetrics:
datasourceUid: xscaler-metrics
tags: [{key: "service.name", value: "service"}]
queries:
- name: Error rate
query: sum(rate(http_errors_total{$__tags}[5m]))
Hands-On Exercise
Exercise 5.1 — Explore Pre-Provisioned Datasources
- Open Grafana at
https://<slug>.g.xscalerlabs.com - Navigate to Connections → Data Sources
[Screenshot: Grafana datasources list showing platform-metrics, xMetrics, xLogs, and tempo with green status indicators]
- Click on
xMetrics→ Save & Test
Expected result: "Data source connected and labels found."
- Click on
tempo→ Save & Test
Expected result: "Data source successfully connected."
Exercise 5.2 — Run Cross-Signal Query
- Open Explore
- Select
xTracesdatasource - Search for recent traces: click Search tab → Run Query
- Click on a trace to open the trace view
- Click Logs for this span to see related logs
[Screenshot: xTraces trace view with spans expanded, showing "Logs for this span" button]
Validation
- All four datasources show green status
- PromQL
upreturns results inxMetrics - LogQL
{service=~".+"}returns log streams inxLogs - xTraces search returns at least one trace
- Clicking a trace span shows the "Logs" button
Key Takeaways
- Grafana is a pure visualisation layer — no data storage, no ingestion
- Each signal (metrics, logs, traces) requires its own datasource configuration
platform-metrics= platform observability (for xScaler operators)xMetrics/loki/tempo= tenant data (for tenant users)- Cross-signal correlation links traces → logs → metrics via
trace_idandservice.name
← Previous: Session 5 Overview
Next: Deployment Options →