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

Resource improvement - Option 1 #1462

Closed

Conversation

CodeBlanch
Copy link
Member

Fixes #1397.

Changes

Stores Resource on each Activity as a tag instead of as a custom property. This is to avoid an allocation on every Activity currently done to store Resource as a custom property.

This is by far the most expensive option from a performance perspective. We store Resource on every Activity. You have to enumerate on tags to retrieve it. And then you have to exclude the resource tag from being written out with other tags during export. Not a huge hit, but the other options avoid it all.

Also, every Exporter would have to know to exclude the special otel.resource tag. We could document to exclude all "otel.*" tags, but that carries an even more expensive comparison while looping, even bigger perf hit.

TODOs:

@cijothomas
Copy link
Member

Only reason to consider option1, : If .NET 6 can support storing Resource in ActivitySource, then all the perf issues will be eliminated.
(Though there is still the "legacy" new Activity() which has default ActivitySource issue).

Lets keep this PR open for now, and see if Option3 can be merged. If Option3 works, then we are good!

@CodeBlanch CodeBlanch closed this Nov 4, 2020
@CodeBlanch CodeBlanch deleted the resource-option-a branch November 17, 2020 17:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Avoid Activity.SetCustomPropery usage for Resource.
2 participants