abpframework / abp

Open-source web application framework for ASP.NET Core! Offers an opinionated architecture to build enterprise software solutions with best practices on top of the .NET. Provides the fundamental infrastructure, cross-cutting-concern implementations, startup templates, application modules, UI themes, tooling and documentation.
https://abp.io
GNU Lesser General Public License v3.0
12.92k stars 3.44k forks source link

Introduce ABP Diagnostics Module #15932

Open mgochmuradov opened 1 year ago

mgochmuradov commented 1 year ago

Describe the solution you'd like

An ideal solution would be to use a new Volo.Abp.Diagnostics module like:

[DependsOn(typeof(AbpDiagnosticsModule))]
// Or even
[DependsOn(typeof(AbpDiagnosticsOpenTelemetryModule))]

this should register interceptors for diagnostics.

Then in any class

[Diagnostics]
public class Worker : ITransientDependency
{
    [Diagnostics("Doing work")]
    public async Task DoWork()
    {
        // code
    }
}

this should intercept this method and start an Activity with the name Worker : Doing work

And if AbpDiagnosticsOpenTelemetryModule is used, then send tracing information to the OpenTelemetry Collector

Additional context

Diagnostics is a critical concept in shipping a product. Diagnostics can help to analyze and fix applications' performance issues.

I have already implemented it for use in our company and can contribute to it by creating a PR.

Here is an example of what you get: image image

leonkosak commented 1 year ago

Great suggestion!

berkansasmaz commented 1 year ago

Thanks for your feature request 🙏 This seems like a reasonable request so I'm posting it in the backlog 🥳🥳

hikalkan commented 1 year ago

Thanks for the feature request. Isn't there a library doing it (I mean the interception part especially)? If so, we consider using it instead of own solution.

payoff commented 1 year ago

https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics?view=net-7.0