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

api::Value is much more loosely typed than the spec #317

Closed
djc opened this issue Oct 30, 2020 · 2 comments
Closed

api::Value is much more loosely typed than the spec #317

djc opened this issue Oct 30, 2020 · 2 comments

Comments

@djc
Copy link
Contributor

djc commented Oct 30, 2020

In particular, it allows heterogenous arrays and has a Bytes variant that doesn't seem to appear in the spec. Would it be useful to define it more like this?

enum Primitive {
    Bool(bool),
    Int(i64),
    Float(f64),
    String(String),
}

enum Array {
    Bool(Vec<Option<bool>>),
    Int(Vec<Option<i64>>),
    Float(Vec<Option<f64>>),
    String(Vec<Option<String>>),
}

enum Value {
    Primitive(Primitive),
    Array(Array),
}

https://github.com/open-telemetry/opentelemetry-specification/blob/9e6a3de19cb3db983b2e4d56b37ec6313fd4ffc6/specification/common/common.md#attributes

@jtescher
Copy link
Member

Additional discussion around optional array values: open-telemetry/opentelemetry-specification#1155

djc added a commit to djc/opentelemetry-rust that referenced this issue Oct 31, 2020
djc added a commit to djc/opentelemetry-rust that referenced this issue Oct 31, 2020
djc added a commit to djc/opentelemetry-rust that referenced this issue Oct 31, 2020
djc added a commit to djc/opentelemetry-rust that referenced this issue Oct 31, 2020
djc added a commit to djc/opentelemetry-rust that referenced this issue Oct 31, 2020
@jtescher jtescher mentioned this issue Nov 2, 2020
15 tasks
djc added a commit to djc/opentelemetry-rust that referenced this issue Nov 2, 2020
djc added a commit to djc/opentelemetry-rust that referenced this issue Nov 2, 2020
djc added a commit to djc/opentelemetry-rust that referenced this issue Nov 2, 2020
djc added a commit to djc/opentelemetry-rust that referenced this issue Nov 2, 2020
djc added a commit to djc/opentelemetry-rust that referenced this issue Nov 2, 2020
djc added a commit to djc/opentelemetry-rust that referenced this issue Nov 2, 2020
@djc
Copy link
Contributor Author

djc commented Nov 3, 2020

After #323, #332 and #333, I think this is now in a pretty good shape.

@djc djc closed this as completed Nov 3, 2020
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

No branches or pull requests

2 participants