Open YanlingCui opened 1 year ago
Hey @YanlingCui!
The WCF instrumentation works with .NET Framework & .NET/Core clients. It also works for .NET Framework servers. Some examples in this folder: https://github.com/open-telemetry/opentelemetry-dotnet-contrib/tree/main/examples/wcf
Previously when this work was done there were no server bits for .NET/Core. There are now server bits available via https://github.com/corewcf/corewcf. I am not sure if this instrumentation works with that. @mconnew do you know?
As far as supported transports and encoding the WCF instrumentation should work with all of that stuff. It plugs into the pipeline and is called once messages are available. It shouldn't matter the transport or the encoding. I have not personally verified anything other than the tests/examples in the repo though.
FYI there seem to be some issues with the current implementation and efforts are underway to change how things work (ex: https://github.com/open-telemetry/opentelemetry-dotnet-contrib/pull/1247). Not sure what all will land and how things will be impacted.
Thank you @CodeBlanch for the detailed explaination.
I created a CoreWCF service locally and tried to instrument the service using the library. It requires adding TelemetryDispatchMessageInspector
into endpoint behaviors. Unfortunately, TelemetryDispatchMessageInspector
only supports NETFRAMEWORK, which means I can't instrument a NET Core WCF service. Is my understanding right?
Hi @CodeBlanch!
Seems WCF instrumentation could not work with corewcf server, do you have any plan to support this and can I raise a feature ask on it? Since we have many wcf projects would like to onboard distributed tracing and wcf instrumentation is very important to us!
@LynnLi11, you are right, there is no support for CoreWCF in this package. The best option is to implement support directly in CoreWCF library. There is an issue to track the progress https://github.com/CoreWCF/CoreWCF/issues/790.
@Kielek Cool, thank you! Looking forward this feature!
@Kielek, do you have any ideas on how to temporally add traces for CoreWCF while the feature is not ready? Shall we implement a MessageInspector in our service code? Would that work as well?
I am not an WCF (Core) expert, but is can be a good idea. I suppose it should be implemented in the similar way for WCF (Classic).
@Kielek Thanks, I'll try it.
Questions with OpenTelemetry.Instrumentation.Wcf
There is a multi-targeting service that using WCF framework. We want to automatically collect trace data for it. Hopefully, we can achieve this by leveraging
OpenTelemetry.Instrumentation.Wcf
.Here, I have several questions about the supported features of
OpenTelemetry.Instrumentation.Wcf
.Supported transport protocols We know WCF has several built-in transport protocols like HTTP, HTTPS, TCP, named pipes and so on. Can
OpenTelemetry.Instrumentation.Wcf
collect trace data from all these protocols? If not, which protocols does the library support?Supported message encoders WCF includes three message encoders: the text message encoder (POX, SOAP), the binary message encoder, MTOM encoder. According to my understanding, instrumentation library collects trace data regardless of message encoders. So,
OpenTelemetry.Instrumentation.Wcf
can collect trace data of all kinds of encoded message, right?There is only an example about adding
IDispatchMessageInspector
instrumentation to a service of .NET Framework. CanOpenTelemetry.Instrumentation.Wcf
instrument services of both .NET Framework and .NET Core?The README shows that using the
AddWcfInstrumentation
extension method to add WCF instrumentation to an OpenTelemetry TracerProvider:I checked the function description,
AddWcfInstrumentation
enables the outgoing requests automatic data collection for WCF. I wonder only outgoing requests are collected byAddWcfInstrumentation
or both incoming and outgoing requests can be collected?Appreciate if anyone could help. 🌹