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

Application Insights does not log dependencies with a profiler attached #2869

Open
VladimirAkopyan opened this issue Apr 24, 2024 · 1 comment
Labels

Comments

@VladimirAkopyan
Copy link

VladimirAkopyan commented Apr 24, 2024

  1. ApplicationInsights.AspNetCore 2.22
  2. NewRelic.Agent 10.23.0
  3. Swashbuckle.AspNetCore
  • Runtime version: .Net 8
  • Hosting environment: Docker Desktop and Azure Kubernetes Service

Describe the bug

Application insights does not log some Dependency HTTP requests when NewRelic agent is installed and Profiler is attached.
image

Our company has been using Applicaiton Insights and NewRelic in parallel on .Net Core 2 and 3.1.
During out migration to .Net 8 we have discovered that some dependencies have got missing.
This happens to some HTTP requests, but not others - it appears to depend on the URL. For example HTTP GET request to google.com will always be logged, but HTTP GET to api.restful-api.dev/objects will not, for no obvious reason.

To Reproduce

I have created a project using ASP.Net 8 API template, with Docker Compose, Application Insights and NewRelic Agent.
You will need to set a New Relic License key and an Application Insights connection string to test.

Run the application, and open the swagger UI. Make the default GET request
Upon receiving the GET request, the .Net Application will make several API requests

var client = new HttpClient();
await client.GetAsync($"{baseURL}");
await client.PostAsJsonAsync($"{baseURL}posts", "{ \"phone\": \"+1 (975) 458-3685\"}");
await client.PutAsJsonAsync($"{baseURL}posts/1", "{ \"phone\": \"+1 (975) 458-3685\"}");
await client.PatchAsJsonAsync($"{baseURL}posts/1", "{ \"phone\": \"+1 (975) 458-3685\"}");
await client.DeleteAsync($"{baseURL}posts/1");
await client.GetAsync($"{baseURL}posts");
await client.GetAsync("https://google.com");
await client.GetAsync("https://api.restful-api.dev/objects");

Check Application Insights, and you will see that only the GET request to google is logged.
Other dependencies, like SQL and service bus, are logged successfully.

In my understanding, this Application Insights Package does not attach as a profiler and thus I am unclear why it is affected.
If New Relic Agent is removed, the issue dissapears.

@VladimirAkopyan
Copy link
Author

The sample here demonstrates the error: https://github.com/VladimirAkopyan/NewRelic_AppInsights_Conflict

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