docs

Loki

Query log streams from a Loki-compatible endpoint

Use the Loki integration to give a workbench read-only access to log streams stored in Grafana Loki or a Loki-compatible service. The agent queries logs with LogQL and can return individual log lines or count log volume over time.

This guide uses the Plural Console UI. For the complete list of integrations and general tool behavior, see Workbench tools.

Prerequisites

Before you begin, make sure you have:

  • A Loki endpoint that already receives the logs you want the workbench to query and is reachable from your Plural Console deployment.
  • Permission in Plural Console to create a configured tool and edit the target workbench.
  • The base URL of the Loki query API.
  • Credentials if your Loki deployment or its gateway enforces authentication: a basic auth username and password, or a bearer token or API key.
  • A tenant ID if your Loki deployment is multi-tenant.
  • An existing workbench, or permission to create one. See Setting up a workbench.

Prepare read-only access

Create a dedicated integration account or token with query access only. The tool calls only the Loki range query endpoint, GET /loki/api/v1/query_range; it never pushes logs or changes configuration. In a multi-tenant deployment, scope the credentials to the tenant and log data the workbench needs.

Capabilities

The Loki tool is read-only and provides two operations:

  • Query logs (workbench_observability_logs) — return log lines that match a LogQL query and optional label filters within a time range. Each entry includes its timestamp, line, and stream labels.
  • Aggregate logs (workbench_observability_log_aggregate) — count matching log lines in fixed time buckets, such as 5m, for trend and volume analysis.