Grafana Loki Integration
Connect Grafana Loki to view correlated application logs alongside your API test sessions in the TestRelic workspace.
The Grafana Loki integration brings application log data into the TestRelic session workspace, enabling you to correlate API test failures with the server-side log output that occurred during the test session.
What this integration enables
- Correlated log view — Application logs from Grafana Loki are displayed inside the API Test Workspace (see the Cloud Platform section), aligned to the test session time window.
- Log explorer — A searchable, filterable log viewer scoped to the exact time range of the test run.
- Log-to-failure correlation — Map Loki log lines to specific test case failures for root-cause analysis.
Connecting Grafana Loki
- Navigate to Settings → Integrations.
- Click Connect on the Grafana Loki card.
- Provide:
- Loki URL — The base URL of your Grafana Loki instance (e.g.
https://loki.yourcompany.com) - Authentication — Username and password, or an API key, depending on your Loki configuration
- Default log labels — Labels used to scope log queries to your application (e.g.
app=backend,env=staging)
- Loki URL — The base URL of your Grafana Loki instance (e.g.
- Click Save to verify the connection.
Grafana Cloud Loki
If you use Grafana Cloud, your Loki URL is in the format https://logs-prod-XXXXX.grafana.net. Use your Grafana Cloud stack username and API key (not your Grafana account credentials) for authentication.
Using Loki logs in the API Workspace
When the integration is connected, the Log Explorer tab in the API Test Workspace fetches log lines from Loki for the time window of the test session:
- Start time:
run.startedAt - End time:
run.completedAt(orstartedAt + duration)
Log lines are displayed in chronological order with:
- Timestamp — The log line timestamp.
- Level — Log level (info, warn, error) with color coding.
- Message — The log message content.
- Labels — Loki label set for the log line.
Filtering logs
Use the filter bar in the Log Explorer to:
- Filter by level — Show only errors, warnings, or info logs.
- Search by keyword — Filter log lines containing a specific string.
- Filter by label — Narrow to a specific service or component.
How logs are queried
TestRelic queries Loki using LogQL with a label selector based on the default labels you configured, plus a time range filter. The query is proxied through the TestRelic backend — your Loki credentials are never sent to the browser.
Example LogQL query generated:
{app="backend", env="staging"} | logfmt | level != "debug"Jira Integration
Link test failures to Jira issues, quick-create tickets from sessions, and surface Jira issue status directly in the TestRelic workspace.
Slack Integration
Run /testrelic from any Slack channel to query Ask AI, schedule recurring QA digests, and share dashboards, reports, and test plans back to your workspace.