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

Experiment: ResourceValue as struct #378

Closed
wants to merge 3 commits into from
Closed

Experiment: ResourceValue as struct #378

wants to merge 3 commits into from

Conversation

bruno-garcia
Copy link
Member

@bruno-garcia bruno-garcia commented Dec 7, 2019

An attempt to come up with a "union type" for the Resource Value.
Since this might be total crap, I'm opening a draft to discuss before investing time.

If we decided to move on with this, we'd need to discuss/consider:

  1. When mapping attributes from OTel which have a value of type ResourceValue to a string like in the case of Zipkin, what would be correct behavior be? Is there any consideration to the ToString formatting of this or simply calling ToString on all the inner types is good enough?
  2. Needs tests for validation and also using the API not only with string value but also the other types
  3. Implement the correct types. Spec says: string, int64, double, bool.
  4. Add in when taking ResourceValue as a parameter in the SDK/API.
  5. Write some benchmarks (probably before anything) to make sure this isn't prohibitively slow.

@SergeyKanzhelev
Copy link
Member

wait, should values be of various types, not keys?

@bruno-garcia
Copy link
Member Author

bruno-garcia commented Dec 9, 2019

/me hides

Ok now read the code as ResourceValue. Would that make sense?
Considering the TODO's of the description if we go ahead.
How do you plan to implement this

Updated the description.

@bruno-garcia bruno-garcia changed the title Experiment: ResourceKey as struct Experiment: ResourceValue as struct Dec 9, 2019
@lmolkova
Copy link

Everywhere else (Span.Attributes) we simply use object as a type of value. There is a long discussion where we got rid of AttributeValue here. Major points are:

Resource can validate that type is one of the expected and don't allow wrong things.

I prefer us to be consistent and not come up with the ResourceValue.

@bruno-garcia
Copy link
Member Author

The only reason for this was to avoid boxing the value types.
Many strong reasons not to do this, so closing it.

@bruno-garcia bruno-garcia deleted the feat/resource-key branch December 10, 2019 04:38
Yun-Ting pushed a commit to Yun-Ting/opentelemetry-dotnet that referenced this pull request Oct 13, 2022
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.

None yet

3 participants