Unable to connect my grafana agent (windows) to grafana cloud

Hi, I am a newbie in grafana, actually I am trying to use grafana cloud to monitor my on premises windows server.

However, after I installed the grafana agent and put in my API key (as attached), I am still unable to connect to the grafana cloud by using my grafana agent.

I am not sure if my current apprach is correct as I am a newbie, but if it wasn’t, please let me know, thanks so much. :slight_smile:

  • What Grafana version and what operating system are you using?
    Grafana cloud

  • What are you trying to achieve?
    connect my grafana agent (windows) to grafana cloud

  • How are you trying to achieve it?
    using agent-config.yaml file

  • What happened?
    after generated the API key and put it in my agent-config.yaml file, couldn’t connect to grafana cloud

  • What did you expect to happen?

  • Can you copy/paste the configuration(s) that you are having problems with?

  • Did you receive any errors in the Grafana UI or in related logs? If so, please tell us exactly what they were.

  • Did you follow any online instructions? If so, what is the URL?

Hello! Did you install the Grafana Agent for Windows through the Grafana Cloud Integrations Walkthrough? This should produce a functional agent-config.yaml with minimal editing required. There several ways to install the agent though, and comparing my config with yours I see that you list “prometheus_remote_write” while mine has only “remote_write” (see below)

server:
  http_listen_port: 12345
prometheus:
  wal_directory: C:\ProgramData\grafana-agent-wal
  global:
    scrape_interval: 15s
    remote_write:
    - basic_auth:
        password: removed
        username: removed
      url: varies by region, check url provided in cloud portal
  configs:
    - name: integrations
integrations:
  windows_exporter:
    enabled: true

I would recommend saving a copy of your current agent-config.yaml and then going through the Integration Walkthrough, confirm that the username is the correct Grafana Cloud stack ID (view details in cloud portal) and go from there. If you still do not see any metrics coming in, contact the Support team for further assistance!

Windows flash integration does not produce an agent-config.yml example. I think it should for the PRO version at least…

If the Windows Exporter Integration is installed by following the Integrations and Connections walkthrough in your Grafana Cloud account, the Grafana Agent configuration YAML file should be located in C: \ Program Files \ Grafana Agent \ agent-config.yaml by default. This behavior should function the same for all Grafana Cloud plans (Free, Pro, Advanced).

The configuration file had a few updates since my last post, but you can use the example below for current version of the integration (v0.24.2). Ensure that you have already installed the Grafana Agent before editing the existing agent-config.yaml, as new installs overwrite the existing configuration file:

server:
  http_listen_port: 12345
metrics:
  wal_directory: C:\ProgramData\grafana-agent-wal
  global:
    scrape_interval: 1m
    remote_write:
    - basic_auth:
        password: $api_token
        username: $instance_ID
      url: $hosted_prometheus_url
  configs:
    - name: integrations
integrations:
  windows_exporter:
    enabled: true

Replace $api_token with the API key generated during the Integrations and Connections walkthrough, or by generating a Grafana Cloud API key through your account portal.

Replace $instance_ID with your hosted Prometheus instance ID, found in the Prometheus Details section in your account portal.

Replace the $hosted_prometheus_url with your hosted Prometheus remote_write URL also found in the Prometheus Details section in your account portal.

If you run into any trouble with these steps, please open a Support ticket from your account portal.

I got metrics from windows exporter and I also need total metrics from grafana agent that I installed on windows vm… so should i add a config called agent. I added below may I know the right way to add
configs:

  • name: agent
    scrape_configs:
  • job_name: agent
    static_configs:
  • targets: [‘12X.X.X.X:12345’]

Hi @canvesh1023! When you say:

total metrics from grafana agent

are you interested in monitoring the Grafana Agent service itself? If so, I believe there is a guide for that here:
- Monitoring the Grafana Agent

This topic was automatically closed after 365 days. New replies are no longer allowed.