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

Update Span.record_exception to to adhere to specs #1314

Merged
merged 7 commits into from
Nov 3, 2020

Conversation

srikanthccv
Copy link
Member

@srikanthccv srikanthccv commented Nov 1, 2020

Description

Spec says,

To facilitate recording an exception languages SHOULD provide a RecordException method if the language uses exceptions. This is a specialized variant of AddEvent, so for anything not specified here, the same requirements as for AddEvent apply.

AddEvent accepts optional event attributes and timestamp. This PR makes Span.record_exception to to adhere to specs

How Has This Been Tested?

  • tox

Checklist:

  • Followed the style guidelines of this project
  • Changelogs have been updated
  • Unit tests have been added
  • Documentation has been updated

@srikanthccv srikanthccv requested review from a team, owais and hectorhdzg and removed request for a team November 1, 2020 14:41
@lzchen
Copy link
Contributor

lzchen commented Nov 2, 2020

Can you add a link to the specs changes in question that fixes? Since there was no issue created for this, a small description of the changes would be great.

@srikanthccv
Copy link
Member Author

Hi @lzchen, Thanks for the suggestion. I have updated the description.

self,
exception: Exception,
attributes: types.Attributes = None,
timestamp: Optional[int] = None,
Copy link
Contributor

Choose a reason for hiding this comment

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

Is timestamp defined in the specs?

Copy link
Member Author

Choose a reason for hiding this comment

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

From specs

To facilitate recording an exception languages SHOULD provide a RecordException method if the language uses exceptions. This is a specialized variant of AddEvent, so for anything not specified here, the same requirements as for AddEvent apply

An API to record a single Event where the Event properties are passed as arguments. This MAY be called AddEvent. This API takes the name of the event, optional Attributes and an optional Timestamp which can be used to specify the time at which the event occurred

@lzchen
Copy link
Contributor

lzchen commented Nov 2, 2020

@lonewolf3739 @codeboten

Looks like we have an issue and PR open for this already. However if we can get this one approved we can just merge this one.

Copy link
Contributor

@codeboten codeboten left a comment

Choose a reason for hiding this comment

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

Thanks for implementing this change!

@codeboten codeboten merged commit 28f35b8 into open-telemetry:master Nov 3, 2020
@srikanthccv srikanthccv deleted the span-record_exception branch November 3, 2020 16:38
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.

4 participants