jonwagner / EventSourceProxy

EventSourceProxy (ESP) is the easiest way to add scalable Event Tracing for Windows (ETW) logging to your .NET program
Other
97 stars 20 forks source link

Offer to help with the future of EventSourceProxy #59

Closed oocx closed 3 years ago

oocx commented 5 years ago

Hello Jon,

we are still using EventSourceProxy and need an updated version that targets .net standard. However, this project seems to be inactive, as there were no new updates since 2015.

If that's ok for you, I'd like to offer my help and make those changes myself. I can either submit pull requests, or you can give me permission on this repo (if that's to risky for you, I could name you members of the .NET community who know me in person and who could vouch for me).

Otherwise, we'd have to create our own fork and publish the new version under a different package name.

Regards, Mathias

jonwagner commented 5 years ago

Hey Mathias!

I've definitely too busy to maintain this project, but I'd be happy to coordinate and post new builds.

Maybe the best way is to add you as a contributor to this repo?

Send me an email at my hotmail address (jonwagner) and we'll coordinate.

Jon

jonwagner commented 5 years ago

I sent you a repo invite.

oocx commented 5 years ago

Thanks.

From a first quick look, there is only one feature missing in .net standard that will be difficult to replace: LambdaExpression.CompileToMethod(MethodBuilder mb)

I’m currently investigating how I can substitute this method.

I suggest that we also drop the NuGet version of EventSourceProxy, as the EventSource NuGet package should only be used for older .NET versions which won’t need the new EventSourceProxy.

Regards, Mathias

From: Jon Wagner notifications@github.com Sent: Freitag, 30. August 2019 14:27 To: jonwagner/EventSourceProxy EventSourceProxy@noreply.github.com Cc: Mathias Raacke mathias@raacke.info; Author author@noreply.github.com Subject: Re: [jonwagner/EventSourceProxy] Offer to help with the future of EventSourceProxy (#59)

I sent you a repo invite.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/jonwagner/EventSourceProxy/issues/59?email_source=notifications&email_token=AAEOVTDMVW5CHCINFHVCXGLQHEGYXA5CNFSM4IQAY3OKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD5RQC7Y#issuecomment-526582143, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AAEOVTDVQWJXQCO24ZWTP3DQHEGYXANCNFSM4IQAY3OA.

jonwagner commented 5 years ago

I agree

On Aug 30, 2019, at 9:14 AM, Mathias Raacke notifications@github.com<mailto:notifications@github.com> wrote:

Thanks.

From a first quick look, there is only one feature missing in .net standard that will be difficult to replace: LambdaExpression.CompileToMethod(MethodBuilder mb)

I’m currently investigating how I can substitute this method.

I suggest that we also drop the NuGet version of EventSourceProxy, as the EventSource NuGet package should only be used for older .NET versions which won’t need the new EventSourceProxy.

Regards, Mathias

From: Jon Wagner notifications@github.com<mailto:notifications@github.com> Sent: Freitag, 30. August 2019 14:27 To: jonwagner/EventSourceProxy EventSourceProxy@noreply.github.com<mailto:EventSourceProxy@noreply.github.com> Cc: Mathias Raacke mathias@raacke.info<mailto:mathias@raacke.info>; Author author@noreply.github.com<mailto:author@noreply.github.com> Subject: Re: [jonwagner/EventSourceProxy] Offer to help with the future of EventSourceProxy (#59)

I sent you a repo invite.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/jonwagner/EventSourceProxy/issues/59?email_source=notifications&email_token=AAEOVTDMVW5CHCINFHVCXGLQHEGYXA5CNFSM4IQAY3OKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD5RQC7Y#issuecomment-526582143, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AAEOVTDVQWJXQCO24ZWTP3DQHEGYXANCNFSM4IQAY3OA.

— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/jonwagner/EventSourceProxy/issues/59?email_source=notifications&email_token=AAMTO5EQXYK5TL62DJCVE63QHEMKHA5CNFSM4IQAY3OKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD5RTX4Q#issuecomment-526597106, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AAMTO5BF2NPEKK3F2L5LX73QHEMKHANCNFSM4IQAY3OA.

bartecargo commented 4 years ago

@oocx Has there been any progress on this? It's sorely needed!

ibebbs commented 3 years ago

Hey all,

I was a big advocate for EventSourceProxy on the .NET Framework and would really like to see a version that works with .NET Core (I hate injectting ILogger<T> "dependencies"). I'd be happy to help push this project forward.

On this note, rather than dynamic proxy generation at runtime, I was wondering whether C#9's source generators could be used to generate the proxies at compile time? I'm not massively familiar with them but it seems the kind of thing they might be able to do.

Cheers, Ian

jonwagner commented 3 years ago

:thinking: Yes I think source generators could replace a lot of the functionality here, if they're stable. All of the ESP work can be performed ahead of time. That would be a totally different approach, though. We would be asking people to put compile-time coding into their toolset. Not a big deal, but a different approach entirely.

It looks like LambdaExpression.CompileToMethod still isn't implemented in netcore. It might be possible to replace that code with some Reflection.Emit. Would be a bit of work but probably could be done at this point.

However, I think EventSource is currently only available on Windows installs. If you're on Windows, why not use .NET Framework instead of .NET Core? Then you could use the existing version of ESP.

ibebbs commented 3 years ago

Hi Jon,

Yup, I agree it's a totally different approach, but I thought I'd raise it here as: a) You've a lot of experience with the ESP use-cases (which would likely be very similar), and b) I loved using ESP in .NET Framework and was really hoping it would be available for .NET Core.

Regarding EventSource, it's been available in .NET Core since 2.1 and works on all supported .NET platforms both in-process and out-of-process. In point of fact, under the covers of the Microsoft.Extensions.ILogger lays DiagnosticSource and under that (well, kinda beside but anway) is... you guessed it EventSource.

There are all sorts of amazing use-cases for using EventSource in modern deployment scenarios but it's sorely lacking a decent developer story like that which ESP offered on the .NET Framework.

ibebbs commented 3 years ago

FWIW, I just wrote a proof-of-concept implementation here: https://github.com/ibebbs/EventSourceProxyGenerator. I demonstrated this working by adding a test app which uses Microsoft.Extensions.DependencyInjection to inject the proxyclass in place of the original and perform calls through the proxy to the underlying class.

While development of the source generator is a bit ugly (lots of visual studio restarts required) the use of it is very slick with the proxy classes appearing in Intellisense as soon as you add the [Proxy] attribute to a class.

With some knowledge about how best to proxy classes and implement EventSources (yup, looking at you @jonwagner ;0) this should be relatively straight-forward. Could probably also implement extensions for Microsoft.Extensions.DependencyInjection to rebind the proxied classes.

jonwagner commented 3 years ago

Cool. I'll put this on my list of fun projects for the upcoming holiday week. We'll see how it goes....

jonwagner commented 3 years ago

Teeing this up for some heads down coding later this week...

ibebbs commented 3 years ago

Nice. Need any help?

Also, think it'd be possible to add attributes to the interface/class members being proxied to allow automatic implementation of performance counters? (https://docs.microsoft.com/en-us/dotnet/core/diagnostics/event-counter-perf)

jonwagner commented 3 years ago

I haven't touched this project in a while, so I can use any help I can get. :)

I'll probably start by seeing if we can get the existing IL code working - Lambdas aren't quite supported but maybe that's the right first pass. If not, then we can try porting to the code gen approach you outlined.

Send me your email address (mine is just the same id at hotmail). I'll add you to the Insight.Database slack group and we can work over there.

jonwagner commented 3 years ago

I was able to get everything to build and test with .net standard 2.0.

There is a test version in nuget: 4.0.0-beta1

jonwagner commented 3 years ago

Added support for net46 / netstandard2.0 so we can use the same code against either platform. Will release a build soon!

jonwagner commented 3 years ago

4.0.0 is now available in nuget