-
Notifications
You must be signed in to change notification settings - Fork 302
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[OpenTelemetry.Contrib.Instrumentation.Wcf] Error on missing incoming context in TelemetryDispatchMessageInspector.AfterReceiveRequest #202
Comments
Thanks @meastp I will look into it. |
@meastp I tested this, everything seems to be working fine.
I'm going to close this but feel free to reopen. |
@CodeBlanch I'm testing your fix now, but want to be sure that I understand the problem. Adding the Name attribute to every Perhaps I'm missing some metadata/attribute? [ServiceBehavior(
Namespace = "http://www.company.com/",
ConcurrencyMode = ConcurrencyMode.Single,
InstanceContextMode = InstanceContextMode.Single)]
public class Engine : MyService, MyServiceREST this is the tcp service (this is called internally, seems to be working ok and sending traces to otel-collector): [ServiceContract(Namespace = "http://www.company.com/")]
public interface MyService
{
[OperationContract (IsOneWay = true)]
void HandleMessage(string id);
[OperationContract]
bool PingMessenger();
} this is the REST service (only this seems to be failing with the error message when called): [ServiceContract]
public interface MyServiceREST
{
[OperationContract]
[WebInvoke(Method = "GET", UriTemplate = "/groups/{type}", RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
List<GroupItem> GetGroupsREST(string type);
[OperationContract]
[WebInvoke(Method = "PUT", UriTemplate = "/groups/{type}/{group_id}", RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
GroupItem UpdateGroupREST(string type, string group_id, GroupItem group);
[OperationContract]
[WebInvoke(Method = "DELETE", UriTemplate = "/groups/{type}/{group_id}", RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
void DeleteGroupREST(string type, string group_id); |
@CodeBlanch I tried to add namespace-attribute to service contracts, and added Name identical to function-name in every OperationContract in MyServiceREST. I also updated to rc5. It seems to be working now, but I still would like to know what attributes are used/required if that's possible (so I can add this information later). Thank you for helping with this and fixing the issue in -rc5 :) |
Hi,
When using the OpenTelemetry.Contrib.Instrumentation.Wcf extension, I get errors when invoking endpoints, apparently because the code assumes that incoming context will always be present. When it is not, trying to extract
WcfInstrumentationActivitySource.IncomingRequestActivityName
throws an Exception inI think the relevant code is:
opentelemetry-dotnet-contrib/src/OpenTelemetry.Contrib.Instrumentation.Wcf/TelemetryDispatchMessageInspector.cs
Lines 59 to 68 in fa906bd
Perhaps one should check if there is a valid context before trying to extract the name? In that case, providing the context becomes optional.
cc @CodeBlanch who is the Wcf owner, sorry if this isn't the right way to do this
The text was updated successfully, but these errors were encountered: