Monitoring

Dynamic Detection

How ConfigDirector decides how long a config must go without evaluations before it is ready to archive, how long an old key is kept after a rename, and how long an application request alert waits before resolving, based on how often each usually happens

Some of what ConfigDirector tells you is concluded from silence: a temporary config that your applications have stopped evaluating is ready to archive, an old key left behind by a rename is removed once your applications stop using it, and an alert about requests your applications make, such as requesting a config key that does not exist, resolves once they stop. How long that silence has to last depends on how often the thing being watched usually happens. A flag that is read on every app request and then goes for two entire days without an evaluation is almost certainly gone from the code. A flag read by a weekly job that goes a week without evaluations, is simply waiting for the next job run.

So instead of one fixed wait for everything, ConfigDirector gives each config its own wait, called its quiet window, based on how often it has been evaluated recently. A config that your applications read all the time gets a short window, and one read on a schedule gets a window long enough to cover the usual pause between runs, with room to spare. The window is worked out again every 30 minutes, so it follows changes in how your applications use the config. To see a temporary config's current quiet window once it has been evaluated, hover its status in the configs list.

An example

Take two temporary feature flags that have both been evaluated in production for months:

  • new-checkout is read by the web app on every page load, many times a minute. Its quiet window is 4 days, the shortest allowed.
  • invoice-layout-v2 is read only by a billing job that runs every Monday. A week without an evaluation is normal for it, so its quiet window is 14 days.

When the code that reads new-checkout is removed, the flag becomes Archive Ready 4 days after its last evaluation. invoice-layout-v2 becomes Archive Ready only after two weeks without an evaluation, so a single skipped run does not mark it ready to archive.

With one fixed wait of 4 days for both, invoice-layout-v2 would be marked ready to archive every Friday while the job still depends on it, and archiving it would leave the next Monday's run with its in-code default value.

Give each application its own app name

A flag is often read by more than one application, or by more than one component within an application. Say the web app also reads invoice-layout-v2 all day, every day, while the billing job keeps reading it every Monday. Give the web app and the job different app names when they initialize the ConfigDirector SDK. ConfigDirector can then tell them apart and see the two distinct usage patterns, so the flag keeps the 14-day quiet window that covers the weekly job. Even after the web app stops reading the flag, it stays In use for as long as the job keeps running.

Without different app names, the web app and the job would look like a single application to ConfigDirector. The job's evaluations then mix in with the web app's constant stream, the flag looks like one that is read all the time, and it gets the 4-day quiet window. Once the web app stops reading the flag, it would be marked ready to archive between the job's runs.

The setting is called appName in most SDKs, and each SDK's page shows where to set it.

Safety limits

Every quiet window is kept between a minimum and a maximum:

  • The minimum is the shortest the window can be, however often the config is evaluated. It is a safety margin for uses that are easy to miss, such as a daily job inside the same application as busy web traffic, whose evaluations mix in with that traffic.
  • The maximum is the longest the window can be, however rarely the config is evaluated. A config read only every few months, such as by a quarterly job, can become Archive Ready between runs, so check when it was last evaluated before you archive it.

Until a config has been evaluated for long enough to show its usual pace, its quiet window has a fixed length instead. A config first evaluated 3 days ago has a quiet window of 7 days, so it cannot be marked ready to archive until a week after that first evaluation. The same applies to an application that starts reading a config, or starts reporting a new app name: for its first week, ConfigDirector allows for it being one that runs rarely, so the config's quiet window can be longer.

Quiet windowMinimumMaximumUntil there is enough history
Archive Ready4 days45 days7 days
Old keys35 daysNone35 days
Application request alerts1 hour7 days24 hours
In-code default alerts1 day14 days7 days
Outdated SDK version alerts1 day14 days5 days
SDK cannot evaluate segments alerts1 day14 days7 days

Archive Ready explains which environments' evaluations count toward a config's quiet window.

Old keys

When you rename a config, its old key keeps working alongside the new one, unless the config was created less than two hours ago, has never been evaluated and no code scan references it, in which case the key is replaced outright. ConfigDirector removes an old key once it has gone its quiet window without an evaluation in any environment, and your applications have evaluated a newer key since. The wait never starts before the rename, so every old key is kept for at least 35 days. If no newer key is ever evaluated, the old key stays. Old keys are checked twice a day.

The 35-day minimum covers jobs that run at least once a month. An old key read less often, such as by a quarterly job, can be removed between runs, so update those jobs to the new key before their next run.

Application request alerts

The Config not found, Client SDK requested a server-only config, Server SDK requested a client-only config and Config type mismatch alerts resolve once ConfigDirector no longer detects the requests behind them: those requests have stopped for the alert's quiet window. That window is sized from how often those particular requests usually happened, not from how often the config is evaluated overall: a key that a nightly job keeps misspelling is requested once a day, so its alert waits about two days of silence before resolving, while an alert about a typo in a page that is loaded all day resolves about an hour after the fix ships. The window is worked out again at every check.

Until the requests have been seen for a full day, the window is 24 hours. It is never shorter than 1 hour or longer than 7 days, so an alert about requests that only a weekly job makes can resolve between runs and be raised again at the next one.

In-code default alerts

The In-code default value mismatch and In-code default value served too often alerts resolve once ConfigDirector no longer detects the problem behind them: the problem has stopped for the alert's quiet window, sized from how often it usually happened. The window is worked out again at every check.

Until the problem has been seen for a full week, the window is 7 days. It is never shorter than 1 day or longer than 14 days.

SDK connection alerts

The Outdated SDK version and SDK cannot evaluate segments alerts resolve once ConfigDirector no longer detects applications connecting with the SDK version behind them: no application has connected with that version for the alert's quiet window, sized from how often applications usually connected with it. A connection counts from when it opens until it closes, so an application that stays connected for weeks keeps its alert open, while a job that connects every few days gets a window long enough to cover the wait between runs. The window is worked out again at every check.

Until the version has been seen connecting for long enough, the window is 5 days for an outdated SDK version and 7 days for a version that cannot evaluate segments. It is never shorter than 1 day or longer than 14 days.

Alerts that ask for a code change

The Config settled, In-code default value mismatch and In-code default value served too often alerts ask you to change code: hardcode a value, or fix an in-code default value. They are raised, and stay open, only while the config is still in use. ConfigDirector judges that by how often the config's busiest application usually evaluates it, so a flag read on every page load counts as out of use soon after the evaluations stop, while a flag read by a nightly job is given time for the next run. An alert whose config goes out of use resolves at the next check. If the problem is still there once the config is evaluated again, a new alert is raised.

A code scan that stops finding a config an earlier scan found counts as the config being removed from the code, and ConfigDirector gives that change time to reach every application. From that scan until the config has been evaluated for a while past it, these three alerts are not raised and open ones resolve, even while an older deployment still evaluates the config. Deleting a scanned repository is not a scan, and a config no scan has ever found is judged by its evaluations alone.

A config read in a way the scan cannot see, such as through a key built at runtime or from a repository that is never scanned, is judged by its evaluations again after that time. Its alerts can arrive late, but they do arrive.