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

fix(otel): Avoid concurrency issues when reporting metrics #2239

Merged
merged 6 commits into from
Mar 4, 2023

Conversation

tomkerkhove
Copy link
Owner

@tomkerkhove tomkerkhove commented Feb 26, 2023

Avoid concurrency issues when reporting metrics:

System.InvalidOperationException: Operations that change non-concurrent collections must have exclusive access. A concurrent update was performed on this collection and corrupted its state. The collection's state is no longer correct.
docker-scraper-1             |    at System.Collections.Generic.HashSet`1.AddIfNotPresent(T value, Int32& location)
docker-scraper-1             |    at System.Collections.Generic.HashSet`1.Add(T item)
  • Switch to channels

Fixes #2169

@trafico-bot trafico-bot bot added the 🔍 Ready for Review Pull Request is not reviewed yet label Feb 26, 2023
@tomkerkhove
Copy link
Owner Author

Potential better alternative: https://learn.microsoft.com/en-us/dotnet/core/extensions/channels

@tomkerkhove
Copy link
Owner Author

/azp run Promitor CI - scraper agent

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@tomkerkhove tomkerkhove merged commit 3c5472c into master Mar 4, 2023
@tomkerkhove tomkerkhove deleted the otel-concurrency branch March 4, 2023 11:22
@trafico-bot trafico-bot bot added ✨ Merged Pull Request has been merged successfully and removed 🔍 Ready for Review Pull Request is not reviewed yet labels Mar 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✨ Merged Pull Request has been merged successfully
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Scraping resource with OpenTelemetry sink is not thread safe?
1 participant