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

[BUG] SOAP request action doesn't get appended to Transaction Name #2261

Closed
Osch-1 opened this issue Jan 24, 2024 · 0 comments
Closed

[BUG] SOAP request action doesn't get appended to Transaction Name #2261

Osch-1 opened this issue Jan 24, 2024 · 0 comments
Labels

Comments

@Osch-1
Copy link

Osch-1 commented Jan 24, 2024

Intro

Hi! First - thank you for contributing this rep, it's very nice to be able to use apm even with old .net versions

APM Agent version

1.25.3

Environment

Operating system and version:
Windows 17763

.NET Framework/Core name and version (e.g. .NET 4.6.2, NET Core 3.1.100) :
Application Target Framework(s) (e.g. net462, netcoreapp3.1):
.NET Framework 4.7.2

Describe the bug

I have SOAP service, lets call it IntegrationService, it is hosted in IIS
The issue is that names of transactions that represent SOAP requests doesnt contain SOAP action, that is contained in body(in my case since it v1.2) or in SOAPAction header, so in result i have all my transactions "compressed" into one(attached screen)
image

To Reproduce

Steps to reproduce the behavior:
*I assume that u have elk set up and you are able to service to it

  1. Setup simple SOAP service on .NetFramework 4.7.2, it must be hosted via IIS 10.0
    This service must contain at least one action, I'll call it GetProducts
  2. Configure Elastic.Apm.Agent
  1. Then make a request to GetProducts endpoint of your service
  2. Go to Kibana -> APM
    You will see your service and your request represented as a transaction
    Name of this transaction will be "POST /Service.svc" without "GetProducts" part

Expected behavior

The name of the transaction must contain SOAP Action name, in this case GetProducts part
Full transaction name would be - "POST /Service.svc GetProducts"

Actual behavior

The name of the transaction doesn't contain "GetProducts" part

Bug cause

This behaviour is caused by this part of the code

if (realTransaction == null || !realTransaction.HasCustomName)

image

This code won't work properly for common Apm Transaction class, since in case realTransaction is not null we will check if realTransaction.HasCustomName, but in case realTransaction is not null it will always be set to some value in code above(lines 455 - 533 of the same class - ElasticApmModule.cs)

Possible fix

If I'm it's actually a bug, I'd like to fix it, since I really want to use apm in my applications(actually multiple - about 10)
I see the next solution - remove if statement and always set this Action
image

I searched thour history of this repo and found another approach
image

It won't work, since setting Name property for instance of Transaction class will always set HasCustomName to true and your Code above are settings this property. We can work it out by providing NameInternal property in Transaction class

Hope you will reply soon, thank you in advance

@Osch-1 Osch-1 added the bug Something isn't working label Jan 24, 2024
@Osch-1 Osch-1 closed this as completed Jan 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant