-
Notifications
You must be signed in to change notification settings - Fork 813
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 should allow additional attributes #4070
Comments
Could you pls reopen this issue? |
I'm interested in picking this back up. I think the original PR was great, it seems like the only thing missing to be backwards-compatible with type signatures as well was: recordException(
exception: Exception,
- attributes?: SpanAttributes,
+ attributes?: SpanAttributes | TimeInput,
time?: TimeInput In some local testing after applying that change, it's possible to define an interface such as: interface OtherSpan extends Span {
recordException(exception: Exception, time?: TimeInput): void;
} Which, if I understand correctly, looks like the original downstream use. |
@Zirak this sounds great! |
What would be the way forward to introduce that feature? One easy, but arguable option to not introduce braking changes would be to make the methods optional. Instead of https://github.com/dvoytenko/opentelemetry-js/blob/96df3fa8c8e980833a549b821aaaeba4cec872f6/api/src/trace/span.ts#L122C1-L141C11
Another option is to update the DD trace types definitions https://github.com/DataDog/dd-trace-js/blob/0e9fc0afa6fc7692a95496fa579c0c435db277fd/index.d.ts#L1899-L1905 |
This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 14 days. |
Is your feature request related to a problem? Please describe.
The
recordException
API only accepts theexception
andtime
arguments.Describe the solution you'd like
The specification appears to require that this API also allows a user to pass additional attributes. The relevant excerpt:
The potential API update would be:
The text was updated successfully, but these errors were encountered: