dotnetcore / EasyCaching

:boom: EasyCaching is an open source caching library that contains basic usages and some advanced usages of caching which can help us to handle caching more easier!
MIT License
1.95k stars 322 forks source link

Use easycaching with elastic apm agent dotnet #461

Open billhong-just opened 1 year ago

billhong-just commented 1 year ago

Description

Hi, I want to use elastic/apm-agent-dotnet to trace the commands sent to Redis.
Here is a sample code from elastic official document:

// using Elastic.Apm.StackExchange.Redis;

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

Do I have any chance to get the connection from easycaching or provide a delegate to easycaching?

References

catcherwong commented 1 year ago

@billhong-just Thanks for your interest in this project.

EasyCaching does not support this one now, I will take a look how to support more APM system.

billhong-just commented 1 year ago

@catcherwong Thanks for your quick answer.

Perhaps there could be an event called OnConnected,user can register this event, get the connection and something else when it is established then do what they want.

catcherwong commented 1 year ago

@billhong-just Could you submit a PR for your idea?

billhong-just commented 1 year ago

@catcherwong

Thanks, I will take a look how to make a PR for my idea. Do you have any contributing guidelines or suggestions? 👋