This is a cache of https://www.elastic.co/guide/en/apm/agent/dotnet/current/setup-stackexchange-redis.html. It is a snapshot of the page at 2024-09-06T01:01:51.382+0000.
StackExchange.Redis | APM .NET Agent Reference [<strong>1</strong>.x] | Elastic

StackExchange.Redis

edit

Quick start

edit

Instrumentation can be enabled for StackExchange.Redis by referencing Elastic.Apm.StackExchange.Redis package and calling the UseElasticApm() extension method defined in Elastic.Apm.StackExchange.Redis, on IConnectionMultiplexer

// using Elastic.Apm.StackExchange.Redis;

var connection = await ConnectionMultiplexer.ConnectAsync("<redis connection>");
connection.UseElasticApm();

A callback is registered with the IConnectionMultiplexer to provide a profiling session for each transaction and span that captures redis commands sent with IConnectionMultiplexer.