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(coderd/healthcheck): allow configuring database hc threshold#10623

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
johnstcn merged 10 commits intomainfromcj/configurable-db-hc-threshold
Nov 13, 2023

Conversation

johnstcn
Copy link
Member

@johnstcnjohnstcn commentedNov 10, 2023
edited
Loading

Fixes#9381:

  • Exposes database healthcheck threshold in configuration

Also takes care of part of#8969:

  • Exposes healthcheck recheck interval in configuration

@johnstcnjohnstcn self-assigned thisNov 10, 2023
Comment on lines 22 to 23
LatencyMs int64 `json:"latency_ms"`
ThresholdMs int64 `json:"threshold_ms"`
Copy link
MemberAuthor

Choose a reason for hiding this comment

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

self-review: I can make theseints if preferred, but int64 is slightly less annoying to use here.

Comment on lines -52 to +50
DB database.Store
// TODO: support getting this over HTTP?
DERPMap *tailcfg.DERPMap
AccessURL *url.URL
Client *http.Client
APIKey string
AccessURL AccessURLReportOptions
Database DatabaseReportOptions
DerpHealth derphealth.ReportOptions
Websocket WebsocketReportOptions
Copy link
MemberAuthor

Choose a reason for hiding this comment

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

self-review: Refactored this struct to directly pass in the individual checker options.

Comment on lines 419 to 423
if options.HealthcheckTimeout == 0 {
options.HealthcheckTimeout =30 * time.Second
options.HealthcheckTimeout =options.DeploymentValues.Healthcheck.Timeout.Value()
}
if options.HealthcheckRefresh == 0 {
options.HealthcheckRefresh =10 * time.Minute
options.HealthcheckRefresh =options.DeploymentValues.Healthcheck.Refresh.Value()
Copy link
MemberAuthor

Choose a reason for hiding this comment

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

self-review: Also plumbed through the healthcheck timeout and refresh and made them configurable. Addresses part of#8969 but I can break this into a separate PR if preferred.

@johnstcnjohnstcn marked this pull request as ready for reviewNovember 10, 2023 17:10
@johnstcnjohnstcn requested review fromdeansheather,coadler,mafredri andmtojek and removed request forcoadler anddeansheatherNovember 10, 2023 17:10
@matifali
Copy link
Member

We should also show a hint on the database health check page on how to configure this interval.
Probably expose it somewhere on the deployment page too. We are currently exposing many of the configured options there.

@johnstcn
Copy link
MemberAuthor

johnstcn commentedNov 13, 2023
edited
Loading

@matifali We should also show a hint on the database health check page on how to configure this interval. Probably expose it somewhere on the deployment page too. We are currently exposing many of the configured options there.

Right now they'll show up by default under Deployment > Observability. I can move them to a separate option group and move them to a separate page if required.

image

I might need some design help with adding the hint to the health page though, so I'll defer that to a separate PR.

@matifali
Copy link
Member

I think this is fine for now. A hint could be added in a separate PR.

Thank you.

Reachable bool `json:"reachable"`
Latency string `json:"latency"`
LatencyMS int64 `json:"latency_ms"`
ThresholdMS int64 `json:"threshold_ms"`
Copy link
Member

Choose a reason for hiding this comment

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

Should we add theThreshold string for consistency? I don't know what is the original though behind string+int64 pairs.

Copy link
MemberAuthor

@johnstcnjohnstcnNov 13, 2023
edited
Loading

Choose a reason for hiding this comment

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

Me either, and the fact that I don't know why this particular fence exists makes me pause before knocking it down. I do know that_ms was added post-hoc for the UI (8ee500c) so I suspect it was simply a case of not renaming a field in the API for compatibility purposes.

Instead of parsing the Go string representation (latency) it's probably better for the UI to just create the durations from millis and then display them however is deemed best. So I would argue in favour of leaving outthreshold entirely.

@mtojekmtojek self-requested a reviewNovember 13, 2023 13:45
Copy link
Member

@mtojekmtojek left a comment

Choose a reason for hiding this comment

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

This is in good shape to get merged 👍

@johnstcnjohnstcn merged commitb69c237 intomainNov 13, 2023
@johnstcnjohnstcn deleted the cj/configurable-db-hc-threshold branchNovember 13, 2023 14:14
@github-actionsgithub-actionsbot locked and limited conversation to collaboratorsNov 13, 2023
Copy link
Member

@mafredrimafredri left a comment

Choose a reason for hiding this comment

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

Nice work!

# database exceeds this threshold over 5 attempts, the database is considered
# unhealthy. The default value is 15ms.
# (default: 15ms, type: duration)
thresholdDatabase: 15ms
Copy link
Member

Choose a reason for hiding this comment

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

I think this would be smoother asdatabaseThreshold vsthresholdDatabase (same with flags, etc)

Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.
Reviewers

@mafredrimafredrimafredri approved these changes

@mtojekmtojekmtojek approved these changes

Assignees

@johnstcnjohnstcn

Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

healthcheck: configurable database delay
4 participants
@johnstcn@matifali@mafredri@mtojek

[8]ページ先頭

©2009-2025 Movatter.jp