Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

prometheus fails to use performance counter (v1) under windows 2022 Server #658

Open
V1TA5 opened this issue Apr 24, 2024 · 2 comments
Open
Labels
bug Something isn't working

Comments

@V1TA5
Copy link

V1TA5 commented Apr 24, 2024

What's wrong?

No Metrics read on win 2022 server due to missing performance counters (V1) by default.

Steps to reproduce

  1. Install Windows 2022 Server
  2. Install Grafana alloy 1.0
  3. Configure Prometheus remote write ( see docs for sample windows config.alloy)
  4. observe Windows event log
Screenshot 2024-04-24 114710

Seems to be that server 2022 disable performance counters v1 by default in favour of v2. Prometheus seems to not use them yet and falls over. As stated in: prometheus-community/windows_exporter#1313

Applying the steps mentioned in that issue didnt help.

This makes Alloy unusable under Windows 2020 as metrics collector.

Any ideas on how to get arround this?

System information

Windows 2022 Server Eval Build 20348.587 in virtualbox 7.0.14

Software version

Grafana Alloy 1.0

Configuration

No response

Logs

See "Steps to reproduce"
@V1TA5 V1TA5 added the bug Something isn't working label Apr 24, 2024
@V1TA5
Copy link
Author

V1TA5 commented Apr 24, 2024

// For a full configuration reference, see https://grafana.com/docs/alloy
logging {
  level = "warn"
}

prometheus.exporter.windows "default" {
}

prometheus.scrape "default" {
  targets = concat(
    prometheus.exporter.windows.default.targets,
    [{
      // Self-collect metrics
      job         = "alloy",
      __address__ = "127.0.0.1:12345",
    }],
  )

  forward_to = [
  // TODO: components to forward metrics to (like prometheus.remote_write or
  // prometheus.relabel).
        prometheus.remote_write.central_prom.receiver,
  ]
}

prometheus.remote_write "central_prom" {
    endpoint {
        url = "http://prometheuishost:9090/api/v1/write"
    }
}

@jkroepke
Copy link
Contributor

jkroepke commented May 3, 2024

A potential workaround would be executing

lodctr.exe /E:Lsa
lodctr.exe /E:PerfProc
lodctr.exe /R

on install (ref: prometheus-community/windows_exporter#1313 (comment))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants