open-telemetry / opentelemetry-dotnet-contrib

This repository contains set of components extending functionality of the OpenTelemetry .NET SDK. Instrumentation libraries, exporters, and other components can find their home here.
https://opentelemetry.io
Apache License 2.0
423 stars 254 forks source link

Add CoreWCF Instrumentation #1939

Open marlon-tucker opened 3 days ago

marlon-tucker commented 3 days ago

Component

None

Is your feature request related to a problem?

WCF instrumentation is already supported.

CoreWCF is the .NET Foundation supported framework designed to bring a level of support for WCF into the modern AspNetCore pipeline.

However, CoreWCF uses a different namespace to System.ServiceModel which means the existing WCF instrumentations can not be used.

What is the expected behavior?

A new instrumentation library is created specifically for CoreWCF. The Client channel instrumentation does not need to be implemented as CoreWCF is only server side.

The instrumentation should also be able to be used in conjunction with AspNetCore instrumentation, which will likely have created it's own Activity before the CoreWCF pipeline engages - so how the two activities interact remains to be seen.

Which alternative solutions or features have you considered?

There is no alternative at the moment.

Additional context

The majority of the existing WCF instrumentation can likely be copy pasted with just a few minor alterations to how things are reflected over and namespaces, plus removing any of the client channel infrastructure. The only major difference I can see will be how the existing Activity from AspNetCore is handled.

There is also question of supported runtimes, I see from the contributing guidelines projects are meant to target the same runtimes as the main OpenTelemetry project however CoreWCF does not target NET Framework so this won't be feasible.

Kielek commented 3 days ago

There is a plan to implement this feature natively in CoreWCF. My recommendation is to invest time directly in CoreWCF repository, instead of creating additional package.

Then, you type something like this tracerBuilder.AddSource("CoreWCF"); without including any external packages.

Ref: https://github.com/CoreWCF/CoreWCF/issues/790

@birojnayak, please check this request.