Support for custom DiagnosticSource in APM .NET Agent

dotnet
(Oleh Zheleznyak) #1

Hi All,

Currently apm-agent-dotnet only supports pre-defined DiagnosticSources: HttpDiagnosticListener, AspNetCoreDiagnosticListener and EfCoreDiagnosticListener.

If I want more trace ability, i need to revert to "manual" api, and wrap code in Transactions and Spans.

I would like to take a standard approach in .NET and use custom DiagnosticSource and Activity classes.

It would be great if apm-agent-dotnet could provide a hook and translate some of the Activities to Spans automatically for me.

Is this a viable idea? Could this work? Any plans for that in the future?

For example, diagnostics-eventflow does a similar thing, but it writes directly to ElasticSearch, not APM Server

OpenTracing project also does a similar thing, see GenericDiagnostics

Thanks a lot for your feedback!

(Greg Kalapos) #2

Hi @oleh-zheleznyak,

this is very interesting idea; and also thanks for pointing out the other solutions!

We already talked about having something like this within the team.

I moved this to a github issue. I think this would make sense and it could work, but I must say that I haven't spent enough time on this to think through every detail of it.

We will come up with a more detailed plan about this on GitHub, free to add more comments there, too.

1 Like
(Oleh Zheleznyak) #3

Hi @GregKalapos, thanks for your reply! Looking forward!