From 8b8731c3c803b274682cc3f7f053f670bca5ce0e Mon Sep 17 00:00:00 2001 From: Alan West <3676547+alanwest@users.noreply.github.com> Date: Thu, 10 Sep 2020 09:30:30 -0700 Subject: [PATCH] Document StackExchange.Redis instrumentation options (#1256) * Document StackExchange.Redis instrumentation options * Fix markdown --- .../README.md | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/src/OpenTelemetry.Instrumentation.StackExchangeRedis/README.md b/src/OpenTelemetry.Instrumentation.StackExchangeRedis/README.md index f7fdf9d4c..4e652b8db 100644 --- a/src/OpenTelemetry.Instrumentation.StackExchangeRedis/README.md +++ b/src/OpenTelemetry.Instrumentation.StackExchangeRedis/README.md @@ -61,8 +61,25 @@ For an ASP.NET application, adding instrumentation is typically done in the This instrumentation can be configured to change the default behavior by using `StackExchangeRedisCallsInstrumentationOptions`. -TODO - describe options +### FlushInterval + +StackExchange.Redis has its own internal profiler. OpenTelmetry converts each +profiled command from the internal profiler to an Activity for collection. By +default, this conversion process flushes profiled commands on a 10 second +interval. The `FlushInterval` option can be used to adjust this internval. + +The following example shows how to use `FlushInterval`. + +```csharp +using Sdk.CreateTracerProviderBuilder() + .AddRedisInstrumentation( + connection, + options => options.FlushInterval = TimeSpan.FromSeconds(5)) + .AddConsoleExporter() + .Build(); +``` ## References * [OpenTelemetry Project](https://opentelemetry.io/) +* [StackExchange.Redis Profiling](https://stackexchange.github.io/StackExchange.Redis/Profiling_v1.html)