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

[receiver\sqlserver] Fix SQL Server metrics from gauge to monotonic sum #9520

Merged
merged 1 commit into from May 2, 2022

Conversation

StefanKurek
Copy link
Contributor

@StefanKurek StefanKurek commented Apr 25, 2022

Description:
Fix bug where transaction log shrinks and growths were improperly marked as gauges when they are in fact monotonic sums.

Issue: #9522

Testing: Manually ran and verified that changed metrics came back as monotonic sums instead of gauges.

Documentation: Updated documentation to reflect metric changes

@StefanKurek StefanKurek requested a review from a team as a code owner April 25, 2022 21:09
@project-bot project-bot bot added this to In progress in Collector Apr 25, 2022
@StefanKurek
Copy link
Contributor Author

@dashpole this is a pretty small PR. If you could take a look I'd be very appreciative.

Copy link
Contributor

@dashpole dashpole left a comment

Choose a reason for hiding this comment

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

This looks reasonable to me, but I'm not familiar with sql server at all. Can you link to docs for where the data is being retrieved from (if they exist?). This component doesn't seem to have an entry in CODEOWNERS, which is unfortunate. @djaglowski is the CODEOWNERS for other sql-related components, maybe he has context to review?

@StefanKurek
Copy link
Contributor Author

StefanKurek commented Apr 26, 2022

This looks reasonable to me, but I'm not familiar with sql server at all. Can you link to docs for where the data is being retrieved from (if they exist?). This component doesn't seem to have an entry in CODEOWNERS, which is unfortunate. @djaglowski is the CODEOWNERS for other sql-related components, maybe he has context to review?

@dashpole Hello. https://docs.microsoft.com/en-us/sql/relational-databases/performance-monitor/sql-server-databases-object?view=sql-server-ver15 is the best I can find for documentation (specifically log growths and log shrinks). For context, when pulled from the monitoring tables themselves, most of the data is is in counter form. The same data pulled with windows performance counters (which is what the first pass of this receiver uses exclusively), almost every metric is a gauge instead. I assumed too much about these two metrics when initially creating the receiver, but after generating load and looking at non-zero values I saw that they were indeed counters.

I should have been tipped off because these two counter names (Log Growths & Log Shrinks) do not include a "/sec" in their name like most of the counters.

I don't think @djaglowski will have any info outside of what I just described (and he is actually on vacation until next week I believe). Thanks again for looking!

gauge:
sum:
monotonic: true
aggregation: cumulative
value_type: double
Copy link
Member

Choose a reason for hiding this comment

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

Why double?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@bogdandrutu it's the way it is presented from the windows performance counters. it might be able to be changed to an int with some research, but i'd say that's outside the scope of this bug fix.

Copy link
Member

Choose a reason for hiding this comment

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

@StefanKurek will you please create an issue to track this?

gauge:
sum:
monotonic: true
aggregation: cumulative
value_type: double
Copy link
Member

Choose a reason for hiding this comment

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

Why double?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

See above comment

@StefanKurek StefanKurek changed the title Fix SQL Server metrics from gauge to monotonic sum [receiver\sqlserver] Fix SQL Server metrics from gauge to monotonic sum Apr 26, 2022
Copy link
Contributor

@dashpole dashpole left a comment

Choose a reason for hiding this comment

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

lgtm

Collector automation moved this from In progress to Reviewer approved Apr 27, 2022
Copy link
Member

@djaglowski djaglowski left a comment

Choose a reason for hiding this comment

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

@StefanKurek, I've opened #9600 to declare you and I as code owners of this component. Otherwise, I think we should capture the double/int question and will need to address it before the component is graduated to beta.

gauge:
sum:
monotonic: true
aggregation: cumulative
value_type: double
Copy link
Member

Choose a reason for hiding this comment

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

@StefanKurek will you please create an issue to track this?

Copy link
Member

@djaglowski djaglowski left a comment

Choose a reason for hiding this comment

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

Looks good to me. A couple follow up issues have been created (#9600, #9601)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Collector
  
Reviewer approved
Development

Successfully merging this pull request may close these issues.

None yet

5 participants