free / sql_exporter

Database agnostic SQL exporter for Prometheus

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

sqlserver query results contain space characters Unable to obtain key containing spaces

junly917 opened this issue · comments

commented

SQL statement: dbcc sqlperf(logspace)

SQL Query result

Database Name	Log Size (MB)	Log Space Used (%)	Status
	master		1.992188		54.21569			0
	tempdb		132.8672		44.09655			0
	model		0.9921875	53.98622			0
	msdb		6.117188		17.0977			0
	testdbs		0.9921875	45.7185			0

sql_exporter.yaml config

     - metric_name: log_useage
        type: counter
        help: database log useage 
        key_labels:
          - Database\ Name
        values:
          - "Log Space Used (%)"
        query_ref: query_log

    queries:
      - query_name: query_log
        query: |
          dbcc sqlperf(logspace)

How to fill in the values of key and values