mssql: fix performance counter with additional server instance (#1753)

Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
This commit is contained in:
Jan-Otto Kröpke 2024-11-21 22:52:30 +01:00 committed by GitHub
parent 3b378136f5
commit 4534c2a6ae
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -360,9 +360,10 @@ func (c *Collector) getMSSQLInstances() mssqlInstancesType {
// Counter object for the given SQL instance and Collector.
func (c *Collector) mssqlGetPerfObjectName(sqlInstance string, collector string) string {
sb := strings.Builder{}
sb.WriteString("SQLServer:")
if sqlInstance != "MSSQLSERVER" {
if sqlInstance == "MSSQLSERVER" {
sb.WriteString("SQLServer:")
} else {
sb.WriteString("MSSQL$")
sb.WriteString(sqlInstance)
sb.WriteString(":")