Skip to content

Add Windows PerfMon / PDH source for arbitrary performance counters #25314

@iMithrellas

Description

@iMithrellas

A note for the community

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Use Cases

Vector can collect generic Windows host/process metrics through host_metrics, but it does not currently have a source for scraping arbitrary Windows Performance Monitor / PDH counters.

This leaves a gap for Windows application metrics exposed through PerfMon, for example IIS and SQL Server counters:

  • IIS: \Web Service(_Total)\Current Connections
  • IIS: \Web Service(*)\Bytes Sent/sec
  • IIS: \Web Service(*)\Bytes Received/sec
  • IIS: \Web Service(*)\Get Requests/sec
  • SQL Server default instance: \SQLServer:SQL Statistics\Batch Requests/sec
  • SQL Server default instance: \SQLServer:Buffer Manager\Page life expectancy
  • SQL Server named instance: \MSSQL$INSTANCE:SQL Statistics\Batch Requests/sec
  • SQL Server named instance: \MSSQL$INSTANCE:Buffer Manager\Page life expectancy

Today this usually requires running another agent such as Telegraf or windows_exporter alongside Vector, then forwarding/scraping those metrics.

Attempted Solutions

No response

Proposal

Add a Windows-only source for arbitrary PerfMon / PDH counters, for example:

[sources.windows_perf_counters]
type = "windows_perf_counters"
scrape_interval_secs = 15

[[sources.windows_perf_counters.objects]]
measurement = "iis_web_service"
object_name = "Web Service"
instances = ["_Total"]
counters = ["Current Connections"]

[[sources.windows_perf_counters.objects]]
measurement = "mssql_sql_statistics"
object_name = "SQLServer:SQL Statistics"
instances = ["------"]
counters = ["Batch Requests/sec"]

Wildcard instances could also be supported:

[[sources.windows_perf_counters.objects]]
measurement = "iis_web_service"
object_name = "Web Service"
instances = ["*"]
counters = ["Current Connections", "Bytes Sent/sec"]

Optionally, the source could also support raw PDH paths for advanced or unusual counters:

[[sources.windows_perf_counters.counters]]
name = "mssql_page_life_expectancy"
path = "\\SQLServer:Buffer Manager\\Page life expectancy"

I would initially keep this narrow:

  • Windows only
  • Local machine only
  • PDH API
  • Formatted gauge metrics
  • Object / instance / counter configuration
  • Wildcard instance expansion

This would be a Telegraf-inspired subset of win_perf_counters, not full Telegraf parity.

I am willing to attempt building a standalone Rust prototype first for faster iteration, then work with maintainers on porting it into Vector once the source shape is agreed on.

References

No response

Version

vector 0.53.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions