Skip to main content

Grafana and Loki

Orbis Studio can emit structured JSON logs for ingestion by Grafana Loki.

This page demonstrates how to connect Orbis Studio to the reference Grafana stack shipped with the Orbis Studio repository. For more information, see the README.

To consume structured Orbis Studio logs with other ingestion providers, see Logs.

Prerequisites​

Configure environment variables​

  1. In the root folder of your Orbis Studio application, edit your existing .env file or create a new one.

  2. Add the following environment variables. Replace the placeholders with the values for your deployment:


    _10
    ORBISAGENTS_LOG_ENV=container
    _10
    ORBISAGENTS_LOG_LEVEL=INFO
    _10
    ORBISAGENTS_LOG_FILE=/var/log/langflow/langflow.log
    _10
    LANGFLOW_SERVICE_NAME=langflow
    _10
    LANGFLOW_VERSION=1.10.0
    _10
    LANGFLOW_ENVIRONMENT=production

    Setting ORBISAGENTS_LOG_ENV=container switches structlog's terminal processor to JSONRenderer, so every line written to stdout is a JSON object containing the event message, level, timestamp, logger name, exception structure, and service metadata. For more information, see Logs.

    The shipped Promtail configuration scrapes *.log files from a directory rather than stdout. ORBISAGENTS_LOG_FILE must point at a file inside the directory that Promtail watches. Set ORBISAGENTS_LOG_DIR to that same directory so Orbis Studio creates the file in the right place.

  3. Start the reference Loki + Promtail + Grafana stack from the repository:


    _10
    cd deploy/observability/grafana-loki
    _10
    export ORBISAGENTS_LOG_DIR=/var/log/langflow
    _10
    docker compose up -d

  4. Launch Orbis Studio with your .env file:


    _10
    uv run langflow run --env-file .env

  5. Run a flow in Orbis Studio to generate log traffic.

  6. Open Grafana at http://localhost:3000 and navigate to Dashboards > Orbis Studio Logs to view structured log output, including panels for structured tracebacks, PII redaction, stdlib library output, and service/environment/version coverage.

See also​