|
| 1 | +--- |
| 2 | +title: "Migrate to Grafana Alloy" |
| 3 | +linkTitle: "Migrate to Grafana Alloy" |
| 4 | +description: "The steps to Migrate Promtail to Grafana Alloy." |
| 5 | +weight: 2 |
| 6 | +--- |
| 7 | + |
| 8 | +# {{% param title %}} |
| 9 | + |
| 10 | +This guide describes how to migrate from a Promtail Installation to Grafana Alloy. |
| 11 | + |
| 12 | +## Perform Migration |
| 13 | + |
| 14 | +{{% alert title="Note" %}} |
| 15 | +These steps will need to be performed on all application servers that host a Promtail service. |
| 16 | +{{% / alert %}} |
| 17 | + |
| 18 | +1. Log in to the application server. |
| 19 | +1. Run Windows PowerShell as Administrator. |
| 20 | +1. Change the directory to the folder where Promtail is running from, e.g. `cd C:\ProgramData\Cortex\Observability\Promtail`. |
| 21 | +1. Remove the current Promtail installation by executing the following command: |
| 22 | + |
| 23 | + ``` powershell |
| 24 | + .\Remove-Promtail.ps1 |
| 25 | + ``` |
| 26 | +
|
| 27 | +1. Click *Yes* when prompted for confirmation that you wish to remove the service. |
| 28 | +1. Click *OK* when the successful removal of the Promtail service is confirmed. |
| 29 | +1. Open a File Explorer and navigate to the folder where Promtail was running from, e.g. `C:\ProgramData\Cortex\Observability\Promtail` |
| 30 | +1. In File Explorer, navigate to the extracted alloy-installer-windows-amd64.exe folder created as part of [Make Artefacts Available][]. |
| 31 | +1. Copy the alloy-installer-windows-amd64.exe into a suitable location, e.g. `C:\ProgramData\Cortex\Observability\Grafana Alloy`. |
| 32 | +1. In File Explorer, navigate to the extracted Grafana.Alloy.Install folder created as part of [Make Artefacts Available][]. |
| 33 | +1. Copy the contents of the folder to the same location as the previously copied alloy-installer-windows-amd64.exe. |
| 34 | +1. In Powershell change the location to the folder that the artefacts have been copied to, e.g. `cd C:\ProgramData\Cortex\Observability\Grafana Alloy`. |
| 35 | +1. Install Grafana Alloy by executing the following command and passing in the correct path for the `promtail-local-config.yaml`: |
| 36 | +
|
| 37 | + ``` powershell |
| 38 | + .\Migrate-Promtail-To-Alloy.ps1 -PromtailConfig "C:\ProgramData\Cortex\Observability\Promtail\promtail-local-config.yaml" |
| 39 | + ``` |
| 40 | +
|
| 41 | +1. When prompted, enter the credentials that the Grafana Alloy Service should run as. |
| 42 | +1. When prompted to enter the bearer token, leave it blank and press Enter. |
| 43 | +1. Once the migration has completed, delete the now obsolete Promtail directory e.g. `C:\ProgramData\Cortex\Observability\Promtail`. |
| 44 | +
|
| 45 | +## Configure Grafana Alloy |
| 46 | +
|
| 47 | +1. Open the `config.alloy` configuration file, which is located in the folder alongside the `alloy-installer-windows-amd64.exe` file. |
| 48 | +1. Delete the line containing `bearer_token_file` in the `loki.write "default"` > `endpoint` section, which can be found at the end of the file. |
| 49 | +1. Save the file. |
| 50 | +1. Open `services.msc`. |
| 51 | +1. Locate the `Alloy` service. |
| 52 | +1. Right click on the service name and select `Restart`. If the service is not already running, select `Start`. |
| 53 | +
|
| 54 | +## Next Steps? |
| 55 | +
|
| 56 | +1. [Try it out][] |
| 57 | +
|
| 58 | +[Make Artefacts Available]: {{< url path="Cortex.Guides.UpgradeGuides.UpgradeObservability.3.0.0to4.0.0.Cloud.Grafana.MakeArtefactsAvailable" >}} |
| 59 | +[Try it out]: {{< url path="Cortex.Guides.UpgradeGuides.UpgradeObservability.3.0.0to4.0.0.Cloud.Grafana.TryItOut" >}} |
0 commit comments