Skip to content

Grafana Loki

JSONL execution traces can be shipped to Loki and queried with LogQL in Grafana dashboards.

Ship JSONL traces to Loki using promtail, Grafana Alloy, or any Loki-compatible agent. The simplest approach appends traces to a log file that your agent tails:

Terminal window
# In your CI pipeline, after each build:
grog traces export --format=jsonl --limit 1 >> /var/log/grog-traces.jsonl

Configure your Loki agent to tail this file with a grog label:

# promtail config snippet
scrape_configs:
- job_name: grog-traces
static_configs:
- targets: [localhost]
labels:
job: grog
__path__: /var/log/grog-traces.jsonl

With traces in Loki, use LogQL in Grafana to build dashboards:

Build duration over time:

{job="grog"} | json | line_format "{{.total_duration_millis}}"

Filter to failed builds:

{job="grog"} | json | failure_count > 0

Extract cache hit rate:

{job="grog"} | json | unwrap cache_hit_count | __error__=""