Connecting Loki to Landfall
Connect your own Grafana Loki so Beacon and every agent in the war room can read its logs during an incident. A metric shows that something broke; the log line often shows why, with a stack trace, an error message or a request id.
- As a source: Beacon and joined agents discover your labels and run LogQL. It takes a base URL, a tenant ID if your Loki runs multi-tenant, and a bearer token or a basic auth username and password if it sits behind auth.
- As a trigger: a rule in Loki's ruler opens a war room through Alertmanager, which authenticates with a per-organization webhook secret. See Opening a war room from a Loki ruler alert.
What you'll need
- A Loki server Landfall can reach. A Loki inside your own private network is usually not reachable from a hosted Landfall the way a public SaaS API is.
- Its tenant ID if it runs multi-tenant, the common case for a Loki you run yourself. Landfall sends it as X-Scope-OrgID on every request. A single-tenant Loki running with auth_enabled: false needs none.
- An admin on your Landfall organization. Only admins can list, test and save connections.
1. Check Loki on its own side
The quickest check is Loki's own API, from a machine on the same network as the server. There is no key or account to create in Loki.
curl /loki/api/v1/labels
Terminalcurl -s https://loki.example.com/loki/api/v1/labels \ -H "X-Scope-OrgID: acme" # only for a multi-tenant Loki
A working Loki answers {"status":"success","data":["app","level","namespace"]}, listing the label names it has ingested. An empty data list means Loki has no recent logs for that tenant. Fix that before you connect Landfall.
2. Add it to Landfall
Integrations → Context sources → Loki
Choose Integrations in the left menu, then the Loki tile under Context sources. Enter your server's base URL, and the tenant ID if it runs multi-tenant. Add a bearer token, or a basic auth username and password, only if your Loki needs one. When both are set, the bearer token is used.
app.landfalls.ai · Integrations · Loki
Base URL is the only required field. The token in this picture is masked. Test connection
Landfall calls your server's /loki/api/v1/labels with the tenant ID and credentials you entered, and saves nothing. It does not use /ready, which answers before Loki checks the tenant or auth at all. A good answer prints Loki reachable at https://loki.example.com, with your own base URL.
app.landfalls.ai · Integrations · Loki
Tested, not yet saved, so the Loki tile still reads Not configured. The address http://loki:3100 comes from a test setup where Loki runs on the same private network as Landfall; yours is your own server's base URL. Save integration
Save checks the server again before it stores anything. A Loki that cannot be reached, or that rejects the tenant ID or credentials, is refused and nothing is stored. Once saved, the Loki tile reads Configured.
app.landfalls.ai · Integrations · Loki
The tile and the panel read Configured. The base URL is from the same test setup as the picture above.
What it looks like
When Beacon or an agent runs queryRange over the incident's window, Landfall flattens Loki's streams into log entries, each with its stream's labels. That is the shape a Log view widget shows, so the lines can sit on the war room's canvas next to the conversation.
What Beacon can read
| Operation | What comes back |
|---|---|
| listLabels | The label names Loki holds, from /loki/api/v1/labels, so a LogQL query can target the right streams. |
| queryRange | A LogQL query over a time range, from /loki/api/v1/query_range, with an optional entry limit and direction. |
| queryInstant | A LogQL query evaluated at one instant, from /loki/api/v1/query, for example an aggregate count. The instant defaults to now. |
Every answer reaches the agent as Loki's own JSON, unchanged. These operations reach Beacon and every agent that joins the war room through get_signal_catalog and query_signals. See Integrations architecture.
Opening incidents from Loki
A rule in Loki's bundled ruler can open a war room by itself. The ruler notifies Alertmanager, and Alertmanager calls Landfall through a webhook that carries your organization's secret. The setup has its own page, Opening a war room from a Loki ruler alert. Reading logs and opening incidents are independent, so you can set up either one alone.
Troubleshooting
- A line starting Loki: credentials rejected (401/403) often means the tenant ID is missing, since a multi-tenant Loki rejects a request without one. It can also mean the token or basic auth pair was refused.
- Loki HTTP followed by a status code means the server answered with that error.
- Check the base URL is reachable from where Landfall runs, not only from your own laptop. The two are often on different networks.
- Enter the origin only, such as https://loki.example.com. Landfall adds /loki/api/v1/ itself.
- A plain http:// URL is refused. A deployment can allow it for listed organizations and address ranges (INTEGRATIONS_PRIVATE_HTTP_ORG_IDS and INTEGRATIONS_PRIVATE_HTTP_CIDRS, both empty by default). Only then does the panel show the checkbox Allow plain http to a private address (this network only). With it on, the address must resolve to 10.x, 172.16.x to 172.31.x, 192.168.x or an IPv6 unique-local address. Loopback, cloud metadata, shared (100.64.x) and public addresses always need https.
- An empty listLabels answer means Loki holds no streams for the tenant you entered. Check the Tenant ID matches the one your log shipper writes with.
- If people attached specific sources to the war room, get_signal_catalog lists only those. Attach Loki to the room, or ask someone in it to.
- A read that fails, for example after the token was revoked, reaches the agent marked as partial, so Beacon can tell a broken source from a quiet one.
A source someone uninstalled on the Marketplace tab has no tile on the Integrations tab until it is installed again.
Reference
| Field | Value |
|---|---|
| Where | Integrations → Context sources → Loki, admins only |
| Base URL | Required. Your Loki server's origin, reachable from Landfall. |
| Tenant ID (optional) | Sent as X-Scope-OrgID on every request. Needed by a multi-tenant Loki. |
| Bearer token (optional) | Sent as Authorization: Bearer. Used instead of basic auth when both are set. |
| Basic auth username (optional), Basic auth password (optional) | Used only when no bearer token is set. |
| Allow plain http to a private address (this network only) | Shown only where the deployment allows it for your organization. Off by default. |
| Scopes / capabilities | telemetry |
| Access | Read-only. Landfall sends GET requests under /loki/api/v1/ and writes nothing to Loki. |
| Secrets | The bearer token and password are kept in Landfall's secret store, apart from the rest of the config, and never shown again. |
| Revoke | Revoke the token where it was issued and reads fail from then on. The panel has no remove control; an admin removes the connection with DELETE /o/<your-org>/integrations/loki/connections/<connection id>. GET on the same /connections path lists the ids. |
| Trigger endpoint | POST https://api.landfalls.ai/triggers/alertmanager, called by Alertmanager. See Opening incidents from Loki. |