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

RecordException: Allow additional attributes. #874

Merged

Conversation

Oberon00
Copy link
Member

@Oberon00 Oberon00 commented Aug 25, 2020

Fixes #814.

Changes

  • Add a MUST-requirement for RecordException to optionally support arbitrary event attributes.

Related PRs

@Oberon00 Oberon00 marked this pull request as ready for review August 25, 2020 11:35
@Oberon00 Oberon00 requested review from a team August 25, 2020 11:35
@Oberon00 Oberon00 added area:api Cross language API specification issue area:error-reporting Related to error reporting spec:trace Related to the specification/trace directory priority:p2 Medium priority level release:required-for-ga Must be resolved before GA release, or nice to have before GA labels Aug 25, 2020
@Oberon00
Copy link
Member Author

Closing & reopening this PR because the bot did not assign anyone. Maybe this was because I originally created a draft PR? Is some "ready for review" event missing in the bot's triggers?

@Oberon00 Oberon00 closed this Aug 25, 2020
@Oberon00 Oberon00 reopened this Aug 25, 2020
specification/trace/api.md Outdated Show resolved Hide resolved
@Oberon00
Copy link
Member Author

Assigning @bogdandrutu as responsible TC member because the bot seems to not support assigning ready-for-review draft PRs, and @bogdandrutu has already commented on this topic on #784.

Copy link
Member

@mwear mwear left a comment

Choose a reason for hiding this comment

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

LGTM. We'll have the integrate the commentary and API changes with #822 depending on which PR merges first.


- `RecordException(exception: Exception)`
- `RecordException(type: String, message: String, stacktrace: String)`
`RecordException` method if the language uses exceptions.
Copy link
Member

Choose a reason for hiding this comment

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

if the language uses exceptions

Do we explicitly rule out Go here? Is the intent? I know that there is an open issue to discuss Go, exceptions and errors (#764) but would like to understand if this change is intentionally excluding Go for now.

Copy link
Member Author

@Oberon00 Oberon00 Aug 25, 2020

Choose a reason for hiding this comment

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

Not really. 😕 I thought I was stating the obvious here, but if it's confusing, I can remove this change. EDIT: Technically that now does not say that Go SHOULD provide that method anymore, but it does also not say that Go SHOULD NOT provide it 😃

specification/trace/api.md Outdated Show resolved Hide resolved
Co-authored-by: Tigran Najaryan <4194920+tigrannajaryan@users.noreply.github.com>
@@ -450,6 +450,9 @@ the ordering of the events' timestamps.
Note that the OpenTelemetry project documents certain ["standard event names and
keys"](semantic_conventions/README.md) which have prescribed semantic meanings.

Note that [`RecordException`](#record-exception) is a specialized variant of
`AddEvent` for recording exception events.
Copy link
Member

Choose a reason for hiding this comment

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

I like the idea that RecordException is a variant of AddEvent. Perhaps go a bit further and call it AddExceptionEvent?

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't really have an opinion which name is better and I don't want to expand the scope of this PR. So perhaps this could be done in a follow-up?

Copy link
Member

Choose a reason for hiding this comment

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

A follow-up sounds good.

Copy link
Member

Choose a reason for hiding this comment

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

I'm forestalling that follow-up PR but just before I forget that idea: I'd even call it AddEventWithException. It may look like a minor nuance but it will be a lot more discoverable since it will be suggested by IDEs when users type AddEve....

Copy link
Member Author

Choose a reason for hiding this comment

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

Note that @iNikem had a strong opinion on renaming RecordException here #814 (comment)

Copy link
Contributor

@iNikem iNikem Aug 26, 2020

Choose a reason for hiding this comment

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

I don't have very strong opinion on renaming RecordException to AddExceptionEvent or similar. The comment above was about removing AddExceptionEvent altogether and replacing it with generic AddEvent

specification/trace/api.md Outdated Show resolved Hide resolved
Co-authored-by: Armin Ruech <armin.ruech@dynatrace.com>
@carlosalberto
Copy link
Contributor

@Oberon00 Please rebase.

@bogdandrutu
Copy link
Member

Enough approvers to be merged, but needs a rebase. I would recommend the author to allow maintainers to re-sync the branch

@arminru
Copy link
Member

arminru commented Aug 26, 2020

@bogdandrutu Done!
Allowing edits for maintainers is unfortunately only possible on private repos, not org repos, as already mentioned on #512.

@bogdandrutu
Copy link
Member

I would consider then to use a fork in your account instead of a fork in a company org to allow that. Again this needs a rebase

@bogdandrutu bogdandrutu merged commit 813aa36 into open-telemetry:master Aug 27, 2020
@Oberon00 Oberon00 deleted the record-exception branch September 2, 2020 16:33
carlosalberto pushed a commit to carlosalberto/opentelemetry-specification that referenced this pull request Oct 31, 2024
* RecordException: Allow additional attributes.

* Update CHANGELOG.

* Typo.

* Address comments, improve linebreaks.

* Typo.

* overload -> variant

Co-authored-by: Tigran Najaryan <4194920+tigrannajaryan@users.noreply.github.com>

* Comma

Co-authored-by: Armin Ruech <armin.ruech@dynatrace.com>

Co-authored-by: Tigran Najaryan <4194920+tigrannajaryan@users.noreply.github.com>
Co-authored-by: Armin Ruech <armin.ruech@dynatrace.com>
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 area:error-reporting Related to error reporting priority:p2 Medium priority level release:required-for-ga Must be resolved before GA release, or nice to have before GA spec:trace Related to the specification/trace directory
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Should Span.RecordException() support more options or be replaced by an optional AddEvent() parameter?
9 participants