Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for perfmon instance_name for #7325 #7526

Merged
merged 1 commit into from
May 20, 2020

Conversation

denzilribeiro
Copy link
Contributor

@denzilribeiro denzilribeiro commented May 16, 2020

On Elastic pools, sys.dm_os_perfmon_counters has counters for all databases represented by GUIDS. To resolve the GUID to a DB name have to join with sys.databases
However sys.database only has a row for the current database and not all databases and hence the instance_name for those rows would be NULL and insert would fail with
"Cannot insert the value NULL error"

Fix is to resolve DB name for the current database, leave the GUID for perfmon counters of other databases.

closes #7325

Required for all PRs:

  • [X ] Signed CLA.
  • Associated README.md updated.
  • [ X] Has appropriate unit tests.

On Elastic pools, sys.dm_os_perfmon_counters has counters for all databases represented by GUIDS. To resolve the GUID to a DB name have to join with sys.databases
However sys.database only has a row for the current database.
Copy link

@andrewmitchell21 andrewmitchell21 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change looks good to me, happy to test and provide feedback if needed. Maybes @danielnelson can advise here

@danielnelson danielnelson added this to the 1.14.4 milestone May 20, 2020
@danielnelson danielnelson added fix pr to fix corresponding bug area/sqlserver labels May 20, 2020
@danielnelson danielnelson merged commit 5280023 into influxdata:master May 20, 2020
@danielnelson
Copy link
Contributor

@andrewmitchell21 Always helpful to have additional testing, here are links to the CI builds of this pull request:

danielnelson pushed a commit that referenced this pull request May 21, 2020
rhajek pushed a commit to bonitoo-io/telegraf that referenced this pull request Jul 13, 2020
idohalevi pushed a commit to idohalevi/telegraf that referenced this pull request Sep 29, 2020
arstercz pushed a commit to arstercz/telegraf that referenced this pull request Mar 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/sqlserver fix pr to fix corresponding bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cannot insert the value NULL error with PerformanceCounters query
3 participants