blackbeam/mysql_async

Performance counters, metrics, tracing

cloneable opened this issue · 5 comments

Hi! We would like to get more insight into how well we're handling DB connections, but we're having difficulty measuring some things where we would need deeper access to pool, recycler, etc.

Would you be receptive to adding some lightweight telemetry to mysql_async? Not heavy histograms, but some (atomic) counters for connection creation, returnal, recycling of unclean conns and of expired conns, failed conns, etc.. I would prepare a PR.

And then I would also like to ask how you feel about instrumenting functions and futures via tracing package? This could be behind a feature flag and the spans would be at debug or even trace level. That's a bigger change and completely separate from the metrics above.

Hi. Both telemetry and tracing seem to be useful. I'll try not to drag out the review process.

Great, thank you! I just created the first of at least two PRs (#224) which instruments some futures. Please have a look and see if you're okay with this. Maybe you have some ideas what can be done better. I'm not happy yet with how queries and params are added. That's a bit inefficient, but it's done only at debug level anyway.

I need a bit more time working on the perf counters. In the meantime, it would be great if we could merge #230 and then publish a new release. Would that be possible?

Published as v0.31.3.

Thanks a lot! I'll return soon once I have a good design for the perf counters. I'll also try to add a test tracing subscriber that can capture tracing events, so they can be checked.