Is it possible to have a the WCF Client activity get a parent activity?
Possible to have a the WCF Client activity get a parent activity?
List of all OpenTelemetry NuGet
packages and version that you are
using (e.g. OpenTelemetry 1.3.2):
- OpenTelemetry.Api.ProviderBuilderExtensions - version=1.7.0-alpha.1
- OpenTelemetry.Exporter.OpenTelemetryProtocol - version=1.7.0-alpha.1
- OpenTelemetry.Instrumentation.AspNet - version=1.6.0-beta.2
- OpenTelemetry.Instrumentation.AspNet.TelemetryHttpModule - version=1.6.0-beta.2
- OpenTelemetry.Instrumentation.Http - version=1.6.0-beta.2
- OpenTelemetry.Instrumentation.Wcf - version=1.0.0-rc.13
Runtime version (e.g. net462, net48, net6.0, net7.0 etc. You can
find this information from the *.csproj file):
- net481
Is this a feature request or a bug?
- [x] Feature Request
- [ ] Bug
What is the expected behavior?
I'd like to see if there is a way for the ActivityStart for the WCF Client, ClientChannelInstrumentation to have the ability to read a parent activity id from somewhere?
What is the actual behavior?
Currently, when the client activity is started:
var activity = WcfInstrumentationActivitySource.ActivitySource.StartActivity(
WcfInstrumentationActivitySource.OutgoingRequestActivityName,
ActivityKind.Client);
Any context about where the activity started from is lost. In my case we are getting a new client from within a web request and sending out to a remote WCF service and handling the response.
Current Behavior:
I modified some things in a copy of code and was able to get the result I wanted, I'm just not sure that it's the "WCF" way or the best way with OpenTelemetry.
What I essentially did for this, was to grab the existing span id and parent id and craft a W3C traceparent header value and add to the message before it gets to the TelemetryBehavior
This may be a good question for @repl-chris seeing as the overhaul he recently completed made much of this way easier with WCF. 🎉
Not 100% sure if I am asking in the correct location either, feel free to redirect me to the best place if not.
TLDR:
- Is it possible to set or pull the parent activity before creating and starting the activity for the WCF client?
- If there is another way, I am all ears :)