-
Notifications
You must be signed in to change notification settings - Fork 606
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
Rename record_error to record_exception per spec #927
Rename record_error to record_exception per spec #927
Conversation
The spec renamed record_error to record_exception. This change follows that change.
@@ -683,14 +683,14 @@ def __exit__( | |||
|
|||
super().__exit__(exc_type, exc_val, exc_tb) | |||
|
|||
def record_error(self, err: Exception) -> None: | |||
"""Records an error as a span event.""" | |||
def record_exception(self, exception: Exception) -> None: |
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.
Maybe for another PR, but is passing in the type, message and stack trace as parameters also valid for this method?
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.
Based on the spec, the recommendation was to have a convenience method to record exceptions (https://github.com/open-telemetry/opentelemetry-specification/blob/master/specification/trace/api.md#record-exception).
This seemed more pythonic than passing in exception parameters, but i'm happy to add another PR if you feel strongly about it.
…pen-telemetry#930) * chore(metrics): move each aggregator in its own file * feat(aggregators): implement histogram aggregator open-telemetry#927 * chore: address PR comments * chore: fix ConsoleMetricExporter * chore: address mayur comments * chore: add documentation on internal structure
The spec renamed record_error to record_exception. This change follows that change. See https://github.com/open-telemetry/opentelemetry-specification/blob/b8948d9cec3994e396898feca7a10025d08370db/specification/trace/api.md#record-exception