Skip to content

Update Span.record_exception to to adhere to specs#1314

Merged
codeboten merged 7 commits intoopen-telemetry:masterfrom
srikanthccv:span-record_exception
Nov 3, 2020
Merged

Update Span.record_exception to to adhere to specs#1314
codeboten merged 7 commits intoopen-telemetry:masterfrom
srikanthccv:span-record_exception

Conversation

@srikanthccv
Copy link
Copy Markdown
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, hectorhdzg and owais and removed request for a team November 1, 2020 14:41
@lzchen
Copy link
Copy Markdown
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.

Co-authored-by: Leighton Chen <lechen@microsoft.com>
@srikanthccv
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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.

lzchen and others added 3 commits November 2, 2020 09:58
Co-authored-by: Leighton Chen <lechen@microsoft.com>
Co-authored-by: Leighton Chen <lechen@microsoft.com>
Copy link
Copy Markdown
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