grafana / alloy

OpenTelemetry Collector distribution with programmable pipelines
https://grafana.com/oss/alloy
Apache License 2.0
1.35k stars 190 forks source link

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

Open V1TA5 opened 5 months ago

V1TA5 commented 5 months ago

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: https://github.com/prometheus-community/windows_exporter/issues/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 commented 5 months ago
// 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 commented 5 months ago

A potential workaround would be executing

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

on install (ref: https://github.com/prometheus-community/windows_exporter/issues/1313#issuecomment-1776794436)