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

mssql databases child collector fails in v0.30.0-rc.2 #1795

Closed
aa-matthias opened this issue Nov 30, 2024 · 8 comments · Fixed by #1799
Closed

mssql databases child collector fails in v0.30.0-rc.2 #1795

aa-matthias opened this issue Nov 30, 2024 · 8 comments · Fixed by #1799
Labels

Comments

@aa-matthias
Copy link

Current Behavior

windows_mssql_collector_success{collector="databases",mssql_instance="MSSQLSERVER"} 0

having set log level to debug via config.yaml but nothing showing up in the eventlog currently.

Expected Behavior

scrape should be successful

Steps To Reproduce

No response

Environment

  • windows_exporter Version: v0.30.0-rc.2
  • Windows Server Version: 2019 / MSSQL 14.0.3485.1

windows_exporter logs

-

Anything else?

No response

@jkroepke
Copy link
Member

windows_mssql_collector_success{collector="databases",mssql_instance="MSSQLSERVER"} 1
windows_mssql_collector_success{collector="databases",mssql_instance="SQLTE2"} 1

I can't verify that on my dev machine.

Idk, if there is an issue with the event log. Bug I would appricate if you could run the export from cmd.exe with --log.level=DEBUG

@aa-matthias
Copy link
Author

🤔 i'm getting this:

2024/12/01 08:08:31 ERROR Failed to parse CLI args err="unrecognized log level DEBUG"

@jkroepke
Copy link
Member

jkroepke commented Dec 1, 2024

Ah, lowercase debug is correct.

@aa-matthias
Copy link
Author

aa-matthias commented Dec 1, 2024

time=2024-12-01T12:22:16.057+01:00 level=DEBUG source=mssql.go:370 msg="detected MSSQL Instances: mssql.mssqlInstancesType{\"MSSQLSERVER\":\"MSSQL14.MSSQLSERVER\"}\n" collector=mssql
time=2024-12-01T12:22:16.804+01:00 level=WARN source=main.go:210 msg="couldn't initialize collector" err="error build collector mssql: failed to build databases collector: failed to create Databases collector for instance MSSQLSERVER: failed to initialize collector: failed to add counter \\SQLServer:Databases(*)\\Active parallel redo threads: Der angegebene Leistungsindikator wurde nicht gefunden.\r\n"
...
time=2024-12-01T12:22:38.470+01:00 level=DEBUG source=mssql.go:413 msg="mssql class collector databases for instance MSSQLSERVER failed after 511.1µs" collector=mssql err="failed to collect SQLServer:Databases metrics: performance counter not initialized"

before upgrading to 0.30.0-rc.2 (0.29.2) I have received 0 as value for this metric / field via prometheus.

image

I also cannot find the metric within C:\Program Files\Microsoft SQL Server\MSSQL14.MSSQLSERVER\MSSQL\Binn\perf-MSSQLSERVERsqlctr.ini or via

SELECT * FROM sys.dm_os_performance_counters
WHERE object_name LIKE '%Databases%' order by counter_name;

@jkroepke
Copy link
Member

jkroepke commented Dec 1, 2024

C:\Program Files\Microsoft SQL Server\MSSQL14

SQL Server 2017?

Looking at microsoft/DiagManager#41, it sound like the Counter are available since SQL Server 2019.

0.29.0 just ignores the existence of counter and reports always 0. However, I feel that leads to wrong assumptions to end users.

Instead fail, I would omit the counters on lower versions.

@aa-matthias
Copy link
Author

aa-matthias commented Dec 1, 2024

I do agree that omitting them would be the preferred way to handle that.

Wonder why they are listed in the SQL Server Docs for 2016 but that seems to be a doc issue then.

https://learn.microsoft.com/en-us/sql/relational-databases/performance-monitor/sql-server-databases-object?view=sql-server-2016

@jkroepke
Copy link
Member

jkroepke commented Dec 1, 2024

Should be fixed in a upcoming release.

You could also try an snapshot build to verify that: https://github.com/prometheus-community/windows_exporter/actions/runs/12107522322/artifacts/2258517864

@aa-matthias
Copy link
Author

Hey - thanks addressing all the findings so quickly! tested the snapshot built successfully!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants