Migrate from Loki
This guide explains how to migrate Loki log ingestion to GreptimeDB. GreptimeDB supports the Loki push API for log ingestion, so existing Loki-compatible writers can send logs to GreptimeDB with minimal configuration changes.
The Loki-compatible endpoint in GreptimeDB is for ingestion. For querying and dashboards, use GreptimeDB SQL, full-text search, the GreptimeDB Dashboard, and the Grafana integration instead of LogQL.
Before you start the migration
Review the current Loki deployment and decide how logs should be stored in GreptimeDB:
- Identify every writer that sends logs to Loki, such as Grafana Alloy, OpenTelemetry Collector, Promtail, Fluent Bit, Vector, or custom clients.
- Plan the target GreptimeDB database and table name. If no table header is provided, GreptimeDB writes Loki logs to
loki_logs. - Review Loki stream labels. GreptimeDB stores labels as tag columns, so avoid high-cardinality labels such as request IDs, user IDs, and trace IDs.
- Decide whether raw log lines are enough or whether you need a GreptimeDB pipeline to parse log lines into structured columns.
- Plan historical migration. GreptimeDB does not import Loki chunk or index files directly; migrate historical logs by replaying from the original log sources, archives, or exported records through GreptimeDB's log ingestion APIs.
For new collector changes, Grafana Alloy is recommended. If you still run an existing Loki-compatible client, you can retarget it to GreptimeDB by changing the Loki push URL and adding GreptimeDB headers.