Skip to content

[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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

cuichenli
Copy link
Contributor

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

@cuichenli cuichenli requested a review from a team as a code owner May 8, 2025 03:03
@cuichenli cuichenli requested a review from atoulme May 8, 2025 03:03
@github-actions github-actions bot requested a review from antonblock May 8, 2025 03:03
@@ -305,6 +305,9 @@ func (p *postgreSQLScraper) collectTopQuery(ctx context.Context, dbClient client
row[dbAttributePrefix+columnName] = finalValue
}
}
if row[dbAttributePrefix+totalExecTimeColumnName] == 0.0 {
Copy link
Contributor

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?

Copy link
Contributor Author

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)

@cuichenli cuichenli changed the title [chore/postgresqlreceiver] do not report record if the total exec time is not changed [chore][postgresqlreceiver] do not report record if the total exec time is not changed May 8, 2025
@atoulme
Copy link
Contributor

atoulme commented May 8, 2025

@antonblock please review as codeowner

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants