Grafana Loki Integration
Connect Grafana Loki to query your application logs with LogQL from inside TestRelic and line them up with failing tests.
The Grafana Loki integration lets you query application log data from your Loki stack inside TestRelic, so you can correlate test failures with the server-side log output that occurred while the test ran.
What this integration enables
- LogQL explorer — Query your Loki logs from inside TestRelic, in the Grafana Loki console, without switching tools.
- Test and service shortcuts — One-click queries for the logs of a specific test id or service, so you can line up a failing test with the server-side log output around it.
- Errors only — Narrow any query to error lines.
Workspace logs come from TestRelic
The log views inside the Session and API Test Workspaces (see the Cloud Platform section) show the logs TestRelic captured with the run. Loki logs are queried from the Loki console.
Connecting Grafana Loki
- Navigate to Settings → Integrations and open the Marketplace tab.
- Click Connect on the Grafana Loki card.
- Provide:
- Loki URL — The base URL of your Loki HTTP API (e.g.
https://loki.yourcompany.com), not a/loki/api/v1path — TestRelic appends the query path itself - Org ID — The tenant ID for multi-tenant Loki, sent as the
X-Scope-OrgIDheader. Single-tenant deployments can leave it at1 - Username and Password / API Key — Basic-auth credentials for your Loki endpoint
- Loki URL — The base URL of your Loki HTTP API (e.g.
- Click Test Connection, then Connect.
Loki console
Settings → Integrations → Grafana Loki → Open console lets you run any LogQL query over a Time range, with shortcuts for Errors only, By service and By test id.
Grafana Cloud Loki
If you use Grafana Cloud, take the Loki data source URL from your stack details page (it looks like https://logs-prod-XXXXX.grafana.net). Use your Grafana Cloud stack username and API key (not your Grafana account credentials) for authentication.
Reading results
The console shows matching log lines in a dense table, with the timestamp on the left and the Loki stream labels available on each line. If nothing matches, it reads "No log lines in this window" — widen the Time range or relax the query.
How logs are queried
TestRelic queries Loki using LogQL over the time window you are looking at. The query runs from TestRelic's servers — your Loki credentials are never sent to the browser.
Example LogQL query:
{app="backend", env="staging"} | logfmt | level != "debug"Jira Integration
Scope Jira issues per repository, link issues to the test cases that cover them, and quick-create Jira bugs from test failures.
Slack Integration
Ask TestRelic AI from Slack with /testrelic, DMs and @mentions, set up alerts, unfurl TestRelic links, and add TestRelic steps to Slack workflows.