LandfallDocs
Integrations · Context sources

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.
Loki
Base URL, optional tenant ID and auth
→
Landfall
Integrations · Context sources
→
War room
Beacon and joined agents query it

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.

  1. curl /loki/api/v1/labels

    Terminal
    curl -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

  1. 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
    Landfall's Loki panel, Not configured, with Base URL https://loki.example.com, Tenant ID acme, a bearer token shown as dots and empty basic auth fields.
    Base URL is the only required field. The token in this picture is masked.
  2. 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
    Landfall's Integrations page scrolled to the Loki panel after Test connection, with a green connected mark and the line Loki reachable at http://loki:3100, while the Loki tile still reads Not configured.
    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.
  3. 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
    Landfall's Integrations page with the Loki tile and the Loki panel both reading Configured, and Base URL http://loki:3100 in the panel.
    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

OperationWhat comes back
listLabelsThe label names Loki holds, from /loki/api/v1/labels, so a LogQL query can target the right streams.
queryRangeA LogQL query over a time range, from /loki/api/v1/query_range, with an optional entry limit and direction.
queryInstantA 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

Test connection failed?
  • 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.
Connected, but Beacon finds nothing?
  • 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.
No Loki tile?

A source someone uninstalled on the Marketplace tab has no tile on the Integrations tab until it is installed again.

Reference

FieldValue
WhereIntegrations → Context sources → Loki, admins only
Base URLRequired. 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 / capabilitiestelemetry
AccessRead-only. Landfall sends GET requests under /loki/api/v1/ and writes nothing to Loki.
SecretsThe bearer token and password are kept in Landfall's secret store, apart from the rest of the config, and never shown again.
RevokeRevoke 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 endpointPOST https://api.landfalls.ai/triggers/alertmanager, called by Alertmanager. See Opening incidents from Loki.