Configure Grafana Alloy to use the Linux server integration

After you’ve installed Grafana Alloy, the next step is to configure it for the Linux Server integration. This configuration process requires you to copy a code snippet from Grafana Cloud and add it to the Alloy configuration file.

Did you know?

By default, the integration only collects the metrics and logs necessary to populate the Linux server dashboards and alerts. Although you have the option to configure Alloy to collect all available metrics and logs, we recommend starting with the default configuration.

To configure Alloy to use the Linux server integration:

  1. In Grafana Cloud, under the Set up Grafana Alloy to use the Linux server integration section, click Copy to clipboard.

    Shows the snippet to copy from Grafana Cloud to the Alloy configuration file

  2. On your Linux machine, run the following command to open the Alloy configuration file:

    sudo nano /etc/alloy/config.alloy

  3. Scroll to the end of the configuration file and paste the code snippet you copied from Grafana Cloud.

  4. Press Ctrl+O to write the changes to the file.

  5. Press Enter to save the changes.

  6. Press Ctrl+X to exit the editor.

In the next step of your journey, you’ll restart Alloy and test the configuration.

Were you successful?

To move forward, please let us know if you were successful.

More to explore (optional)

At this point in your journey, you can explore the following paths:

Configure Grafana Alloy to collect all metrics and logs (advanced)

Configure Grafana Alloy

Logs and relabeling basics in Grafana Alloy (tutorial)