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

Clarify that link and event don't need to be objects in the API #1065

Merged
merged 5 commits into from
Oct 10, 2020

Conversation

bogdandrutu
Copy link
Member

Signed-off-by: Bogdan Drutu bogdandrutu@gmail.com

Related issues #1037

@bogdandrutu bogdandrutu requested review from a team as code owners October 6, 2020 17:38
@bogdandrutu bogdandrutu added area:api Cross language API specification issue release:allowed-for-ga Editorial changes that can still be added before GA since they don't require action by SIGs spec:trace Related to the specification/trace directory labels Oct 6, 2020
Copy link
Member

@tigrannajaryan tigrannajaryan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, @bogdandrutu I don't understand this PR. I read the PR description but don't understand how the changes in the text help with that.

specification/trace/api.md Show resolved Hide resolved
specification/trace/api.md Outdated Show resolved Hide resolved
@bogdandrutu
Copy link
Member Author

@tigrannajaryan the most important change is the removing of "The Link SHOULD be an immutable type." and equivalent for Event.


- `SpanContext` of the `Span` to link to.
- Zero or more `Attribute`s as defined [here](../common/common.md#attributes).

The `Link` SHOULD be an immutable type.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we still say Links (and Events) SHOULD be immutable? This would mean that if they're implemented as objects, those should be immutable, and if implemented simply by accepting their properties directly in the API, they're already implicitly immutable.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also implementing as a non-immutable but passing by value or const ref in c++ is correct:

struct Event {
  std::string name;
  Attributes attributes;
};

class Span {
 public:
  virtual void addEvent(const Event& event) = 0;
  virtual void addEvent(Event event) = 0;
};

Both options are valid, even though the Event is not immutable. Also same construction can be applied in golang where passing by value is possible.

Because of this I prefer to not say anything and as everyone complained, we should let the language SIG members decide on what is the language idiomatic way.

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
@bogdandrutu
Copy link
Member Author

No significant changes were made to this PR in the past 48h, also this PR does not add any new concept or feature, so can be merged.

@bogdandrutu bogdandrutu merged commit f4ed66b into open-telemetry:master Oct 10, 2020
@bogdandrutu bogdandrutu deleted the optionalobj branch October 10, 2020 00:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:api Cross language API specification issue release:allowed-for-ga Editorial changes that can still be added before GA since they don't require action by SIGs spec:trace Related to the specification/trace directory
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants