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

Gitlab Collector: Oldest Blocked collector and test #838

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

Conversation

Sticksman
Copy link
Contributor

Split from #819

Signed-off-by: Felix Yuan <felix.yuan@reddit.com>
Copy link
Contributor

@SuperQ SuperQ left a comment

Choose a reason for hiding this comment

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

I think we should refactor these separate collectors into a single pg_stat_activity collector to reduce the number of queries to this table.


oldestBlockedQuery = `
SELECT
coalesce(extract('epoch' from max(clock_timestamp() - state_change)), 0) age_seconds
Copy link
Contributor

Choose a reason for hiding this comment

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

Similar to others, we should extract the raw timestamp for this metric.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't know if that makes sense since we're trying to measure the max duration that a query's been blocked here

Copy link
Contributor

Choose a reason for hiding this comment

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

This can still be done with time() - metric.

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

Successfully merging this pull request may close these issues.

None yet

2 participants