npgsql icon indicating copy to clipboard operation
npgsql copied to clipboard

Possibly use IMeterFactory when targeting net8.0

Open roji opened this issue 2 years ago • 2 comments

See docs

roji avatar Aug 04 '23 09:08 roji

Updated Link

WhatzGames avatar Sep 21 '23 20:09 WhatzGames

Briefly discussed with @noahfalk a while ago...

Doing this means having multiple IMeterFactories - one per data source - each instantiating its own version of each meter; for example, there would be multiple meters with the name db.client.connections.usage, each reporting information for the connections used for its data source. Note that measurements emitted by these different meters can still be distinguished and correlated with their data source, as the data source identifier (configured name or connection string) is emitted as a dimension.

As long as metrics are non-observable, this should work fine, but observable ones (which we do have) could be problematic. This is something we'll have to carefully look at.

The underlying problem is that the source of metrics (data source) isn't a singleton, like Kestrel is for web. In theory, if we wanted to provide a totally application-global, aggregate set of metrics for all data sources, that would be static and could easily use IMeterFactory. But as things are, I'm not sure how this will work.

Moving out to 9.0.

roji avatar Nov 08 '23 18:11 roji