-
Notifications
You must be signed in to change notification settings - Fork 3
Description
Currently, the instrumentation will invoke HealthCheckService.CheckHealthAsync() every time an OTEL publisher observes the meters to export data; the frequency is driven by the OTEL_METRIC_EXPORT_INTERVAL setting. The consequence is if this interval is very tight, the checks can be called too frequently which could lead to some performance issues as well as infra noise if there are many checks on API services, databases, etc. The solution should be an additional setting on the instrument that would control how often that check is being called, independently of how often the metric is being published. That would appropriately throttle and control those calls.
My initial thought around this would be to cache the last time a check was made in the Meter and then only perform a CheckHealthAsync when that timestamp has left the polling window.