-
Notifications
You must be signed in to change notification settings - Fork 2.7k
[chore][postgresqlreceiver] do not report record if the total exec time is not changed #39942
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
base: main
Are you sure you want to change the base?
[chore][postgresqlreceiver] do not report record if the total exec time is not changed #39942
Conversation
@@ -305,6 +305,9 @@ func (p *postgreSQLScraper) collectTopQuery(ctx context.Context, dbClient client | |||
row[dbAttributePrefix+columnName] = finalValue | |||
} | |||
} | |||
if row[dbAttributePrefix+totalExecTimeColumnName] == 0.0 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it any possible that the value response 0 instead of 0.0?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nope, it wont convert to int.
although it is not clear from this line, but we can tell from https://github.com/open-telemetry/opentelemetry-collector-contrib/pull/39942/files#diff-92b155f73edce85fb5d2b214b668ea8ec9dd01eed47428e129fde9cd29a1ae22L260
it is a little bit unclear. i will see if i can improve on this (in a follow up pr)
@antonblock please review as codeowner |
Description
the current implementation would report queries not executed between the last elapsed time. which is not ideal. it would flush the downstream. this change will avoid the issue.
Testing
Documentation