-
Notifications
You must be signed in to change notification settings - Fork 64
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
AddCustomAttribute() fails to update existing attributes when attribute limit reached. #1130
Comments
Commented by chynes: There are two implementations of Attributes: one used by Spans, another by Transactions. The code used by Spans works as expected, except for the bug described here. If you're at the max number of attributes, you can no longer update existing ones. The one used by Transactions, however, is completely different. It's implemented not as a Dictionary but as a List. That means if you set the same Attribute multiple times, each one counts against the total, which is not correct. The duplicates are removed at harvest time, but we may have already discarded a number of valid Attributes by then. I propose we move the Transaction code to using a Dictionary before fixing the issue described in this ticket, as some of the code is shared. However, this is how the original implementation worked, and was converted to a List as part of a performance optimization milestone. We will need to be careful not to make performance worse. I'm confident we can accomplish this, but we have run out of time for this milestone. I have a local branch that I started work on that I can pick up again when we revisit this ticket. |
Jira CommentId: 124225 [~jcoleman]is currently troubleshooting this ticket, and here is a quick update for folks who are following the ticket:
|
Jira CommentId: 128280 WIP changes can be found on the branch:
The Transaction attribute implementation has been converted to use a similar implementation as the Span attribute collection, but over 150 unit tests are failing. It appears that there are some undocumented expectations about behaviors of this class. |
Jira CommentId: 128298 [~jcoleman] - Yeah, a number of the unit tests specifically validate the "insert all then sort and deduplicate" behavior. It was one of the reasons I ran out of time on my investigation. |
Jira CommentId: 129931 Status update: These change still need to be performance tested. There are some concerns about increased locking with the new changes that may need to be optimized depending on findings. |
Jira CommentId: 129931 Status update: These change still need to be performance tested. There are some concerns about increased locking with the new changes that may need to be optimized depending on findings. |
Work has been completed on this issue. |
Description
AddCustomAttribute() fails to update existing attributes with new value when attribute limit reached (65 attribute per transaction). This is due to this line of code:
newrelic-dotnet-agent/src/Agent/NewRelic/Agent/Core/Attributes/AttributeValueCollection.cs
Line 177 in 2ba99ea
When attribute limit reached, the agent doesn't do anything.
Expected Behavior
AddCustomAttribute() should update existing attributes even when the limit reached.
The text was updated successfully, but these errors were encountered: