Skip to content

Instantly share code, notes, and snippets.

@ealsur
Last active June 24, 2021 21:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ealsur/2c47d38c9c2fa7cbe122f011743509be to your computer and use it in GitHub Desktop.
Save ealsur/2c47d38c9c2fa7cbe122f011743509be to your computer and use it in GitHub Desktop.
void captureDiagnostics(CosmosDiagnostics diagnostics)
{
if (diagnostics.GetClientElapsedTime() > SomePredefinedThresholdTime)
{
Console.WriteLine(diagnostics.ToString());
}
}
services.AddCosmosCache((CosmosCacheOptions cacheOptions) =>
{
cacheOptions.DiagnosticsHandler = captureDiagnostics;
/* other options */
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment