Skip to content
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

Capture SOAP Action #83

Open
bobcat1506 opened this issue Dec 17, 2020 · 2 comments
Open

Capture SOAP Action #83

bobcat1506 opened this issue Dec 17, 2020 · 2 comments
Labels
enhancement New feature or request

Comments

@bobcat1506
Copy link

We (unfortunately) are still making SOAP calls using WCF due to the vendor not exposing a REST API. The SOAP calls are properly captured, but they do not capture the SOAP Action which makes it really hard to know which method the code invoked at the vendor. So this ticket is two fold. First, it is a feature request to see the capturing of the SOAP Action incorporated into the tooling.

Second, in the mean time I created a IClientMessageInspector to Tag the "http.action" to the active span. While the code is capturing the action, it is associating it to the parent span, not the span that actually made the SOAP call. How do I fix this?

@cwe1ss
Copy link
Collaborator

cwe1ss commented Dec 17, 2020

Hi! If you can get the SOAP action from the outgoing HttpRequestMessage, you can use the OnRequest-property on ConfigureHttpHandler() to set an action that inspects the outgoing HTTP calls and sets tags on its span:

services.AddOpenTracing(builder =>
{
    builder.ConfigureHttpHandler(options =>
    {
        options.OnRequest = (span, request) =>
        {
            if (request.RequestUri.AbsoluteUri == "http://example.com/api/dosomething")
            {
                span.SetTag("my-tag", "my-value");
            }
        };
    });
});

If you can't get the SOAP action from the URL, you could try setting a custom HttpRequestMessage.Properties value when you do the SOAP call (given you have access to the HttpClient) and use that in the OnRequest-logic.

Please let me know if this solves your issue.

@cwe1ss cwe1ss added the question Further information is requested label Dec 17, 2020
@cwe1ss cwe1ss added enhancement New feature or request and removed question Further information is requested labels Dec 21, 2020
@cwe1ss
Copy link
Collaborator

cwe1ss commented Dec 21, 2020

As described by @bobcat1506 in #85, the SOAP standard has a header named "SOAPAction". I don't think this should be added to this library right now as it can easily be done via the options.OnRequest-code provided above, but I'll leave this issue open for further feedback.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants