Migrate from Loki and Grafana Cloud
Move log collection from Loki or Grafana Cloud Logs to your Logit.io Logs stack with Grafana Alloy. Alloy reads your files as before and exports to Logit.io over OTLP HTTP instead of the Loki push API.
Promtail reached end of life on 2 March 2026. Grafana Agent (Static mode, Flow mode and Operator) reached end of life on 1 November 2025. Neither receives security or bug fixes. This guide moves you to Alloy at the same time.
What carries over
| Loki or Grafana Cloud | Logit.io |
|---|---|
| Promtail or Grafana Agent log scraping | Convert to Grafana Alloy with alloy convert. |
loki.write or a Promtail clients entry | Replace with otelcol.exporter.otlphttp to Hosted OpenTelemetry. |
| Loki labels | Sent as OpenTelemetry log attributes. Check the field names in Discover after the first logs arrive. |
| LogQL queries, dashboards and alert rules | Rebuild in OpenSearch Dashboards and Logit.io alerts. |
| Metrics scraped by Alloy | Out of scope here. See Remote Write. |
| Logs already stored in Loki | Not moved. Keep Loki for history until it ages out. |
Before you start
- Enable Hosted OpenTelemetry on your Logs stack.
- Copy the username (
{stackId}-otel) and the Hosted OpenTelemetry API key from the stack's Endpoints page. - Install Alloy (opens in a new tab) on the host, or use the Alloy you already run.
Step 1: convert your configuration
Alloy converts Promtail and Grafana Agent Static configurations. Convert, then read the output and any diagnostics before you run it.
alloy convert --source-format=promtail --output=config.alloy promtail.yamlThe converter is best-effort. Grafana's migration guides, from Promtail (opens in a new tab) and from Grafana Agent (opens in a new tab), describe the diagnostic report and the flags for partial conversions. Grafana Agent Flow configurations use Alloy-style components, so follow Grafana's guide for those.
A converted Promtail file ends in a loki.source.file component that forwards to loki.write, like this.
loki.source.file "system" {
targets = [{
__address__ = "localhost",
__path__ = "/var/log/*.log",
job = "varlogs",
}]
forward_to = [loki.write.default.receiver]
file_match {
enabled = true
}
legacy_positions_file = "/tmp/positions.yaml"
}
loki.write "default" {
endpoint {
url = "https://<your-loki-push-url>/loki/api/v1/push"
}
}Step 2: send to Logit.io
Change forward_to so entries reach an otelcol.receiver.loki component, then add the exporter. Keep the file_match block and positions setting that the converter wrote, so Alloy finds the same files and resumes from the same place. To compare data first, keep loki.write and list both receivers in forward_to.
loki.source.file "system" {
targets = [{
__address__ = "localhost",
__path__ = "/var/log/*.log",
job = "varlogs",
}]
forward_to = [
loki.write.default.receiver,
otelcol.receiver.loki.logit.receiver,
]
file_match {
enabled = true
}
legacy_positions_file = "/tmp/positions.yaml"
}
loki.write "default" {
endpoint {
url = "https://<your-loki-push-url>/loki/api/v1/push"
basic_auth {
username = "<your-loki-username>"
password = sys.env("LOKI_PASSWORD")
}
}
}
otelcol.receiver.loki "logit" {
output {
logs = [otelcol.exporter.otlphttp.logit.input]
}
}
otelcol.auth.basic "logit" {
username = "{stackId}-otel"
password = sys.env("LOGIT_OTEL_API_KEY")
}
otelcol.exporter.otlphttp "logit" {
client {
endpoint = "https://{stackId}-otel.logit.io"
auth = otelcol.auth.basic.logit.handler
}
}- Replace
{stackId}with your Logs stack ID. Use HTTPS on the default port 443, with no custom port. - Use
otelcol.exporter.otlphttp. Hosted OpenTelemetry accepts OTLP over HTTP only, not gRPC. - Set
LOGIT_OTEL_API_KEYin the Alloy service's environment file. The Grafana Alloy page shows where. - Delete
loki.write "default"and its entry inforward_toonce you are happy with the data.
Check the file, then restart Alloy.
alloy validate config.alloy
sudo systemctl restart alloyStep 3: check the cutover
- In OpenSearch Dashboards, open Discover and check that logs arrive from each host.
- Compare daily counts for one job in Loki or Grafana Cloud and in Logit.io.
- Check how your labels appear as fields, then add a Logstash filter if you want different names.
- Rebuild the searches, dashboards and alerts your team relies on.
- Remove the Loki destination and the old credentials.
Not covered
- The Loki push API, LogQL and Grafana Cloud Logs as a query target.
- Moving existing logs out of Loki or Grafana Cloud.
If you need help planning a migration, contact support via live chat.