Skip to content

Commit

Permalink
Fix instance name resolution in performance counter query (influxdata…
Browse files Browse the repository at this point in the history
  • Loading branch information
denzilribeiro authored May 20, 2020
1 parent 3cdcea0 commit 6a47559
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions plugins/inputs/sqlserver/sqlserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -626,10 +626,10 @@ SET @SQL = N'SELECT DISTINCT
OR RTRIM(spi.object_name) LIKE ''%:Advanced Analytics'')
AND TRY_CONVERT(uniqueidentifier, spi.instance_name)
IS NOT NULL -- for cloud only
THEN d.name
WHEN RTRIM(object_name) LIKE ''%:Availability Replica''
THEN ISNULL(d.name,RTRIM(spi.instance_name)) -- Elastic Pools counters exist for all databases but sys.databases only has current DB value
WHEN RTRIM(object_name) LIKE ''%:Availability Replica''
AND TRY_CONVERT(uniqueidentifier, spi.instance_name) IS NOT NULL -- for cloud only
THEN d.name + RTRIM(SUBSTRING(spi.instance_name, 37, LEN(spi.instance_name)))
THEN ISNULL(d.name,RTRIM(spi.instance_name)) + RTRIM(SUBSTRING(spi.instance_name, 37, LEN(spi.instance_name)))
ELSE RTRIM(spi.instance_name)
END AS instance_name,'
ELSE 'RTRIM(spi.instance_name) as instance_name, '
Expand Down

0 comments on commit 6a47559

Please sign in to comment.