Closed wizardmatas closed 6 years ago
Hi,
You can either just use go build
if you are building locally, or if you want to test the flow which is used in the release process, write the output of git describe --always --tags
to the VERSION file.
Or, if you don't really care about the value, just write something on the form x.y.z
to that file :)
hi, @carlpett thanks, it worked. However I have faced issue with some metrics for sql server: I want to expose these metrics:
GENUS : 2 CLASS : Win32_PerfRawData_MSSQLSERVER_SQLServerGeneralStatistics SUPERCLASS : Win32_PerfRawData __DYNASTY : CIM_StatisticalInformation RELPATH : Win32_PerfRawData_MSSQLSERVER_SQLServerGeneralStatistics=@ PROPERTY_COUNT : 33 __DERIVATION : {Win32_PerfRawData, Win32_Perf, CIM_StatisticalInformation} SERVER : SQL001 NAMESPACE : root\cimv2 PATH : \SQL001\root\cimv2:Win32_PerfRawData_MSSQLSERVER_SQLServerGeneralStatistics=@ ActiveTempTables : 4 Caption : ConnectionResetPersec : 0 Description : EventNotificationsDelayedDrop : 0 Frequency_Object : 0 Frequency_PerfTime : 3579545 Frequency_Sys100NS : 10000000 HTTPAuthenticatedRequests : 0 LogicalConnections : 2 LoginsPersec : 8 LogoutsPersec : 6 MarsDeadlocks : 0 Name : Nonatomicyieldrate : 0 Processesblocked : 0 SOAPEmptyRequests : 0 SOAPMethodInvocations : 0 SOAPSessionInitiateRequests : 0 SOAPSessionTerminateRequests : 0 SOAPSQLRequests : 0 SOAPWSDLRequests : 0 SQLTraceIOProviderLockWaits : 0 Tempdbrecoveryunitid : 0 Tempdbrowsetid : 0 TempTablesCreationRate : 6 TempTablesForDestruction : 0 Timestamp_Object : 0 Timestamp_PerfTime : 192648561960 Timestamp_Sys100NS : 131751339279120000 TraceEventNotificationQueue : 0 Transactions : 0 UserConnections : 2 PSComputerName : SQL001
I create collector and build exporter. After I start exporter I get error:
PS C:\Users\Administrator\go\src\github.com\martinlindhe\wmi_exporter> .\wmi_exporter.exe --collectors.enabled "sqlservergeneralstatistics" ←[36mINFO←[0m[0000] Enabled collectors: sqlservergeneralstatistics ←[36msource←[0m="exporter.go:231" ←[36mINFO←[0m[0000] Starting WMI exporter (version=, branch=, revision=) ←[36msource←[0m="exporter.go:242" ←[36mINFO←[0m[0000] Build context (go=go1.10.3, user=, date=) ←[36msource←[0m="exporter.go:243" ←[36mINFO←[0m[0000] Starting server on :9182 ←[36msource←[0m="exporter.go:246" ←[31mERRO←[0m[0003] failed collecting sqlservergeneralstatistics metrics:<nil> wmi: cannot load field "Name" into a "str ing": unsupported type (<nil>) ←[31msource←[0m="sqlservergeneralstatistics.go:198" ←[31mERRO←[0m[0003] collector sqlservergeneralstatistics failed after 0.026446s: wmi: cannot load field "Name" into a "s tring": unsupported type (<nil>) ←[31msource←[0m="exporter.go:105" ←[31mERRO←[0m[0005] failed collecting sqlservergeneralstatistics metrics:<nil> wmi: cannot load field "Name" into a "str ing": unsupported type (<nil>) ←[31msource←[0m="sqlservergeneralstatistics.go:198" ←[31mERRO←[0m[0005] collector sqlservergeneralstatistics failed after 0.019720s: wmi: cannot load field "Name" into a "s tring": unsupported type (<nil>) ←[31msource←[0m="exporter.go:105"
I think problem is because Name is empty in powershell query:
Get-WmiObject Win32_PerfRawData_MSSQLSERVER_SQLServerGeneralStatistics
how to skip that ?
Well, you could just remove the Name
field from your class type?
Hi, this class is provided by MS, I am not sure how to do it ? Is it possible to filter it somehow in collector ?
What I meant is that you have a struct type mapping to the class, which has members for all the fields you want to extract. So remove the name field from that struct.
Hi, thanks, found it. Now it works!
:+1:
Hello, can anyone share VERSION file. I'm trying to build exporter and it fails with:
missing VERSION or version/VERSION file
and!! binary . not found in config