microsoft / microsoft/AzureMonitorCommunity

Correlation/concurrency issues with `UseAzureMonitor` & `WebApplicationFactory<T>`.

Open
#208 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
PowerShell
Stars
1.2k
Forks
493
PR merge metrics
No merged PRs in 30d

Description

I was directed by @tarekgh here to create an issue in this repository, so here I am 👋

There are more details in the issue linked (https://github.com/dotnet/runtime/issues/98854), but the gist of it is this: Adding UseAzureMonitor causes my integration tests to "blow up"; It's causing some immense concurrency and/or correlation issues.

Without UseAzureMonitor I have no concurrency and/or correlation issues (Only some inconsistencies in the name of the activity, which is a different issue entirely I reckon, not related to Azure).

With UseAzureMonitor however there is something happening (be that concurrency or correlation - I don't know) that's causing my integration tests to fail when running them in parallel, but work fine when I'm running them sequentially.

Later in the thread I did find a partial workaround (With its own set of problems), but the general issue stands; Something fishy is going on with UseAzureMonitor.

In case the issue over on dotnet drops or I do a lot of changes to the repro during research, here's a direct link to the GitHub repo before adding the partial workaround: https://github.com/KennethHoff/Repros/tree/b25106f575ee5c782f99dfcfe89b5fc6eb53a900/ActivityTesting

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked dotnet/runtime issue 98854 and the ActivityTesting repro at the pinned repository commit. Run the integration tests with UseAzureMonitor enabled, comparing parallel and sequential execution and reviewing the documented partial workaround. Done means the concurrency and correlation failures are reproduced, understood, and resolved without relying on that workaround.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure
Domain
observability, testing-qa
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.