Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat: fetch prebuilds metrics state in background#17792

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
dannykopping merged 4 commits intomainfromdk/debounce-metrics-collection
May 13, 2025

Conversation

dannykopping
Copy link
Contributor

@dannykoppingdannykopping commentedMay 13, 2025
edited
Loading

Collect() is called whenever the/metrics endpoint is hit to retrieve metrics.

The queries used in prebuilds metrics collection are quite heavy, and we want to avoid having them running concurrently / too often to keep db load down.

Here I'm moving towards a background retrieval of the state required to set the metrics, which gets invalidated every interval.

Also introducescoderd_prebuilt_workspaces_metrics_last_updated which operators can use to determine when these metrics go stale.

See#17789 as well.

Signed-off-by: Danny Kopping <dannykopping@gmail.com>
Signed-off-by: Danny Kopping <dannykopping@gmail.com>
@dannykoppingdannykoppingforce-pushed thedk/debounce-metrics-collection branch frome73dae6 tofcbfb7fCompareMay 13, 2025 12:29
@dannykoppingdannykopping marked this pull request as ready for reviewMay 13, 2025 12:35
@@ -55,20 +57,34 @@ var (
labels,
nil,
)
lastUpdateDesc = prometheus.NewDesc(
"coderd_prebuilt_workspaces_metrics_last_updated",
"The unix timestamp when the metrics related to prebuilt workspaces were last updated; these metrics are cached.",
Copy link
Member

Choose a reason for hiding this comment

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

Is unix timestamp easy to alert on? Like can you do something likeunix_now() - metric_value > 1000 or something in grafana and co? If not, it might be better if this was a durationsince the last successful fetch instead.

Copy link
Member

@johnstcnjohnstcnMay 13, 2025
edited
Loading

Choose a reason for hiding this comment

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

+1 from me for duration since last successful fetch

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

The idiomatic approach is to use unix timestamps, seeprometheus_config_last_reload_success_timestamp_seconds.

Copy link
Member

Choose a reason for hiding this comment

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

So I guess we have an existing metric for the coder server start timestamp?

Copy link
ContributorAuthor

@dannykoppingdannykoppingMay 13, 2025
edited
Loading

Choose a reason for hiding this comment

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

I don't think so (or at least not one we export), but I think as long as this metric is updated relative to itselfandup is taken into consideration, it should be useful.

Signed-off-by: Danny Kopping <dannykopping@gmail.com>
@dannykoppingdannykopping merged commitb2a1de9 intomainMay 13, 2025
34 checks passed
@dannykoppingdannykopping deleted the dk/debounce-metrics-collection branchMay 13, 2025 18:27
@github-actionsgithub-actionsbot locked and limited conversation to collaboratorsMay 13, 2025
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.
Reviewers

@johnstcnjohnstcnjohnstcn left review comments

@deansheatherdeansheatherdeansheather approved these changes

Assignees

@dannykoppingdannykopping

Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

3 participants
@dannykopping@johnstcn@deansheather

[8]ページ先頭

©2009-2025 Movatter.jp