Skip to content

Logging

Runway application logs are available in Grafana via ClickHouse. This guide explains how to access, query, and filter logs for your Runway services.

Runway collects everything your service writes to standard output and standard error. To make your logs searchable, write them as structured JSON, one object per line.

Services written in Go or Rust should use the Labkit logger, which does the right thing by default.

Use the logger from Labkit. It writes JSON-formatted logs to standard error, at level INFO and above.

import "gitlab.com/gitlab-org/labkit/v2/log"
logger := log.New()
logger.Info("request completed", "status", 200, "duration_ms", 42)

You can change the defaults with the GITLAB_LOG_LEVEL (DEBUG, INFO, WARN, ERROR) and GITLAB_LOG_FORMAT (json, text) environment variables. Keep the json format in Runway; text is meant for reading logs in a local terminal.

Benefits of structured logging:

  • Fields are automatically extracted into Attributes
  • Enables filtering and aggregation on fields
  • Severity is extracted from level, severity, or similar fields

Logs are accessible through Grafana’s Explore interface:

  1. Go to Grafana Explore
  2. Select the ClickHouse - Runway Production datasource
  3. Choose the observability database and the otel_logs table
  4. Choose logs as the query type
  5. Add filters for your service

Direct link: Grafana Explore with ClickHouse

Grafana Logs Explore interface showing ClickHouse logs

Runway logs are stored in the observability.otel_logs table with the following key fields:

Field Description Example
TimestampTime Log timestamp 2026-02-13T19:47:30.047238Z
ServiceName Runway service ID; on EKS, suffixed with the environment (details) my-service-cloudrun, my-service-eks-production
SeverityText Log level info, error, warn
Body Log message content {Request completed successfully}
Attributes[cloud.runtime] Runtime of the service (gcp_cloud_run, gke or eks) gcp_cloud_run
Attributes[cloud.provider] Cloud provider for the service (gcp or aws) gcp
Attributes[cloud.region] Region of the service us-east1

When you add a filter in Grafana, the field list offers several attribute maps: ResourceAttributes, ScopeAttributes, LogAttributes, and Attributes without a prefix. Attributes is a merged view of the other three. Use Attributes unless you specifically need to filter by one attribute type. All examples on this page use Attributes.

For Kubernetes workloads (EKS and GKE), additional metadata is automatically added:

Attribute Description Example
k8s.cluster.name Cluster name runway-eks-prd-us-east-1
k8s.container.name Container name app
k8s.container.restart_count Container restart count 0
k8s.deployment.name Deployment name glgo-eks
k8s.namespace.name Namespace glgo-eks
k8s.node.name Node name/ID i-0d7404c91b2247fa0
k8s.pod.name Pod name glgo-eks-9849f4bb9-lx5p6
k8s.pod.start_time Pod start timestamp 2026-02-13T17:51:41Z
k8s.pod.uid Pod unique identifier 98d3c9d8-0d01-4b1d-b392-221143422444
SELECT
TimestampTime,
SeverityText,
Body,
Attributes
FROM observability.otel_logs
WHERE ServiceName = 'duo-workflow-svc-eks-production'
AND TimestampTime >= now() - INTERVAL 1 HOUR
ORDER BY TimestampTime DESC
LIMIT 100

Cloud Run logs don’t have an environment attribute yet. As a workaround, filter by the GCP project the service runs in: gitlab-runway-production or gitlab-runway-staging.

Production:

WHERE Attributes['gcp.project_id'] = 'gitlab-runway-production'

Staging:

WHERE Attributes['gcp.project_id'] = 'gitlab-runway-staging'

On GKE, a service has one ServiceName for all environments: its Runway service ID, for example example-service-gke. Filter by the environment attribute to tell production and staging apart.

Production:

WHERE ServiceName = 'example-service-gke'
AND Attributes['environment'] = 'production'

Staging:

WHERE ServiceName = 'example-service-gke'
AND Attributes['environment'] = 'staging'

On EKS, the environment is appended to the Runway service ID to form the ServiceName. For example, the service example-service-eks logs as example-service-eks-production in production and as example-service-eks-staging in staging.

Production:

WHERE ServiceName = 'example-service-eks-production'

Staging:

WHERE ServiceName = 'example-service-eks-staging'
WHERE SeverityText = 'error'
WHERE Body LIKE '%error%'
WHERE Attributes['cloud.provider'] = 'gcp' AND Attributes['cloud.runtime'] = 'gcp_cloud_run'
SELECT
TimestampTime,
SeverityText,
Body,
Attributes['correlation_id'] as correlation_id
FROM observability.otel_logs
WHERE ServiceName = 'my-service-cloudrun'
AND SeverityText = 'error'
AND Attributes['gcp.project_id'] = 'gitlab-runway-production'
AND TimestampTime >= $__fromTime
AND TimestampTime <= $__toTime
ORDER BY TimestampTime DESC
LIMIT 100
SELECT
TimestampTime,
SeverityText,
Body
FROM observability.otel_logs
WHERE Attributes['correlation_id'] = 'your-correlation-id'
AND TimestampTime >= now() - INTERVAL 1 DAY
ORDER BY TimestampTime ASC

Runway collects logs from both Cloud Run and Kubernetes (EKS and GKE) workloads using OpenTelemetry. For Kubernetes the setup looks like:

flowchart TD
    app["Your Application<br/>(stdout/stderr)"]
    agent["OpenTelemetry<br/>Agent Collector"]
    gateway["OpenTelemetry<br/>Gateway Collector"]
    pubsub["Google Cloud<br/>Pub/Sub"]
    clickhouse["ClickHouse<br/>(observability DB)"]
    grafana["Grafana - ClickHouse Data Source<br/>dashboards.gitlab.net"]

    app --> agent
    agent -- "Adds K8s metadata, severity, etc" --> gateway
    gateway --> pubsub
    pubsub --> clickhouse
    clickhouse --> grafana

The OpenTelemetry collectors automatically:

  • Collect container logs from all Runway workloads
  • Parse JSON-formatted logs and extract fields into log attributes
  • Add Kubernetes metadata (pod name, namespace, deployment)
  • Infer log severity and add it as a label
  • Add cluster and environment context to the logs

For Cloud Run, the setup is simpler. The logs are automatically gathered by GCP observability, and then are routed to a Pub/Sub queue using a GCP log sink.

For questions about logging infrastructure, contact the Observability team in #g_observability.

For Runway-specific logging issues, contact the Runway team in #f_runway.