Replies: 4 comments 6 replies
-
Hey @nappa85, long time no see lolll This https://github.com/open-telemetry/opentelemetry-rust? I'm planning to benchmarking sea-orm & sea-query too. But didn't have time implementing it. I guess this would be a great tool to find the costly operations :P |
Beta Was this translation helpful? Give feedback.
-
Hi Marco, welcome back! I hope that your experience with SeaORM had been good so far. Two things: I don't think it is the best strategy for it to be a global context, is there a specific reason for this? PR is definitely welcomed! |
Beta Was this translation helpful? Give feedback.
-
I'm looking at adding opentelemetry too, to send traces to a jaeger service. @nappa85 I can't find anything related to the PR you're talking about, was any work done in sea-orm & opentelemetry? |
Beta Was this translation helpful? Give feedback.
-
Actually I've done this to use opentelemetry, I think the example is quite self-explanatory. |
Beta Was this translation helpful? Give feedback.
-
Hello guys, I'm back after a long time :)
Actually I'm trying to integrate metrics (like opentelemetry) into the orm, to meter queries execution times.
What do you guys thing about that? Would it be helpful upstream?
To keep a cross-crate integration (opentelemetry is only one of the many metric crates around) I would simply add a global static OnceCell to store a callback function, if the user wants to use metrics has to call a set_metric_callback function that sets the OnceCell (and fails if called more than once), the callback receives some kind of Info struct that contains infos about the query.
The code would look like that (really high level idea):
At this point the usage would be really simple:
Beta Was this translation helpful? Give feedback.
All reactions