Skip to content

Commit

Permalink
mssql: fix performance counter with additional server instance (#1753)
Browse files Browse the repository at this point in the history
Signed-off-by: Jan-Otto Kröpke <[email protected]>
  • Loading branch information
jkroepke authored Nov 21, 2024
1 parent 3b37813 commit 4534c2a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions internal/collector/mssql/mssql.go
Original file line number Diff line number Diff line change
Expand Up @@ -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(":")
Expand Down

0 comments on commit 4534c2a

Please sign in to comment.