-
Notifications
You must be signed in to change notification settings - Fork 871
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
Conversation
There was a problem hiding this 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.
@tigrannajaryan the most important change is the removing of "The |
|
||
- `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. |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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>
6fa81c2
to
0f01ad4
Compare
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. |
Signed-off-by: Bogdan Drutu bogdandrutu@gmail.com
Related issues #1037