Skip to content

Add configurable latency thresholds for persistence health#11073

Merged
zdylag-temporal merged 1 commit into
mainfrom
zachdylag/AddConfigurablePersistenceHealthLatencies
Jul 17, 2026
Merged

Add configurable latency thresholds for persistence health#11073
zdylag-temporal merged 1 commit into
mainfrom
zachdylag/AddConfigurablePersistenceHealthLatencies

Conversation

@zdylag-temporal

Copy link
Copy Markdown
Contributor

What changed?

This adds configurable latency thresholds for persistence health checks so that we can dynamically change what percentiles we want to look at, as well as what values we want to alert on.

This also adds enforceability as a concept to the health checks so that we can have them reported in a safer way when testing.

These latencies are computed using the same tdigest based library we use in history health checks, which will allow us to get much more useful percentile values than the current average only reporting.

Why?

So we can test out different percentile settings and evaluate good defaults.

How did you test it?

  • built
  • run locally and tested manually
  • covered by existing tests
  • added new unit test(s)
  • added new functional test(s)

Potential risks

Changing health checks is always risky, but this adds a softer version of them so it should make things safer ultimately.

@zdylag-temporal
zdylag-temporal requested review from a team as code owners July 15, 2026 00:50
Comment thread common/dynamicconfig/constants.go Outdated
@zdylag-temporal
zdylag-temporal force-pushed the zachdylag/AddConfigurablePersistenceHealthLatencies branch from d1312db to 02f208f Compare July 16, 2026 17:01
Comment thread common/persistence/client/fx.go Outdated
if dynamicconfig.PersistenceHealthSignalMetricsEnabled.Get(dynamicCollection)() {
aggregator := persistence.NewHealthSignalAggregator(
dynamicconfig.PersistenceHealthSignalAggregationEnabled.Get(dynamicCollection)(),
dynamicconfig.PersistenceHealthSignalPercentilesEnabled.Get(dynamicCollection)(),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

this also slightly concerns me, because we loose the "dynamic" in the dynamic config. it can only ever change if we do a restart. where as this one keeps the dynamic config.

But I also understand that checking this every time could probably lead to problems though... just want to call out

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Luckily this is only for turning it off/on. The health checking / output side I think is dynamic?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Maybe another good comparison is the window size and count. If we wanted those to be properly dynamic we would probably need to do some actual engineering 😬

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thinking on this, I think we should actually have the off/on-ness be dynamic, just in case. I think we can just pass the func reference here, right?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Yeah thats what I meant, having the dynamic-ness for the writing side. but I wonder how much that would slow things down. it would almost be like something you'd have to do async like check back every x seconds to see if dynamic config changed

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

If we're lucky, the DC access function already has caching built-in? We'll have to read it to make sure though

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

We already do DC access in the other health checkers path, so it seems likely its fine here for on/off? Im inclined to just do on/off though to not add a bunch of complexity to the window library.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Added dynamicness for on/off 👍

@zdylag-temporal
zdylag-temporal force-pushed the zachdylag/AddConfigurablePersistenceHealthLatencies branch from 02f208f to 02d0d65 Compare July 16, 2026 20:08
This adds configurable latency thresholds for persistence
health checks so that we can dynamically change what
percentiles we want to look at, as well as what values we
want to alert on.

This also adds enforceability as a concept to the health
checks so that we can have them reported in a safer way
when testing.

These latencies are computed using the same tdigest
based library we use in history health checks, which will
allow us to get much more useful percentile values than
the current average only reporting.
@zdylag-temporal
zdylag-temporal force-pushed the zachdylag/AddConfigurablePersistenceHealthLatencies branch from 02d0d65 to 42af4fd Compare July 16, 2026 20:11

@thestephenstanton thestephenstanton left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

lgtm

@zdylag-temporal
zdylag-temporal merged commit be4b078 into main Jul 17, 2026
163 of 171 checks passed
@zdylag-temporal
zdylag-temporal deleted the zachdylag/AddConfigurablePersistenceHealthLatencies branch July 17, 2026 17:33
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.

3 participants