Important: This documentation is about an older version. It's relevant only to the release noted, many of the features and functions have been updated or replaced. Please view the current version.
Install Grafana Agent on Windows
Install Grafana Agent and get it up and running on Windows.
Navigate to Releases.
This page includes instructions for downloading static binaries that are published with every release. These releases contain the plain binary alongside system packages for Windows, Red Hat, and Debian Linux.
Scroll down to the Assets section.
You can also download the
grafana-agent-installer.exeasset directly from https://github.com/grafana/agent/releases/latest/download/grafana-agent-installer.exe.
Grafana Agent is installed into the default directory
C:\Program Files\Grafana Agent. The windows_exporter integration can be enabled with all default windows_exporter options.
Check you can access
(Optional): You can adjust
C:\Program Files\Grafana Agent\agent-config.yamlto meet your specific needs. After changing the configuration file, restart the Grafana Agent service to load changes to the configuration.
Existing configuration files are kept when re-installing or upgrading the Grafana Agent.
You can install Grafana Agent using silent installation as follows.
Enter the following in your command line.
grafana-agent-installer.exe /S /EnableExporter true /Username xyz /Password password /Url "http://example.com"
Set EnableExporter to enable Windows Exporter. The default is
Enter a Username, Password, and URL to set the global remote_write configuration.
You do not need to set username, password, and URL if you are not using remote_write.
If you are using powershell, use triple quotes
"""http://example.com""" around the URL parameter around the url parameter.
A configuration file for the Grafana Agent is provided by default at
C:\Program Files\Grafana Agent. Depending on your configuration, you can modify the default permissions of the file or move it to another directory.
If you change the location of the configuration file, ensure you complete the following steps.
- Update the Grafana Agent service to load the new path.
- Run the following in an elevated prompt, replacing
<new_path>with the full path holding
sc config "Grafana Agent" binpath= "<installed_directory>\agent-windows-amd64.exe -config.file=\"<new_path>\agent-config.yaml\""
Uninstall Grafana Agent
If you installed Grafana Agent using the Windows installer, you can uninstall it using Windows’ Remove Programs or
C:\Program Files\Grafana Agent\uninstaller.exe.
Uninstalling Grafana Agent will stop the service and remove it from disk. This includes any configuration files in the installation directory.
Grafana Agent can also be silently uninstalled by executing
uninstall.exe /S while running as Administrator.
When Grafana Agent runs as a Windows Service, it writes logs to Windows Event Logs. When running as executable, Grafana Agent will write to standard out. The logs will be written with the event source name of
Pushing Windows logs to Grafana Loki
Grafana Agent can use the embedded promtail to push Windows Event Logs to Grafana Loki. Example configuration below:
server: log_level: debug logs: # Choose a directory to save the last read position of log files at. # This directory will be created if it doesn't already exist. positions_directory: "C:\\path\\to\\directory" configs: - name: windows # Loki endpoint to push logs to clients: - url: https://example.com scrape_configs: - job_name: windows windows_events: # Note the directory structure must already exist but the file will be created on demand bookmark_path: "C:\\path\\to\\bookmark\\directory\\bookmark.xml" use_incoming_timestamp: false eventlog_name: "Application" # Filter for logs xpath_query: '*' labels: job: windows
Additional windows_events configuration details can be found here.