Apm-agent-dotnet: APM .NET Agent don鈥檛 Capture Http Status 2xx

Created on 10 Dec 2019  路  7Comments  路  Source: elastic/apm-agent-dotnet

Describe the bug
When uploading the application by running docker-compose up, a request that returns status 2xx such as http://localhost:xxxx/hc is not being captured by the APM agent but a request that returns a 404 for example http://localhost:xxxx/foo/bar is being logged by APM.

To Reproduce
Steps to reproduce the behavior:

  1. clone repository from https://github.com/luisfernandomoraes/Way2CodeChallenge
  2. Then call http://localhost:xxxx/hc
  3. Then do http://localhost:xxxx/foo/bar
  4. See Kibana APM

Expected behavior
Show the http requests with status 2xx.

bug

Most helpful comment

@luisaantonio I looked at your sample app and I think the problem is that the APM Agent is not registered as the 1. middleware here.

The app.UseAllElasticApm(Configuration); should be the 1. line in the Configure method, otherwise the APM middleware does not have a chance to capture the request before it hits MVC, or any other Middleware.

All 7 comments

Same experience here, but I am using .net core 3.1.

Yeah, I've tried the .net core 3.1 too 馃槕

Same here.
I also noticed that POST requests are not being captured.

@luisaantonio I looked at your sample app and I think the problem is that the APM Agent is not registered as the 1. middleware here.

The app.UseAllElasticApm(Configuration); should be the 1. line in the Configure method, otherwise the APM middleware does not have a chance to capture the request before it hits MVC, or any other Middleware.

@gregkalapos Thanks!
Your tip solved the problem here.

Great, thanks for the quick feedback.

I looked into our docs, and as it seems we don't document this properly. I'll add this to the docs!

Thanks @gregkalapos!!
Problem solved here too.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mterwoord picture mterwoord  路  7Comments

vhatsura picture vhatsura  路  4Comments

v1v picture v1v  路  3Comments

lreuven picture lreuven  路  6Comments

fernandolamp picture fernandolamp  路  7Comments